View | Details | Raw Unified | Return to bug 31311
Collapse All | Expand All

(-)httpd-2.0.51/modules/loggers/mod_log_config.c (-4 / +13 lines)
Lines 321-330 Link Here
321
321
322
static const char *log_remote_user(request_rec *r, char *a)
322
static const char *log_remote_user(request_rec *r, char *a)
323
{
323
{
324
    char *rvalue = r->user;
324
    char *rvalue;
325
325
    const char *sent_pw;
326
    if (rvalue == NULL) {
326
    
327
        rvalue = "-";
327
    if (r->user == NULL) {
328
        /* Try to get user from basic authentication data if available.
329
         * Useful in reverse proxy scenarios where the real servers
330
         * are using basic auth and we need user logging */
331
        if (ap_get_basic_auth_pw(r, &sent_pw) == OK) {
332
            rvalue = r->user;
333
        } 
334
        else {
335
            rvalue = "-";
336
        }
328
    }
337
    }
329
    else if (strlen(rvalue) == 0) {
338
    else if (strlen(rvalue) == 0) {
330
        rvalue = "\"\"";
339
        rvalue = "\"\"";

Return to bug 31311