[pacman-dev] [PATCH] makepkg.sh.in: fix a GNU-ism in su invocation

Rémy Oudompheng remyoudompheng at gmail.com
Tue Apr 12 15:30:19 EDT 2011


GNU su supports the -c option to specify a command to execute.
However, other flavours of su may have a different interpretation
of the '-c' flag (e.g. FreeBSD and OpenBSD).

The behaviour is correct when '-c' follows an explicit username.

Signed-off-by: Rémy Oudompheng <remy at archlinux.org>
---
See for example:
* OpenBSD manpage at
  http://www.openbsd.org/cgi-bin/man.cgi?query=su
* FreeBSD manpage at
  http://www.freebsd.org/cgi/man.cgi?query=su

On branch 'maint'

 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 1c8c50e..69922c9 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -394,7 +394,7 @@ run_pacman() {
 		if [ "$(type -p sudo)" ]; then
 			cmd="sudo $cmd"
 		else
-			cmd="su -c '$cmd'"
+			cmd="su root -c '$cmd'"
 		fi
 	fi
 	eval "$cmd"
-- 
1.7.4.4



More information about the pacman-dev mailing list