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

Function fcgi_check_password

modules/aaa/mod_authnz_fcgi.c:935–989  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

933}
934
935static authn_status fcgi_check_password(request_rec *r, const char *user,
936 const char *password)
937{
938 const char *fn = "fcgi_check_password";
939 const char *prov = apr_table_get(r->notes, AUTHN_PROVIDER_NAME_NOTE);
940 const fcgi_provider_conf *conf;
941
942 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
943 APLOGNO(02524) "%s(%s, XXX): provider %s",
944 fn, user, prov);
945
946 if (!prov) {
947 ap_log_rerror(APLOG_MARK, APLOG_CRIT, 0, r,
948 APLOGNO(02525) "%s: provider note isn't set", fn);
949 return AUTH_GENERAL_ERROR;
950 }
951
952 conf = apr_hash_get(fcgi_authn_providers, prov, APR_HASH_KEY_STRING);
953 if (!conf) {
954 ap_log_rerror(APLOG_MARK, APLOG_CRIT, 0, r,
955 APLOGNO(02526) "%s: can't find config for provider %s",
956 fn, prov);
957 return AUTH_GENERAL_ERROR;
958 }
959
960 if (APLOGrdebug(r)) {
961 log_provider_info(conf, r);
962 }
963
964 req_rsp(r, conf, password,
965 /* combined authn and authz: FCGI_APACHE_ROLE not set */
966 conf->is_authz ? NULL : AP_FCGI_APACHE_ROLE_AUTHENTICATOR_STR,
967 NULL, NULL);
968
969 if (r->status == HTTP_OK) {
970 if (conf->is_authz) {
971 /* combined authn/authz phase, so app won't be invoked for authz
972 *
973 * Remember that the request was successfully authorized by this
974 * provider.
975 */
976 fcgi_request_notes *rnotes = apr_palloc(r->pool, sizeof(*rnotes));
977 rnotes->successful_authnz_provider = conf->name;
978 ap_set_module_config(r->request_config, &authnz_fcgi_module,
979 rnotes);
980 }
981 return AUTH_GRANTED;
982 }
983 else if (r->status == HTTP_INTERNAL_SERVER_ERROR) {
984 return AUTH_GENERAL_ERROR;
985 }
986 else {
987 return AUTH_DENIED;
988 }
989}
990
991static const authn_provider fcgi_authn_provider = {
992 &fcgi_check_password,

Callers

nothing calls this directly

Calls 3

log_provider_infoFunction · 0.85
req_rspFunction · 0.85
ap_set_module_configFunction · 0.85

Tested by

no test coverage detected