Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 98827
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Portage team <dev-portage@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Kito (RETIRED) <kito@gentoo.org>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
98827_lchown_normal_files.patch Replaces lchown with os.chown when target is not a symlink patch Jason Stubbs (RETIRED) 2005-07-18 09:01 0000 1.15 KB Details | Diff
98827_darwin_noop_lchown.patch Turns lchown into a no-op on Darwin patch Jason Stubbs (RETIRED) 2005-07-18 09:05 0000 535 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 98827 depends on: Show dependency tree
Bug 98827 blocks: 81010 90765 106886 108082
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-07-12 15:16 0000
Darwin/OS X has no permissions for symlinks, therefore when portage attempts to
lchown a symlink 
with a non-existant target (or simply the target hasn't been moved from ${D}
yet) it raises Exception 
and stops the merge.

  lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])


Is the statement that fails.

No, I'm not attaching a patch yet, want to investigate a little more first, but
wanted to start the bug in 
case a portage guru has a good, clean, quick fix =)


Reproducible: Always
Steps to Reproduce:
1.
2.
3.




Portage 2.0.51.22-r1 (default-darwin/macos/progressive, gcc-3.3,
libsystem-7.1-r0, 8.2.0 Power 
Macintosh)
===============================================================
==
System uname: 8.2.0 Power Macintosh powerpc
Unknown Host Operating System
dev-lang/python:     2.4.1
sys-apps/sandbox:    [Not Present]
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  [Not Present]
sys-devel/libtool:   [Not Present]
virtual/os-headers:  7.1
ACCEPT_KEYWORDS="ppc-macos ~ppc-macos"
AUTOCLEAN="yes"
CBUILD="powerpc-apple-darwin8"
CFLAGS="-mcpu=G4 -O3 -pipe"
CHOST="powerpc-apple-darwin8"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/
qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildpkg distlocks fakeroot sfperms strict userpriv"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://adelie.polymtl.ca/
http://distro.ibiblio.org/pub/
linux/distributions/gentoo/ http://cudlug.cudenver.edu/gentoo/"
LC_ALL=""
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="ppc bitmap-fonts dvd emboss gif jpeg ldap libwww nls pam png ppc-macos
python readline 
truetype truetype-fonts type1-fonts unicode userland_Darwin kernel_Darwin
elibc_Darwin"
Unset:  ASFLAGS, CTARGET, LANG, LDFLAGS, LINGUAS

------- Comment #1 From Jason Stubbs (RETIRED) 2005-07-17 19:24:17 0000 -------
Portage currently aliases lchown to chown on Darwin. It would make more sense 
for lchown be aliased to a noop. Does that work for you? 

------- Comment #2 From Marius Mauch (RETIRED) 2005-07-18 06:51:58 0000 -------
I'd be careful about aliasing to a noop. lchown isn't only used on symlinks.

------- Comment #3 From Kito (RETIRED) 2005-07-18 08:43:10 0000 -------
Yeah, I think Marius is correct. Ideally it would only noop if the symlink
target didn't exist, that way the 
symlinlk will just inherit perms from its parent.

------- Comment #4 From Jason Stubbs (RETIRED) 2005-07-18 09:01:23 0000 -------
Created an attachment (id=63710) [details]
Replaces lchown with os.chown when target is not a symlink

There's two case where lchown is used and the target is never a symlink;
changed both of those to use os.chown. Then there's one case where it can be
any type of file; converted that one to an if block based on stat information
that has already been read.

------- Comment #5 From Jason Stubbs (RETIRED) 2005-07-18 09:05:06 0000 -------
Created an attachment (id=63711) [details]
Turns lchown into a no-op on Darwin

The problem with lchown being aliased to chown is that file merging becomes
order dependent (and portage currently relies on it being not so). That is, the
target will get the wrong permissions if the symlink has different ownership
for some reason.

------- Comment #6 From Kito (RETIRED) 2005-07-18 12:42:17 0000 -------
This looks good to me. thanks jstubbs.

------- Comment #7 From Kito (RETIRED) 2005-07-24 09:58:04 0000 -------
ok, I spoke to soon. This still doesn't solve the problem of merging a symlink
with a non-existant 
target. On line ~2800 of portage.py in movefile() there is another lchown I
didn't see changed in your 
patch. If you change:

  lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])

to:

  os.chown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])

this will still raise:

  except Exception, e:
                        print "!!! failed to properly create symlink:"

------- Comment #8 From Jason Stubbs (RETIRED) 2005-10-23 04:14:50 0000 -------
Fixed in 2.0.53 

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug