Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   makepkg.sh.in: fix a GNU-ism in su invocation (http://www.linux-archive.org/archlinux-pacman-development/513320-makepkg-sh-fix-gnu-ism-su-invocation.html)

Rémy Oudompheng 04-12-2011 07:30 PM

makepkg.sh.in: fix a GNU-ism in su invocation
 
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@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


All times are GMT. The time now is 02:46 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.