]> code.citadel.org Git - citadel.git/commitdiff
Log citadel protocol commands using the session number
authorArt Cancro <ajc@citadel.org>
Tue, 22 Mar 2011 16:47:18 +0000 (12:47 -0400)
committerArt Cancro <ajc@citadel.org>
Tue, 22 Mar 2011 16:47:18 +0000 (12:47 -0400)
and also the user number in addition to their name, instead of the IP address (which with
IPv6 is going to create just way too much volume).  This is part of my continuing attempt
to figure out why turning on guest mode on Uncensored is giving everyone access to my
mailbox.

citadel/citserver.c

index 375d992b42c3ea06cca424385944a438aadd6b0f..7cf83fde62a5e7ad103b0fe68241eb6be015dc4d 100644 (file)
@@ -1011,10 +1011,14 @@ void do_command_loop(void) {
 
        /* Log the server command, but don't show passwords... */
        if ( (strncasecmp(cmdbuf, "PASS", 4)) && (strncasecmp(cmdbuf, "SETP", 4)) ) {
-               syslog(LOG_INFO, "CtdlCommand [%s] [%s] %s\n", CTDLUSERIP, CC->curr_user, cmdbuf);
+               syslog(LOG_INFO, "[%d][%s(%ld)] %s",
+                       CC->cs_pid, CC->curr_user, CC->user.usernum, cmdbuf
+               );
        }
        else {
-               syslog(LOG_INFO, "CtdlCommand [%s] [%s] <password command hidden from log>\n", CTDLUSERIP, CC->curr_user);
+               syslog(LOG_INFO, "[%d][%s(%ld)] <password command hidden from log>",
+                       CC->cs_pid, CC->curr_user, CC->user.usernum
+               );
        }
 
        buffer_output();