From 6a7631aaaf7870cd0dbb02b898fa8614abf93a38 Mon Sep 17 00:00:00 2001 From: magikcypress Date: Sat, 17 Jun 2017 18:11:38 +0200 Subject: [PATCH] [fix] add sudo for exec_as function & delete sudo or exec_composer --- scripts/_common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index adf100a..7b74120 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -55,7 +55,7 @@ exec_as() { eval $@ else # use sudo twice to be root and be allowed to use another user - sudo -u "$USER" $@ + sudo sudo -u "$USER" $@ fi } @@ -67,7 +67,7 @@ exec_composer() { shift 2 exec_as "$AS_USER" COMPOSER_HOME="${WORKDIR}/.composer" \ - sudo php "${WORKDIR}/composer.phar" $@ \ + php "${WORKDIR}/composer.phar" $@ \ -d "${WORKDIR}" --quiet --no-interaction } @@ -78,7 +78,7 @@ init_composer() { local AS_USER=${2:-admin} # install composer - sudo curl -sS https://getcomposer.org/installer \ + curl -sS https://getcomposer.org/installer \ | exec_as "$AS_USER" COMPOSER_HOME="${DESTDIR}/.composer" \ php -- --quiet --install-dir="$DESTDIR" \ || ynh_die "Unable to install Composer"