* Don't write passwords to the log (PASS and SETP commands)
authorArt Cancro <ajc@citadel.org>
Sun, 20 Feb 2005 20:26:34 +0000 (20:26 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 20 Feb 2005 20:26:34 +0000 (20:26 +0000)
* The -t command line option is back.  Now it simply calls freopen() stderr

citadel/citserver.c
citadel/server_main.c

index b3f369e2a8673dd385bb33759faac732b8f9839a..c2297a46920dce2608852fd3261bbca093c4c3fe 100644 (file)
@@ -129,7 +129,6 @@ void master_startup(void) {
 void master_cleanup(int exitcode) {
        struct CleanupFunctionHook *fcn;
        static int already_cleaning_up = 0;
-       int i;
 
        if (already_cleaning_up) while(1) sleep(1);
        already_cleaning_up = 1;
@@ -931,7 +930,15 @@ void do_command_loop(void) {
                CC->kill_me = 1;
                return;
        }
-       lprintf(CTDL_INFO, "Citadel: %s\n", cmdbuf);
+
+       /* Log the server command, but don't show passwords... */
+       if ( (strncasecmp(cmdbuf, "PASS", 4))
+          && (strncasecmp(cmdbuf, "SETP", 4)) ) {
+               lprintf(CTDL_INFO, "%s\n", cmdbuf);
+       }
+       else {
+               lprintf(CTDL_INFO, "<password command sent>\n");
+       }
 
        buffer_output();
 
index 1b94be7f6bcb78af51f48d2c8fd88b2f33efae32..49bd1be2b749dd928c8dcd1d25c42693306e259d 100644 (file)
@@ -105,6 +105,10 @@ int main(int argc, char **argv)
                        home_specified = 1;
                }
 
+               else if (!strncmp(argv[a], "-t", 2)) {
+                       freopen(&argv[a][2], "w", stderr);
+               }
+
                else if (!strncmp(argv[a], "-f", 2)) {
                        do_defrag = 1;
                }
@@ -121,6 +125,7 @@ int main(int argc, char **argv)
                                        "citserver "
                                        "[-lLogFacility] "
                                        "[-d] [-f]"
+                                       " [-tTraceFile]"
                                        " [-xLogLevel] [-hHomeDir]\n");
                        exit(1);
                }