From 6efbc03d43654af562bc52f560dff6e16e786022 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 3 Feb 2021 16:50:04 +0100 Subject: [PATCH 1/2] Remove getopts from ynh_exec_as --- data/helpers.d/user | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/data/helpers.d/user b/data/helpers.d/user index f5d4b1680..201444f32 100644 --- a/data/helpers.d/user +++ b/data/helpers.d/user @@ -166,24 +166,16 @@ ynh_system_user_delete () { # Execute a command as another user # -# usage: ynh_exec_as --user=USER --command=COMMAND [ARG ...] -# | arg: -u, --user= - the user that will execute the command -# | arg: -n, --command= - the command to be executed +# usage: ynh_exec_as $USER COMMAND [ARG ...] # # Requires YunoHost version 4.1.7 or higher. -ynh_exec_as() -{ - # Declare an array to define the options of this helper. - local legacy_args=uc - local -A args_array=( [u]=user= [c]=command= ) - local user - local command - # Manage arguments with getopts - ynh_handle_getopts_args "$@" +ynh_exec_as() { + local user=$1 + shift 1 if [[ $user = $(whoami) ]]; then - eval "$command" + eval "$@" else - sudo -u "$user" "$command" + sudo -u "$user" "$@" fi } From e1062f145777bddbe6294932f7758c557306838c Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 3 Feb 2021 16:59:56 +0100 Subject: [PATCH 2/2] Update changelog for 4.1.7.1 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4ac5b6cbf..4e893dee0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +yunohost (4.1.7.1) stable; urgency=low + + - [enh] helpers: Fix ynh_exec_as regression (ac38e53a7) + + -- Alexandre Aubin Wed, 03 Feb 2021 16:59:05 +0100 + yunohost (4.1.7) stable; urgency=low - [fix] diagnosis: Handle case where DKIM record is split into several pieces (4b876ff0)