[pacman-dev] [PATCH] paccache: avoid subshell in calling runcmd

Dave Reisner dreisner at archlinux.org
Thu Apr 11 09:18:47 EDT 2013


Avoids problems with one of the worst CLI tools ever created, su.

Fixes FS#34656.

Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
 contrib/paccache.sh.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/paccache.sh.in b/contrib/paccache.sh.in
index c331273..64c3c53 100644
--- a/contrib/paccache.sh.in
+++ b/contrib/paccache.sh.in
@@ -308,9 +308,9 @@ totalsaved=$(@SIZECMD@ "${candidates[@]}" | awk '{ sum += $1 } END { print sum }
 # crush. kill. destroy.
 (( verbose )) && cmdopts+=(-v)
 if (( delete )); then
-	printf '%s\0' "${candidates[@]}" | runcmd xargs -0 rm "${cmdopts[@]}"
+	runcmd xargs -0a <(printf '%s\0' "${candidates[@]}") rm "${cmdopts[@]}"
 elif (( move )); then
-	printf '%s\0' "${candidates[@]}" | runcmd xargs -0 mv "${cmdopts[@]}" -t "$movedir"
+	runcmd xargs -0a <(printf '%s\0' "${candidates[@]}") mv "${cmdopts[@]}" -t "$movedir"
 fi
 
 summarize "$pkgcount" "${candidates[@]}"
-- 
1.8.2.1



More information about the pacman-dev mailing list