summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Staniewski <cedric@gmx.ca>2009-12-02 19:04:33 +0100
committerDan McGee <dan@archlinux.org>2009-12-13 23:28:43 -0600
commit05ff276eefc51eeeee58832accd8398eac047037 (patch)
tree60e27630786b61bcac8acb783f355b463ce5aa09
parent66c6d288fd44b2f148860c7abbd1ed56b31a9238 (diff)
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 <cedric@gmx.ca> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--scripts/makepkg.sh.in2
1 files changed, 1 insertions, 1 deletions
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=$?