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 Re: WWW Form Bug Report: "Missing "authuser" (%u) field in common log format if status code is 401" on Solaris 2.x
Date Tue, 07 Jan 1997 14:56:03 GMT
>    Here are two patches (mod_log_config.c and mod_rewrite.c) to address the
>    case of a null (as opposed to missing) connection->user field.  Rather
>    than emitting the empty string (which was what the userID *is*, but causes
>    the problem reported), or "-" (which is clearly wrong, since there *is* an
>    userID), it emits an empty quoted string ("\"\"").  This at least
>    maintains the place in the log entry, and indicates that an empty userID
>    was supplied.

    Has this patch gone in?

    I haven't been able to find any clear definition of what possible
    alternatives would be for a null value for this field; I suppose
    "(null)" or "(blank)" might be as acceptable as "\"\"" - although
    the first looks too much like what []printf does with a null
    pointer.  I still prefer "\"\"" though, personally.

    #ken    :-)}

>===================================================================
>RCS file: RCS/mod_log_config.c,v
>retrieving revision 1.1
>diff -c3 -r1.1 mod_log_config.c
>*** 1.1	1997/01/03 12:08:25
>--- mod_log_config.c	1997/01/03 12:53:54
>***************
>*** 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; }
>  
>===================================================================
>RCS file: RCS/mod_rewrite.c,v
>retrieving revision 1.2
>diff -c3 -r1.2 mod_rewrite.c
>*** 1.2	1996/12/31 13:49:19
>--- mod_rewrite.c	1997/01/03 12:31:19
>***************
>*** 2177,2182 ****
>--- 2177,2183 ----
>      static char str3[HUGE_STRING_LEN];
>      static char type[20];
>      static char redir[20];
>+     char *ruser;
>      va_list ap;
>      int i;
>      request_rec *req;
>***************
>*** 2195,2203 ****
>      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);
>  
>--- 2196,2211 ----
>      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