MCPcopy Create free account
hub / github.com/apache/httpd / set_session_auth

Function set_session_auth

modules/aaa/mod_auth_form.c:520–539  ·  view source on GitHub ↗

* Set the auth username and password into the session. * * If either the username, or the password are NULL, the username * and/or password will be removed from the session. */

Source from the content-addressed store, hash-verified

518 * and/or password will be removed from the session.
519 */
520static apr_status_t set_session_auth(request_rec * r,
521 const char *user, const char *pw, const char *site)
522{
523 const char *hash = NULL;
524 const char *authname = ap_auth_name(r);
525 session_rec *z = NULL;
526
527 if (site) {
528 hash = ap_md5(r->pool,
529 (unsigned char *) apr_pstrcat(r->pool, user, ":", site, NULL));
530 }
531
532 ap_session_load_fn(r, &z);
533 ap_session_set_fn(r, z, apr_pstrcat(r->pool, authname, "-" MOD_SESSION_USER, NULL), user);
534 ap_session_set_fn(r, z, apr_pstrcat(r->pool, authname, "-" MOD_SESSION_PW, NULL), pw);
535 ap_session_set_fn(r, z, apr_pstrcat(r->pool, authname, "-" MOD_AUTH_FORM_HASH, NULL), hash);
536
537 return APR_SUCCESS;
538
539}
540
541/**
542 * Get the auth username and password from the main request

Calls 2

ap_auth_nameFunction · 0.85
ap_md5Function · 0.85

Tested by

no test coverage detected