Remove exec using su to change user.
This commit is contained in:
parent
95b204be05
commit
99279936b8
1 changed files with 3 additions and 5 deletions
|
|
@ -542,14 +542,12 @@ TEMPLATE="$2"
|
||||||
|
|
||||||
# Apply user and setting.
|
# Apply user and setting.
|
||||||
[[ -n "$RUNAS_USER" ]] && {
|
[[ -n "$RUNAS_USER" ]] && {
|
||||||
SUDO="$(command -v sudo)"
|
SUDO="$(command -v sudox)"
|
||||||
SU="$(command -v su)"
|
|
||||||
if [[ -n "$SUDO" ]]; then
|
if [[ -n "$SUDO" ]]; then
|
||||||
exec "$SUDO" -b -u "$RUNAS_USER" -- "$0" "${ORIG_ARGS[@]}" "$BASEDIR" "$TEMPLATE"
|
exec "$SUDO" -b -u "$RUNAS_USER" -- "$0" "${ORIG_ARGS[@]}" "$BASEDIR" "$TEMPLATE" || die "failed to exec to change user"
|
||||||
else
|
else
|
||||||
exec -a "su" "$SU" - "$RUNAS_USER" -- "$0" "${ORIG_ARGS[@]}" "$BASEDIR" "$TEMPLATE"
|
die "cannot exec to change user: sudo not found"
|
||||||
fi
|
fi
|
||||||
die "failed to exec to change user"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# If input is to be a pipe/FIFO, open it.
|
# If input is to be a pipe/FIFO, open it.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue