diff options
author | Cedric Staniewski <cedric@gmx.ca> | 2009-12-02 19:04:33 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2009-12-13 23:28:43 -0600 |
commit | 05ff276eefc51eeeee58832accd8398eac047037 (patch) | |
tree | 60e27630786b61bcac8acb783f355b463ce5aa09 /scripts | |
parent | 66c6d288fd44b2f148860c7abbd1ed56b31a9238 (diff) | |
download | pacman-05ff276eefc51eeeee58832accd8398eac047037.tar.xz |
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>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/makepkg.sh.in | 2 |
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=$? |