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

Function fcgi_define_provider

modules/aaa/mod_authnz_fcgi.c:1169–1298  ·  view source on GitHub ↗

AuthnzFcgiAuthDefineProvider {authn|authz|authnz} provider-name \ * fcgi://backendhost:backendport/ */

Source from the content-addressed store, hash-verified

1167 * fcgi://backendhost:backendport/
1168 */
1169static const char *fcgi_define_provider(cmd_parms *cmd,
1170 void *d,
1171 int argc,
1172 char *const argv[])
1173{
1174 const char *dname = "AuthnzFcgiDefineProvider";
1175 ap_rxplus_t *fcgi_backend_regex;
1176 apr_status_t rv;
1177 char *host;
1178 const char *err, *stype;
1179 fcgi_provider_conf *conf = apr_pcalloc(cmd->pool, sizeof(*conf));
1180 int ca = 0, rc, port;
1181
1182 fcgi_backend_regex = ap_rxplus_compile(cmd->pool, FCGI_BACKEND_REGEX_STR);
1183 if (!fcgi_backend_regex) {
1184 return apr_psprintf(cmd->pool,
1185 "%s: failed to compile regexec '%s'",
1186 dname, FCGI_BACKEND_REGEX_STR);
1187 }
1188
1189 err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
1190 if (err)
1191 return err;
1192
1193 if (ca >= argc) {
1194 return apr_pstrcat(cmd->pool, dname, ": No type given", NULL);
1195 }
1196
1197 stype = argv[ca];
1198 ca++;
1199
1200 if (!strcasecmp(stype, "authn")) {
1201 conf->is_authn = 1;
1202 }
1203 else if (!strcasecmp(stype, "authz")) {
1204 conf->is_authz = 1;
1205 }
1206 else if (!strcasecmp(stype, "authnz")) {
1207 conf->is_authn = conf->is_authz = 1;
1208 }
1209 else {
1210 return apr_pstrcat(cmd->pool,
1211 dname,
1212 ": Invalid provider type ",
1213 stype,
1214 NULL);
1215 }
1216
1217 if (ca >= argc) {
1218 return apr_pstrcat(cmd->pool, dname, ": No provider name given", NULL);
1219 }
1220 conf->name = argv[ca];
1221 ca++;
1222
1223 if (ca >= argc) {
1224 return apr_pstrcat(cmd->pool, dname, ": No backend-address given",
1225 NULL);
1226 }

Callers

nothing calls this directly

Calls 7

ap_rxplus_compileFunction · 0.85
ap_check_cmd_contextFunction · 0.85
ap_rxplus_execFunction · 0.85
ap_rxplus_nmatchFunction · 0.85
ap_rxplus_pmatchFunction · 0.85
ap_log_errorFunction · 0.50

Tested by

no test coverage detected