brian 97/01/16 00:06:15
Modified: src mod_log_config.c mod_rewrite.c Log: Reviewed by: Randy Terbush, Chuck Murcko Submitted by: Rodent of Unusual Size <[EMAIL PROTECTED]> This patch (to mod_log_config and mod_rewrite) puts "\"\"" into the logfile for the %u substitution IFF there's a remote user but of zero length (as opposed to none at all). That should keep the logfile analysers from getting indigestion if an authentication is done with a null username. Revision Changes Path 1.21 +10 -2 apache/src/mod_log_config.c Index: mod_log_config.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_log_config.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C3 -r1.20 -r1.21 *** mod_log_config.c 1997/01/10 09:34:42 1.20 --- mod_log_config.c 1997/01/16 08:06:12 1.21 *************** *** 242,249 **** char *log_remote_logname(request_rec *r, char *a) {return (char *)get_remote_logname(r);} ! char *log_remote_user (request_rec *r, char *a) ! { return r->connection->user; } char *log_request_line (request_rec *r, char *a) { return r->the_request; } --- 242,257 ---- char *log_remote_logname(request_rec *r, char *a) {return (char *)get_remote_logname(r);} ! char *log_remote_user (request_rec *r, char *a) { ! char *rvalue = r->connection->user; ! ! if (rvalue == NULL) { ! rvalue = "-"; ! } else if (strlen (rvalue) == 0) { ! rvalue = "\"\""; ! } ! return rvalue; ! } char *log_request_line (request_rec *r, char *a) { return r->the_request; } 1.14 +10 -1 apache/src/mod_rewrite.c Index: mod_rewrite.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_rewrite.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C3 -r1.13 -r1.14 *** mod_rewrite.c 1997/01/10 09:34:44 1.13 --- mod_rewrite.c 1997/01/16 08:06:13 1.14 *************** *** 2185,2190 **** --- 2185,2191 ---- static char str3[HUGE_STRING_LEN]; static char type[20]; static char redir[20]; + char *ruser; va_list ap; int i; request_rec *req; *************** *** 2203,2211 **** if (level > conf->rewriteloglevel) return; str1 = pstrcat(r->pool, get_remote_host(connect, r->server->module_config, REMOTE_NAME), " ", (connect->remote_logname != NULL ? connect->remote_logname : "-"), " ", ! (connect->user != NULL ? connect->user : "-"), NULL); vsprintf(str2, text, ap); --- 2204,2220 ---- if (level > conf->rewriteloglevel) return; + if (connect->user == NULL) { + ruser = "-"; + } else if (strlen (connect->user) != 0) { + ruser = connect->user; + } else { + ruser = "\"\""; + }; + str1 = pstrcat(r->pool, get_remote_host(connect, r->server->module_config, REMOTE_NAME), " ", (connect->remote_logname != NULL ? connect->remote_logname : "-"), " ", ! ruser, NULL); vsprintf(str2, text, ap);