2
0
Fork 0
mirror of https://github.com/friendica/docker synced 2024-06-22 00:24:41 +02:00

Preserve environment variable at run_as

This commit is contained in:
Philipp Holzer 2022-02-09 03:01:35 +01:00
parent 52b959db23
commit 43bc727696
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
10 changed files with 20 additions and 30 deletions

View file

@ -3,11 +3,10 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh "$@" su -p www-data -s /bin/sh -c "$1"
else else
sh "$@" sh -c "$1"
fi fi
} }

View file

@ -3,11 +3,10 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh "$@" su -p www-data -s /bin/sh -c "$1"
else else
sh "$@" sh -c "$1"
fi fi
} }

View file

@ -3,11 +3,10 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh "$@" su -p www-data -s /bin/sh -c "$1"
else else
sh "$@" sh -c "$1"
fi fi
} }

View file

@ -3,11 +3,10 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh "$@" su -p www-data -s /bin/sh -c "$1"
else else
sh "$@" sh -c "$1"
fi fi
} }

View file

@ -3,11 +3,10 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh "$@" su -p www-data -s /bin/sh -c "$1"
else else
sh "$@" sh -c "$1"
fi fi
} }

View file

@ -3,11 +3,10 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh "$@" su -p www-data -s /bin/sh -c "$1"
else else
sh "$@" sh -c "$1"
fi fi
} }

View file

@ -3,11 +3,10 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh "$@" su -p www-data -s /bin/sh -c "$1"
else else
sh "$@" sh -c "$1"
fi fi
} }

View file

@ -3,11 +3,10 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh "$@" su -p www-data -s /bin/sh -c "$1"
else else
sh "$@" sh -c "$1"
fi fi
} }

View file

@ -3,11 +3,10 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh "$@" su -p www-data -s /bin/sh -c "$1"
else else
sh "$@" sh -c "$1"
fi fi
} }

View file

@ -3,11 +3,10 @@ set -eu
# run an command with the www-data user # run an command with the www-data user
run_as() { run_as() {
set -- -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh "$@" su -p www-data -s /bin/sh -c "$1"
else else
sh "$@" sh -c "$1"
fi fi
} }