Log citadel protocol commands using the session number
authorArt Cancro <ajc@citadel.org>
Tue, 22 Mar 2011 16:47:18 +0000 (12:47 -0400)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 17:19:35 +0000 (17:19 +0000)
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 2b70a2667d7249f4a9c85963f50edd4c0951daa0..ca442f9be85098020a9af2026877c252c30d33ee 100644 (file)
@@ -1037,10 +1037,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();