From 420f19fac9486de4fa497e305231467afe55d75e Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Wed, 30 Aug 2006 18:33:53 +0000 Subject: [PATCH] do not abort when running unprivileged if mydest is a prefix of PREFIX, the user could not have write access to it; reported by grobian. svn path=/main/branches/prefix/; revision=4377 --- pym/portage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pym/portage.py b/pym/portage.py index c1d38b360..612e5c7bd 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -6179,8 +6179,8 @@ class dblink: dflags=bsd_chflags.lgetflags(mydest) if(bsd_chflags.lchflags(mydest, 0)<0): writemsg("!!! Couldn't clear flags on '"+mydest+"'.\n") - - if not os.access(mydest, os.W_OK): + # do not abort when running unprivileged if mydest is a prefix of PREFIX, the user could not have write access to it. + if not os.access(mydest, os.W_OK) and not prefix.startswith(mydest): pkgstuff = pkgsplit(self.pkg) writemsg("\n!!! Cannot write to '"+mydest+"'.\n") writemsg("!!! Please check permissions and directories for broken symlinks.\n") -- 2.26.2