UID switching was controlled via git-dameon's --user option in $daemon_flags. This is problematic in case $gitdaemon_flags is unwittingly set to some value which omits the --user option: git-daemon would then run as root. The fix implemented here sets $daemon_user to _gitdaemon by default, and leaves $daemon_flags empty by default. This ensures that git-daemon runs as user _gitdaemon regardless of the value of $gitdaemon_flags. Anyone using git-daemon should check their system. If gitdaemon is currently running as root, set gitdaemon_user=_gitdaemon in rc.conf.local and restart the service. ok kn@
14 lines
280 B
Bash
14 lines
280 B
Bash
#!/bin/ksh
|
|
#
|
|
# $OpenBSD: gitdaemon.rc,v 1.4 2019/07/16 09:56:55 stsp Exp $
|
|
|
|
daemon="${TRUEPREFIX}/bin/git daemon --detach"
|
|
daemon_user="_gitdaemon"
|
|
|
|
. /etc/rc.d/rc.subr
|
|
|
|
pexp="${TRUEPREFIX}/libexec/git/git-daemon --detach${daemon_flags:+ ${daemon_flags}}"
|
|
rc_reload=NO
|
|
|
|
rc_cmd $1
|