Compare commits
1 commit
stable
...
use-sudo_u
Author | SHA1 | Date | |
---|---|---|---|
738f2682b0 |
|
@ -24,6 +24,7 @@ The **patch** part changes is incremented if multiple releases happen the same m
|
|||
* mongodb: Deny the install on Debian 11 « Bullseye » when the version is unsupported
|
||||
* mongodb: Support version 5.0 (for buster)
|
||||
* mongodb: Allow to specify a mongodb version for buster & bullseye
|
||||
* packweb-apache: phpContainer now use $SUDO\_USER when available (so when run through sudo or as an unprivileged user) and $LOGNAME when not.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
|
||||
Defaults env_keep += "LOGNAME PWD"
|
||||
Defaults env_keep += "PWD"
|
||||
ALL ALL = NOPASSWD: /usr/local/bin/phpContainer
|
||||
|
|
|
@ -6,10 +6,10 @@ if [ "$EUID" -ne 0 ]; then
|
|||
exit 0;
|
||||
fi;
|
||||
|
||||
PHPVersion=$(grep SetHandler /etc/apache2/sites-enabled/$LOGNAME.conf 2>/dev/null | grep -m 1 -o 'fpm[0-9][0-9]' | head -n 1 | sed 's/php//g' | sed 's/fpm//g')
|
||||
PHPVersion=$(grep SetHandler /etc/apache2/sites-enabled/${SUDO_USER:-${LOGNAME}}.conf 2>/dev/null | grep -m 1 -o 'fpm[0-9][0-9]' | head -n 1 | sed 's/php//g' | sed 's/fpm//g')
|
||||
|
||||
if [ "$PHPVersion" != "" ]; then
|
||||
lxc-attach -n php$PHPVersion -- su - $LOGNAME -c "cd \"${PWD@E}\" && php ${*@Q}"
|
||||
lxc-attach -n php$PHPVersion -- su - ${SUDO_USER:-${LOGNAME}} -c "cd \"${PWD@E}\" && php ${*@Q}"
|
||||
else
|
||||
# TODO: fallback?
|
||||
# command php $*
|
||||
|
|
Loading…
Reference in a new issue