From 05ff276eefc51eeeee58832accd8398eac047037 Mon Sep 17 00:00:00 2001 From: Cedric Staniewski Date: Wed, 2 Dec 2009 19:04:33 +0100 Subject: makepkg: limit sudo usage to allowed pacman commands This is particularly useful when using pacman wrappers which call sudo by themselves and therefore should not be run as root. Signed-off-by: Cedric Staniewski Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index ef884b76..cbb1077f 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -343,7 +343,7 @@ download_file() { run_pacman() { local ret=0 - if (( ! ASROOT )) && [[ $1 != "-T" ]]; then + if (( ! ASROOT )) && [[ $1 != "-T" ]] && sudo -l $PACMAN &>/dev/null; then sudo $PACMAN $PACMAN_OPTS "$@" || ret=$? else $PACMAN $PACMAN_OPTS "$@" || ret=$? -- cgit v1.2.3-70-g09d2