[pacman-dev] [PATCH] paccache: needsroot faulty set to 1

Maxim Andersson thesilentboatman at gmail.com
Tue Aug 26 07:57:44 EDT 2014


"Privilege escalation required" will be printed even when root isn't
required.

If paccache runs without the -m parameter and $PWD is read only,
$needsroot will be set to 1 even if the cache dir has read/write.

Signed-off-by: Maxim Andersson <thesilentboatman at gmail.com>
---
 contrib/paccache.sh.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/paccache.sh.in b/contrib/paccache.sh.in
index 039ac8a..a88ae1f 100644
--- a/contrib/paccache.sh.in
+++ b/contrib/paccache.sh.in
@@ -273,7 +273,7 @@ esac
 
 if (( move || delete )); then
 	# make it an absolute path since we're about to chdir
-	[[ ${movedir:0:1} != '/' ]] && movedir=$PWD/$movedir
+	[[ $movedir && ${movedir:0:1} != '/' ]] && movedir=$PWD/$movedir
 	[[ ! -w $cachedir || ( $movedir && ! -w $movedir ) ]] && needsroot=1
 fi
 
-- 
2.0.3


More information about the pacman-dev mailing list