diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2015-01-18 14:01:18 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2015-01-18 14:01:18 +0000 |
commit | f55c920eb4a59e8b8251258da2fbc89f381cbc05 (patch) | |
tree | 0aa1f62a038cbe3ba6b0abf93dbc3195691ed3fc /usr.sbin/httpd/server_fcgi.c | |
parent | b58b7b50aa0f6b94702c2daa0337c79b80b11add (diff) |
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 'usr.sbin/httpd/server_fcgi.c')
-rw-r--r-- | usr.sbin/httpd/server_fcgi.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.sbin/httpd/server_fcgi.c b/usr.sbin/httpd/server_fcgi.c index d4135aa3925..7305eb00847 100644 --- a/usr.sbin/httpd/server_fcgi.c +++ b/usr.sbin/httpd/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"; |