From 8be08f7cae8257af6866febc9d2a57d8d8601a51 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 15 May 2013 09:58:43 -0400 Subject: Revert "paccache: avoid subshell in calling runcmd" su is terribad. In addition to reverting, this also removes support for privilege escalation via su. If you want to use paccache as root and fail to comprehend how much better sudo is than su, then run paccache directly via su. Fixes FS#35173. This reverts commit 597286eb258f841dfc00f65474138fc6192f0092. Signed-off-by: Dave Reisner Signed-off-by: Allan McRae --- contrib/paccache.sh.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'contrib') diff --git a/contrib/paccache.sh.in b/contrib/paccache.sh.in index 64c3c536..a9c6524f 100644 --- a/contrib/paccache.sh.in +++ b/contrib/paccache.sh.in @@ -109,8 +109,7 @@ runcmd() { if sudo -v &>/dev/null && sudo -l &>/dev/null; then sudo "$@" else - printf '%s ' 'root' - su -c "$(printf '%q ' "$@")" + die 'Unable to escalate privileges using sudo' fi else "$@" @@ -308,9 +307,9 @@ totalsaved=$(@SIZECMD@ "${candidates[@]}" | awk '{ sum += $1 } END { print sum } # crush. kill. destroy. (( verbose )) && cmdopts+=(-v) if (( delete )); then - runcmd xargs -0a <(printf '%s\0' "${candidates[@]}") rm "${cmdopts[@]}" + printf '%s\0' "${candidates[@]}" | runcmd xargs -0 rm "${cmdopts[@]}" elif (( move )); then - runcmd xargs -0a <(printf '%s\0' "${candidates[@]}") mv "${cmdopts[@]}" -t "$movedir" + printf '%s\0' "${candidates[@]}" | runcmd xargs -0 mv "${cmdopts[@]}" -t "$movedir" fi summarize "$pkgcount" "${candidates[@]}" -- cgit v1.2.3-24-g4f1b From 090c4006d748e0ec50b74e974b4f1fa6f3d6c1ec Mon Sep 17 00:00:00 2001 From: William Giokas <1007380@gmail.com> Date: Wed, 15 May 2013 11:25:58 -0500 Subject: contrib: Remove harcoded /etc/pacman.conf Signed-off-by: William Giokas <1007380@gmail.com> Signed-off-by: Allan McRae --- contrib/checkupdates.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/checkupdates.sh.in b/contrib/checkupdates.sh.in index 9244d85a..b41dfa03 100644 --- a/contrib/checkupdates.sh.in +++ b/contrib/checkupdates.sh.in @@ -32,7 +32,7 @@ fi trap 'rm -f $CHECKUPDATE_DB/db.lck' INT TERM EXIT DBPath="${DBPath:-@localstatedir@/lib/pacman/}" -eval $(awk -F' *= *' '$1 ~ /DBPath/ { print $1 "=" $2 }' /etc/pacman.conf) +eval $(awk -F' *= *' '$1 ~ /DBPath/ { print $1 "=" $2 }' @sysconfdir@/pacman.conf) mkdir -p "$CHECKUPDATE_DB" ln -s "${DBPath}/local" "$CHECKUPDATE_DB" &> /dev/null -- cgit v1.2.3-24-g4f1b