From: Art Cancro Date: Mon, 13 Jul 1998 03:24:19 +0000 (+0000) Subject: Since it is no longer possible for the utilities to access the data files X-Git-Tag: v7.86~8433 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=d55e52b11a7a2ed6c42e1c2ed1201df284ba6cf5;p=citadel.git Since it is no longer possible for the utilities to access the data files directly, they all have to be reworked to talk to the server instead. This version of userlist does that. --- diff --git a/citadel/Makefile.in b/citadel/Makefile.in index 060cc911d..924353310 100644 --- a/citadel/Makefile.in +++ b/citadel/Makefile.in @@ -15,7 +15,7 @@ client: citadel whobbs server: citserver setup utils: aidepost netmailer netproc netsetup useradmin msgform \ -readlog rcit stats sysoputil citmail netpoll mailinglist +readlog rcit stats sysoputil citmail netpoll mailinglist userlist # # @@ -156,6 +156,9 @@ netsetup: netsetup.c config.o citadel.h whobbs: whobbs.c ipc_c_tcp.o $(CC) -O $(CFLAGS) whobbs.c ipc_c_tcp.o $(LFLAGS) -o whobbs +userlist: userlist.c ipc_c_tcp.o + $(CC) -O $(CFLAGS) userlist.c ipc_c_tcp.o $(LFLAGS) -o userlist + useradmin: useradmin.c config.o citadel.h axdefs.h $(CC) -O $(CFLAGS) useradmin.c config.o $(CURSES) $(LFLAGS) -o useradmin chmod 4750 useradmin diff --git a/citadel/userlist.c b/citadel/userlist.c new file mode 100644 index 000000000..77c04ef65 --- /dev/null +++ b/citadel/userlist.c @@ -0,0 +1,156 @@ +#include +#include +#include +#include +#include +#include "citadel.h" +#include + +void attach_to_server(); + +/* + * num_parms() - discover number of parameters... + */ +int num_parms(source) +char source[]; { + int a; + int count = 1; + + for (a=0; a= n) { + strcpy(dest,""); + return; + } + strcpy(buf,source); + if ( (parmnum == 0) && (n == 1) ) { + strcpy(dest,buf); + return; + } + + while (count++ < parmnum) do { + strcpy(buf,&buf[1]); + } while( (strlen(buf)>0) && (buf[0]!='|') ); + if (buf[0]=='|') strcpy(buf,&buf[1]); + for (count = 0; counttm_mon+1), + tmbuf->tm_mday, + (tmbuf->tm_year + 1900)); + printf("%5ld %5ld\n", + extract_long(buf,4),extract_long(buf,5)); + } + printf("\n"); + } + + +void main(argc,argv) +int argc; +char *argv[]; { + char buf[256]; + + attach_to_server(argc,argv); + serv_gets(buf); + if ((buf[0]!='2')&&(strncmp(buf,"551",3))) { + fprintf(stderr,"%s: %s\n",argv[0],&buf[4]); + logoff(atoi(buf)); + } + + userlist(); + + serv_puts("QUIT"); + serv_gets(buf); + exit(0); + } + + +#ifdef NO_STRERROR +/* + * replacement strerror() for systems that don't have it + */ +char *strerror(e) +int e; { + static char buf[32]; + + sprintf(buf,"errno = %d",e); + return(buf); + } +#endif + + + + + diff --git a/citadel/utils.txt b/citadel/utils.txt index 9ce507cee..7f44ee822 100644 --- a/citadel/utils.txt +++ b/citadel/utils.txt @@ -115,18 +115,11 @@ archives of certain rooms. set when running this program. When called without any arguments, userlist will display all users (except those who have chosen to be unlisted), their user numbers, times called, messages posted, screen width, and date of their -most recent call. - - Setting the -p option (only allowed by root as distributed; you may wish -to change this) also displays passwords, and lists all users regardless of -whether they are unlisted. - - Setting the -n option causes the next argument after -n to be a user -number to search for. +most recent call. - You can also elect to sort the output by user name or user number by -specifying the -su or -sn flags. - + userlist is simply the same user listing code that is in the client, made +into a standalone utility for convenience. + READLOG