mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
helpers2.1: for some reason sudo -E doesn't preserve PATH even though it's exported, so we gotta explicitly use --preserve-env=PATH
This commit is contained in:
parent
b3409729a6
commit
5f6df6a859
1 changed files with 2 additions and 2 deletions
|
@ -174,9 +174,9 @@ ynh_system_user_delete() {
|
|||
|
||||
# Execute a command after sudoing as $app
|
||||
#
|
||||
# Note that exported bash env variables are kept (using -E option of sudo)
|
||||
# Note that the $PATH variable is preserved (using --preserve-env=PATH)
|
||||
#
|
||||
# usage: ynh_exec_as_app COMMAND [ARG ...]
|
||||
ynh_exec_as_app() {
|
||||
sudo -E -u "$app" "$@"
|
||||
sudo --preserve-env=PATH -u "$app" "$@"
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue