httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@decus.org (Rodent of Unusual Size)
Subject [PATCH] for "Missing "authuser" (%u) field in common log"
Date Sun, 12 Jan 1997 21:51:25 GMT
    I submitted this a few days ago, but I didn't see it get voted on,
    so I think it may have gotten lost.  I'm resubmitting it with
    Randy's new [PATCH] field in the subject to test his procmail ;->.

    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.

    This diff is *not* against to-day's repository tarball, but
    yesterday's.

    #ken    :-)}

Index: mod_log_config.c
===================================================================
RCS file: /usr/users/coar/myApache/repository/apache/src/mod_log_config.c,v
retrieving revision 1.20
diff -c -r1.20 mod_log_config.c
*** 1.20	1997/01/10 09:34:42
--- mod_log_config.c	1997/01/12 21:44:44
***************
*** 242,250 ****
  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,258 ----
  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; }
  
Index: mod_rewrite.c
===================================================================
RCS file: /usr/users/coar/myApache/repository/apache/src/mod_rewrite.c,v
retrieving revision 1.13
diff -c -r1.13 mod_rewrite.c
*** 1.13	1997/01/10 09:34:44
--- mod_rewrite.c	1997/01/12 21:49:40
***************
*** 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);
  

Mime
View raw message