From: Jason Stubbs <jstubbs@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Subject: [gentoo-portage-dev] PATCH: Only use lchown on symlinks (#98827)
Date: Tue, 19 Jul 2005 23:27:51 +0900 [thread overview]
Message-ID: <200507192327.54222.jstubbs@gentoo.org> (raw)
In-Reply-To: <200507181213.41595.jstubbs@gentoo.org>
[-- Attachment #1.1: Type: text/plain, Size: 432 bytes --]
On Monday 18 July 2005 12:13, Jason Stubbs wrote:
> http://bugs.gentoo.org/show_bug.cgi?id=98827
>
> Making lchown a no-op should fix all these cases without any regressions.
Marius pointed out that lchown is currently used on regular files as well as
symlinks. This patch separates the usage of os.chown and lchown such that
os.chown is only used on non-symlinks and lchown is only used on symlinks.
--
Jason Stubbs
[-- Attachment #1.2: 98827_lchown_normal_files.patch --]
[-- Type: text/x-diff, Size: 1173 bytes --]
--- /usr/lib/portage/pym/portage.py 2005-07-15 23:53:30.843708096 +0900
+++ portage.py 2005-07-19 00:57:43.169904000 +0900
@@ -2866,7 +2866,10 @@
return None # failure
try:
if didcopy:
- lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
+ if stat.S_ISLNK(sstat[stat.ST_MODE]):
+ lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
+ else
+ os.chown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown
os.unlink(src)
except SystemExit, e:
@@ -6739,7 +6742,7 @@
if bsd_chflags:
bsd_chflags.lchflags(mydest, dflags)
os.chmod(mydest,mystat[0])
- lchown(mydest,mystat[4],mystat[5])
+ os.chown(mydest,mystat[4],mystat[5])
print ">>>",mydest+"/"
else:
#destination doesn't exist
@@ -6751,7 +6754,7 @@
os.chmod(mydest,mystat[0])
if bsd_chflags:
bsd_chflags.lchflags(mydest, bsd_chflags.lgetflags(mysrc))
- lchown(mydest,mystat[4],mystat[5])
+ os.chown(mydest,mystat[4],mystat[5])
print ">>>",mydest+"/"
outfile.write("dir "+myrealdest+"\n")
# recurse and merge this directory
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2005-07-19 14:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-18 3:13 [gentoo-portage-dev] PATCH: Make lchown a no-op rather than aliasing to chown on Darwin (#98827) Jason Stubbs
2005-07-19 14:27 ` Jason Stubbs [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200507192327.54222.jstubbs@gentoo.org \
--to=jstubbs@gentoo.org \
--cc=gentoo-portage-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox