diff options
author | Reyk Floeter <reyk@esdenera.com> | 2015-01-18 15:08:29 +0100 |
---|---|---|
committer | Reyk Floeter <reyk@esdenera.com> | 2015-01-18 15:08:29 +0100 |
commit | 033827073d80d99b44522279612d84a25b42645d (patch) | |
tree | 4d9767dcd63c6037420879c8f664b279a85eb6a6 /server_fcgi.c | |
parent | 56cddace6a66b505f8e47b7117290ab1214aa84a (diff) | |
download | httpd-033827073d80d99b44522279612d84a25b42645d.tar.gz httpd-033827073d80d99b44522279612d84a25b42645d.zip |
sync with -current:
First stab at implementing basic auth.
Currently the htpasswd file needs to be in the chroot; will hopefully
improved soonish.
Based on a diff from Oscar Linderholm many months ago but turned into
a complete rewrite.
input/OK reyk@
Diffstat (limited to 'server_fcgi.c')
-rw-r--r-- | server_fcgi.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/server_fcgi.c b/server_fcgi.c index d4135aa..7305eb0 100644 --- a/server_fcgi.c +++ b/server_fcgi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server_fcgi.c,v 1.46 2015/01/16 06:40:17 deraadt Exp $ */ +/* $OpenBSD: server_fcgi.c,v 1.47 2015/01/18 14:01:17 florian Exp $ */ /* * Copyright (c) 2014 Florian Obser <florian@openbsd.org> @@ -259,6 +259,14 @@ server_fcgi(struct httpd *env, struct client *clt) goto fail; } + if (srv_conf->flags & SRVFLAG_AUTH_BASIC) { + if (fcgi_add_param(¶m, "REMOTE_USER", + clt->clt_fcgi_remote_user, clt) == -1) { + errstr = "failed to encode param"; + goto fail; + } + } + /* Add HTTP_* headers */ if (server_headers(clt, desc, server_fcgi_writeheader, ¶m) == -1) { errstr = "failed to encode param"; |