diff options
author | Daniel Campbell <zlg@gentoo.org> | 2016-09-12 02:37:08 -0700 |
---|---|---|
committer | Daniel Campbell <zlg@gentoo.org> | 2016-09-12 02:37:08 -0700 |
commit | 0db692284d2789ec6fa2ca82d630bd825f8a7f01 (patch) | |
tree | 1d3bf750d442195e380f5f384d600a0a88fd53d5 /www-servers | |
parent | dev-lang/gnu-smalltalk: version bump (diff) | |
download | gentoo-0db692284d2789ec6fa2ca82d630bd825f8a7f01.tar.gz gentoo-0db692284d2789ec6fa2ca82d630bd825f8a7f01.tar.bz2 gentoo-0db692284d2789ec6fa2ca82d630bd825f8a7f01.zip |
www-servers/lighttpd: Fix #454366, own user/group
Adds support in the initd script for LIGHTTPD_USER and LIGHTTPD_GROUP,
which are gleaned from the lighttpd.conf file's relevant variables.
Thanks Eugene Rosenzweig
Gentoo-Bug: #454366
Gentoo-Bug-URL: https://bugs.gentoo.org/454366
Package-Manager: portage-2.3.0
Diffstat (limited to 'www-servers')
-rw-r--r-- | www-servers/lighttpd/files/lighttpd.initd | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/www-servers/lighttpd/files/lighttpd.initd b/www-servers/lighttpd/files/lighttpd.initd index 04dd8cc0e872..e345f726f9bd 100644 --- a/www-servers/lighttpd/files/lighttpd.initd +++ b/www-servers/lighttpd/files/lighttpd.initd @@ -1,5 +1,5 @@ #!/sbin/openrc-run -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -31,7 +31,11 @@ checkconfig() { start() { checkconfig || return 1 - checkpath -d -q -m 0750 -o lighttpd:lighttpd /run/lighttpd/ + # Glean lighttpd's credentials from the configuration file + # Fixes bug 454366 + LIGHTTPD_USER="$(awk '/^server.username/{s=$3};{sub("\"","",s)};END{print s}' ${LIGHTTPD_CONF})" + LIGHTTPD_GROUP="$(awk '/^server.groupname/{s=$3};{sub("\"","",s)};END{print s}' ${LIGHTTPD_CONF})" + checkpath -d -q -m 0750 -o "${LIGHTTPD_USER}":"${LIGHTTPD_GROUP}" /run/lighttpd/ ebegin "Starting lighttpd" start-stop-daemon --start --quiet --exec /usr/sbin/lighttpd \ |