Skip to content

Commit

Permalink
Change where we set r->user if we're setting it from a
Browse files Browse the repository at this point in the history
client certificate.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/ssl@151493 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
David Reid committed Feb 5, 2005
1 parent afddbab commit 8e61a23
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions ssl_engine_kernel.c
Expand Up @@ -799,6 +799,20 @@ int ssl_hook_Access(request_rec *r)
}
}

/* If we're trying to have the user name set from a client
* certificate then we need to set it here. This should be safe as
* the user name probably isn't important from an auth checking point
* of view as the certificate supplied acts in that capacity.
* However, if FakeAuth is being used then this isn't the case so
* we need to postpone setting the username until later.
*/
if ((dc->nOptions & SSL_OPT_FAKEBASICAUTH) == 0 && dc->szUserName) {
char *val = ssl_var_lookup(r->pool, r->server, r->connection,
r, (char *)dc->szUserName);
if (val && val[0])
r->user = val;
}

/*
* Else access is granted from our point of view (except vendor
* handlers override). But we have to return DECLINED here instead
Expand Down Expand Up @@ -1042,17 +1056,6 @@ int ssl_hook_Fixup(request_rec *r)
return DECLINED;
}

/*
* Set r->user if requested
*/
if (dc->szUserName) {
val = ssl_var_lookup(r->pool, r->server, r->connection,
r, (char *)dc->szUserName);
if (val && val[0]) {
r->user = val;
}
}

/*
* Annotate the SSI/CGI environment with standard SSL information
*/
Expand Down

0 comments on commit 8e61a23

Please sign in to comment.