* Changed the format of RWHO output to provide non-masqueraded user/room/host
authorArt Cancro <ajc@citadel.org>
Sat, 29 Jul 2000 05:29:23 +0000 (05:29 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 29 Jul 2000 05:29:23 +0000 (05:29 +0000)
  names (to Aides only) as additional fields rather than an extra line of
  output.
* Changed the client to display new RWHO fields, in the "long" wholist only.
* Default SMTP and POP ports are now -1, not 25/110.  These services must now
  be activated manually.

citadel/ChangeLog
citadel/citadel.c
citadel/serv_rwho.c
citadel/setup.c
citadel/techdoc/session.txt

index 659c3a5a5f96715453121c488db1f78e7af79e18..c4568e689750a48876bd20f355f3920fe8197f6f 100644 (file)
@@ -1,4 +1,12 @@
  $Log$
+ Revision 572.20  2000/07/29 05:29:19  ajc
+ * Changed the format of RWHO output to provide non-masqueraded user/room/host
+   names (to Aides only) as additional fields rather than an extra line of
+   output.
+ * Changed the client to display new RWHO fields, in the "long" wholist only.
+ * Default SMTP and POP ports are now -1, not 25/110.  These services must now
+   be activated manually.
+
  Revision 572.19  2000/07/24 00:39:13  ajc
  * Fixed a path problem when calling netmailer from mailinglist.c
 
@@ -1960,3 +1968,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
+
index f53e3bfb1923090af95eae0c7a2530d0a1826ab0..17ba3cc7c3221ac02e38002c25b50450da42afa0 100644 (file)
@@ -728,8 +728,9 @@ void get_serv_info(void)
  */
 void who_is_online(int longlist)
 {
-       char buf[128], username[128], roomname[128], fromhost[128],
-        flags[128];
+       char buf[128], username[128], roomname[128], fromhost[128];
+       char flags[128];
+       char actual_user[128], actual_room[128], actual_host[128];
        char tbuf[128], clientsoft[128];
        time_t timenow = 0;
        time_t idletime, idlehours, idlemins, idlesecs;
@@ -760,6 +761,11 @@ void who_is_online(int longlist)
                        extract(flags, buf, 7);
 
                        if (longlist) {
+
+                               extract(actual_user, buf, 8);
+                               extract(actual_room, buf, 9);
+                               extract(actual_host, buf, 10);
+
                                idletime = timenow - extract_long(buf, 5);
                                idlehours = idletime / 3600;
                                idlemins = (idletime - (idlehours * 3600)) / 60;
@@ -770,6 +776,14 @@ void who_is_online(int longlist)
                                       fromhost, clientsoft,
                                       (long) idlehours, (long) idlemins, (long) idlesecs);
 
+                               if ( (strlen(actual_user)+strlen(actual_room)+strlen(actual_host)) > 0) {
+                                       pprintf("(really ");
+                                       if (strlen(actual_user)>0) pprintf("<%s> ", actual_user);
+                                       if (strlen(actual_room)>0) pprintf("in <%s> ", actual_room);
+                                       if (strlen(actual_host)>0) pprintf("from <%s> ", actual_host);
+                                       pprintf(")\n");
+                               }
+
                        } else {
                                if (extract_int(buf, 0) == last_session) {
                                        pprintf("        ");
index 3c7979e0799001fbb45f70e4760177b125280852..5f39d9be70ae30d0730c9c7803c224e1841891a7 100644 (file)
@@ -43,6 +43,9 @@
 void cmd_rwho(char *argbuf) {
        struct CitContext *cptr;
        int spoofed = 0;
+       int user_spoofed = 0;
+       int room_spoofed = 0;
+       int host_spoofed = 0;
        int aide;
        char un[40];
        char real_room[ROOMNAMELEN], room[ROOMNAMELEN];
@@ -55,6 +58,9 @@ void cmd_rwho(char *argbuf) {
        {
                flags[0] = '\0';
                spoofed = 0;
+               user_spoofed = 0;
+               room_spoofed = 0;
+               host_spoofed = 0;
                
                if (cptr->cs_flags & CS_POSTING)
                   strcat(flags, "*");
@@ -65,6 +71,7 @@ void cmd_rwho(char *argbuf) {
                {
                   strcpy(un, cptr->fake_username);
                   spoofed = 1;
+                  user_spoofed = 1;
                }
                else
                   strcpy(un, cptr->curr_user);
@@ -73,6 +80,7 @@ void cmd_rwho(char *argbuf) {
                {
                   strcpy(host, cptr->fake_hostname);
                   spoofed = 1;
+                  host_spoofed = 1;
                }
                else
                   strcpy(host, cptr->cs_host);
@@ -82,6 +90,7 @@ void cmd_rwho(char *argbuf) {
                if (cptr->fake_roomname[0]) {
                        strcpy(room, cptr->fake_roomname);
                        spoofed = 1;
+                       room_spoofed = 1;
                }
                else {
                        strcpy(room, real_room);
@@ -95,22 +104,36 @@ void cmd_rwho(char *argbuf) {
                
                if (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
                {
-                       cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
+                       cprintf("%d|%s|%s|%s|%s|%ld|%s|%s|",
                                cptr->cs_pid, un, room,
                                host, cptr->cs_clientname,
                                (long)(cptr->lastidle),
                                cptr->lastcmdname, flags);
                }
-               if ((spoofed) && (aide))
-               {
-                       cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
-                               cptr->cs_pid, cptr->curr_user,
-                               real_room,
-                               cptr->cs_host, cptr->cs_clientname,
-                               (long)(cptr->lastidle),
-                               cptr->lastcmdname, flags);
-               
+
+               if ((user_spoofed) && (aide)) {
+                       cprintf("%s|", cptr->curr_user);
+               }
+               else {
+                       cprintf("|");
+               }
+
+               if ((room_spoofed) && (aide)) {
+                       cprintf("%s|", real_room);
                }
+               else {
+                       cprintf("|");
+               }
+
+               if ((host_spoofed) && (aide)) {
+                       cprintf("%s|", cptr->cs_host);
+               }
+               else {
+                       cprintf("|");
+               }
+
+               cprintf("\n");
+
        }
 
        /* Now it's magic time.  Before we finish, call any EVT_RWHO hooks
index 16e2751566f07447f3978bd1628b86e4ecc0f479..7705768ec44efa9ee5009c825cc6fc53a271ffcc 100644 (file)
@@ -849,8 +849,8 @@ int main(int argc, char *argv[])
        /*
         * Default port numbers for various services
         */
-       if (config.c_pop3_port == 0) config.c_pop3_port = 110;
-       if (config.c_smtp_port == 0) config.c_smtp_port = 25;
+       if (config.c_pop3_port == 0) config.c_pop3_port = (-1);
+       if (config.c_smtp_port == 0) config.c_smtp_port = (-1);
 
 
        /* Go through a series of dialogs prompting for config info */
index fcecb3d82bf51991945fd066784f473fa65e5c20..4246ec257484f239aa0fc2a2ee1bf41e82f443f5 100644 (file)
@@ -1048,7 +1048,10 @@ from, or "localhost" if the client is local.
      this client (Note: NOOP's don't count)
  6 - The last command received from a client. (NOOP's don't count)
  7 - Session flags.  These are: + (spoofed address), - (STEALTH mode), *
-     (posting) and . (idle).  (Citserver 5.02 and above)
+     (posting) and . (idle).
+ 8 - Actual user name, if user name is masqueraded and viewer is an Aide.
+ 9 - Actual room name, if room name is masqueraded and viewer is an Aide.
+ 10 - Actual host name, if host name is masqueraded and viewer is an Aide.
  
  The listing is terminated, as always, with the string "000" on a line by
 itself.