Lines 712-717
Link Here
|
712 |
conf->auth_type_indicator, 1); |
712 |
conf->auth_type_indicator, 1); |
713 |
s->remote_user = get_env_string(r, r->user, |
713 |
s->remote_user = get_env_string(r, r->user, |
714 |
conf->remote_user_indicator, 1); |
714 |
conf->remote_user_indicator, 1); |
|
|
715 |
/* |
716 |
* Enhancement request: 'remote_user not logged in apache logfile' |
717 |
* Code taken and modified from apache2 mod_auth_basic.c ! |
718 |
*/ |
719 |
{ |
720 |
const char *auth_line; |
721 |
char *decoded_line; |
722 |
int length; |
723 |
|
724 |
/* Get the appropriate header */ |
725 |
auth_line = apr_table_get(r->headers_in, "Authorization"); |
726 |
|
727 |
if (!r->user && auth_line && 0==strcasecmp(ap_getword(r->pool, &auth_line, ' '), "Basic")) { |
728 |
|
729 |
/* Skip leading spaces. */ |
730 |
while (apr_isspace(*auth_line)) { |
731 |
auth_line++; |
732 |
} |
733 |
|
734 |
decoded_line = apr_palloc(r->pool, apr_base64_decode_len(auth_line) + 1); |
735 |
length = apr_base64_decode(decoded_line, auth_line); |
736 |
/* Null-terminate the string. */ |
737 |
decoded_line[length] = '\0'; |
738 |
|
739 |
char* user = ap_getword_nulls(r->pool, (const char**)&decoded_line, ':'); |
740 |
|
741 |
/* set the user, even though the user is unauthenticated at this point */ |
742 |
r->user = user; |
743 |
} |
744 |
} |
745 |
/* |
746 |
* End |
747 |
*/ |
715 |
|
748 |
|
716 |
s->protocol = r->protocol; |
749 |
s->protocol = r->protocol; |
717 |
s->remote_host = (char *)ap_get_remote_host(r->connection, |
750 |
s->remote_host = (char *)ap_get_remote_host(r->connection, |