diff options
author | Reyk Floeter <reyk@esdenera.com> | 2015-01-19 17:48:18 +0100 |
---|---|---|
committer | Reyk Floeter <reyk@esdenera.com> | 2015-01-19 17:48:18 +0100 |
commit | dda5d0c767c20326169f23cc38b6b53e51875bc2 (patch) | |
tree | 0d99cf0b000fc966de05d655f8a426bcc2a7c634 /server_http.c | |
parent | cb77100c319cef1e1da2cbfc368e967a917ed3f4 (diff) | |
download | httpd-dda5d0c767c20326169f23cc38b6b53e51875bc2.tar.gz httpd-dda5d0c767c20326169f23cc38b6b53e51875bc2.zip |
Split auth from server_config into struct auth
Diffstat (limited to 'server_http.c')
-rw-r--r-- | server_http.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server_http.c b/server_http.c index 5bf6bd5..b1338cf 100644 --- a/server_http.c +++ b/server_http.c @@ -136,6 +136,7 @@ server_http_authenticate(struct server_config *srv_conf, struct client *clt) { FILE *fp = NULL; struct http_descriptor *desc = clt->clt_descreq; + struct auth *auth = srv_conf->auth; struct kv *ba, key; size_t linesize = 0; ssize_t linelen; @@ -166,7 +167,7 @@ server_http_authenticate(struct server_config *srv_conf, struct client *clt) if (clt_pass == NULL) goto done; - if ((fp = fopen(srv_conf->auth_htpasswd, "r")) == NULL) + if ((fp = fopen(auth->auth_htpasswd, "r")) == NULL) goto done; while ((linelen = getline(&line, &linesize, fp)) != -1) { @@ -964,7 +965,7 @@ server_response(struct httpd *httpd, struct client *clt) /* Now search for the location */ srv_conf = server_getlocation(clt, desc->http_path); - if (srv_conf->flags & SRVFLAG_AUTH_BASIC && + if (srv_conf->flags & SRVFLAG_AUTH && server_http_authenticate(srv_conf, clt) == -1) { server_abort_http(clt, 401, srv_conf->auth_realm); return (-1); |