Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 147705 - sys-apps/coreutils - chown --no-dereference does not work with glibc-2.4
Summary: sys-apps/coreutils - chown --no-dereference does not work with glibc-2.4
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 153872 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-09-15 10:25 UTC by Juergen Rose
Modified: 2009-10-09 19:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
result of 'strace -f -o chown.out chown -h rose:users b' (chown.out,6.77 KB, text/plain)
2006-09-17 02:15 UTC, Juergen Rose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Rose 2006-09-15 10:25:40 UTC
Chown (from coreutils-6.1) --no-dereference does not change the owner of a link, but the target of the link, also chown -R does dnot change the owner of a link.
Chown of coreutils-5.97 works as expected.
Comment 1 SpanKY gentoo-dev 2006-09-15 22:37:29 UTC
works for me:
# rm -f a b
# touch a
# ln -s a b
# ls -l a b
-rw-r--r-- 1 root root 0 2006-09-16 01:36 a
lrwxrwxrwx 1 root root 1 2006-09-16 01:36 b -> a
# chown -h vapier:users b
# ls -l a b
-rw-r--r-- 1 root   root  0 2006-09-16 01:36 a
lrwxrwxrwx 1 vapier users 1 2006-09-16 01:36 b -> a
# chown --version
chown (GNU coreutils) 6.1
Comment 2 Juergen Rose 2006-09-16 01:36:46 UTC
But not for me, at least not generally, 1st computer cheetah (reiserfs, 32-Bit, coreutils-6.1):

root@cheetah:/home/rose(50)# chown --version
chown (GNU coreutils) 6.1
oot@cheetah:/home/rose(51)# rm -f a b
root@cheetah:/home/rose(52)# touch a
root@cheetah:/home/rose(53)# ln -s a b
root@cheetah:/home/rose(54)# ls -l a b
-rw-r--r-- 1 root root 0 Sep 16 09:47 a
lrwxrwxrwx 1 root root 1 Sep 16 09:47 b -> a
root@cheetah:/home/rose(55)# chown -h rose:users b
root@cheetah:/home/rose(56)# ls -l a b
-rw-r--r-- 1 rose users 0 Sep 16 09:47 a
lrwxrwxrwx 1 root root  1 Sep 16 09:47 b -> a

chown does not work as expected. Second computer grizzly (ext3, 64-Bit, coreutils-6.1)):

root@grizzly:/home/rose(2)# rm -f a b
root@grizzly:/home/rose(3)# touch a
root@grizzly:/home/rose(4)# ln -s a b
root@grizzly:/home/rose(5)# ls -l a b
-rw-r--r-- 1 root root 0 Sep 16 09:52 a
lrwxrwxrwx 1 root root 1 Sep 16 09:53 b -> a
root@grizzly:/home/rose(7)# chown -h rose:users b
root@grizzly:/home/rose(8)# ls -l a b
-rw-r--r-- 1 root root  0 Sep 16 09:52 a
lrwxrwxrwx 1 rose users 1 Sep 16 09:53 b -> a
root@grizzly:/home/rose(9)# chown --version
chown (GNU coreutils) 6.1

chown works as expected. Third computer thinkpad (ext3, 32-Bit, coreutils-5.97):

root@thinkpad:/home/rose(8)# chown --version
chown (GNU coreutils) 5.97

root@thinkpad:/home/rose(8)# chown --version
chown (GNU coreutils) 5.97
root@thinkpad:/home/rose(9)# rm -f a b
root@thinkpad:/home/rose(10)# touch a
root@thinkpad:/home/rose(11)# ln -s a b
root@thinkpad:/home/rose(12)# ls -l a b
-rw-r--r-- 1 root root 0 Sep 16 10:02 a
lrwxrwxrwx 1 root root 1 Sep 16 10:02 b -> a
root@thinkpad:/home/rose(14)# chown -h rose:users b
root@thinkpad:/home/rose(15)# ls -l a b
-rw-r--r-- 1 root root  0 Sep 16 10:02 a
lrwxrwxrwx 1 rose users 1 Sep 16 10:02 b -> a

works as expected. Now I install coreutils-6.1.

root@thinkpad:/home/rose(18)# chown --version
chown (GNU coreutils) 6.1
root@thinkpad:/home/rose(19)# rm -f a b
root@thinkpad:/home/rose(20)# touch a
root@thinkpad:/home/rose(21)# ln -s a b
root@thinkpad:/home/rose(22)# ls -l a b
-rw-r--r-- 1 root root 0 Sep 16 10:20 a
lrwxrwxrwx 1 root root 1 Sep 16 10:20 b -> a
root@thinkpad:/home/rose(23)# chown -h rose:users b
root@thinkpad:/home/rose(24)# ls -l a b
-rw-r--r-- 1 rose users 0 Sep 16 10:20 a
lrwxrwxrwx 1 root root  1 Sep 16 10:20 b -> a

The owner of target was cheanged. Fourth computer (shark, 32-Bit, ext3):

root@shark:/home/rose(3)# chown --version
chown (GNU coreutils) 6.1

root@shark:/home/rose(4)# rm -f a b
root@shark:/home/rose(5)# touch a
root@shark:/home/rose(6)# ln -s a b
root@shark:/home/rose(7)# ls -l a b
-rw-r--r-- 1 root root 0 Sep 16 12:41 a
lrwxrwxrwx 1 root root 1 Sep 16 12:41 b -> a
root@shark:/home/rose(8)# chown -h rose:users b
root@shark:/home/rose(9)# ls -l a b
-rw-r--r-- 1 rose users 0 Sep 16 12:41 a
lrwxrwxrwx 1 root root  1 Sep 16 12:41 b -> a

Again the owner of target was cheanged and not the owner of link. Fiveth computer (tarantel, 32-Bit, ext3):

root@tarantel:/home/rose(5)# ln -s a b
root@tarantel:/home/rose(6)# ls -l a b
-rw-r--r-- 1 root root 0 Sep 16 10:32 a
lrwxrwxrwx 1 root root 1 Sep 16 10:32 b -> a
root@tarantel:/home/rose(7)# chown -h rose:users b
root@tarantel:/home/rose(8)# ls -l a b
-rw-r--r-- 1 rose users 0 Sep 16 10:32 a
lrwxrwxrwx 1 root root  1 Sep 16 10:32 b -> a
root@tarantel:/home/rose(9)# chown --version
chown (GNU coreutils) 6.1

Again the owner of target was cheanged and not the owner of link. I.e., for all of my 32-Bit PCs chown -h does not work, as expected for the 64-Bit PC chown works, as expected. Sorry that I do not have more 64-Bit PCs for further checks. 

    Juergen
Comment 3 SpanKY gentoo-dev 2006-09-16 14:39:01 UTC
works on my 32bit machines

run `strace -f -o out chown -h rose:users b` on a machine that fails and post the 'out' file as an attachment
Comment 4 Juergen Rose 2006-09-17 02:15:56 UTC
Created attachment 97210 [details]
result of 'strace -f -o chown.out chown -h rose:users b'

I did 'strace -f -o chown.out chown -h rose:users b', chown.out is in the attachment. Perhaps 'emerge --info' is interesting:

root@shark:/home/rose(16)# emerge --info
Portage 2.1.2_pre1 (default-linux/x86/2006.1, gcc-4.1.1/hardened, glibc-2.4-r3, 2.6.18-rc7 i686)
=================================================================
System uname: 2.6.18-rc7 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
Gentoo Base System version 1.12.5
Last Sync: Sat, 16 Sep 2006 04:30:06 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [disabled]
app-admin/eselect-compiler: 2.0.0_rc2-r1
dev-java/java-config: 1.3.6-r1, 2.0.28-r1
dev-lang/python:     2.4.3-r3
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r6
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/grass60/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb
 /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/gconf /etc/java-config/vms/ /etc/revdep-rebui
ld /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks fixpackages metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror http://ftp-stud.fht-esslingen.de/pub/Mirrors/ge
ntoo/ rsync://ftp.fi.muni.cz/pub/linux/gentoo ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo rsync://gd.tuwien.ac.at/opsy
s/linux/gentoo ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://ftp.tu-clausthal.de/pub/linux/gentoo http:/
/gentoo.oregonstate.edu"
LINGUAS="de fr"
PKGDIR="/usr/portage/packages/All"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-af
ter --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 Xaw3d a52 aac acpi ao aotuv apache2 asf atlas auctex audiofile automount berkdb bitmap-fonts blas bonobo bzip2 c
airo cdda cddb cdf cdio cdparanoia cdr cgi cli corba crypt cups curl daap dbus devmap dga dlloader dri dvb dvd dvi dxr3 d
ynagraph effects elf elibc_glibc emacs epiphany esd evo evolution exif expat fam fame ffmpeg fftw fits flac fltk fortran 
fpx gdal gdbm geos gimp ginac glade glitz gml gmp gnuplot gphoto2 gpm graphviz grass gs gsl gsm guile hal hardened hddtem
p hdf hdf5 hlapi icq id3 imagemagick innodb input_devices_keyboard input_devices_mouse ipv6 isdnlog jabber jbig john jp2 
jpeg2k kernel_linux kexi lame lapack latex lcms ldap libg++ libgda libsamplerate linguas_de linguas_fr lirc lm_sensors lu
a lzo lzw math matroska mmx mmxext mng mod mono mozcalendar mozdevelop mozilla mozsvg mozxmlterm mp4live mpeg2 mplayer mu
sicbrainz mysql mysqli nautilus ncurses netcdf network nfs nls nntp nptl nptlonly numarray numeric nvidia ocaml octave od
bc ogdi pam pcre pdf perl plotutils plugin posix postgres ppds pppd proj python qhull readline real reflection reiserfs r
hythmbox rle rrdcgi rrdtool samba session slang slp smp sndfile snmp sox spl sqlite sse sse2 ssl subtitles svg t1lib tclt
k tcpd tetex theora tidy tiff truetype-fonts type1-fonts udev unicode userland_GNU v4l2 video_cards_fbdev video_cards_nv 
video_cards_vesa win32codecs wmf xemacs xext xine xml2 xmlreader xmlrpc xorg xpm xvid xvmc zlib zvbi"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS

   Juergen
Comment 5 SpanKY gentoo-dev 2006-09-17 02:35:45 UTC
this is your problem:
25752 chown32("b", 1203, 100)           = 0

that should be an lstat() followed by an lchown()
Comment 6 Juergen Rose 2006-09-17 03:42:52 UTC
And what should I do? Emerge once more glibc?

    Juergen


Comment 7 SpanKY gentoo-dev 2006-09-17 23:14:28 UTC
looks like a bug in glibc ... i'm looking into it as i found an x86 that i can reproduce this problem on
Comment 8 Juergen Rose 2006-10-02 00:19:41 UTC
I updated through coreutils-6.2 to coreutils-6.3 and glibc to glibc-2.4-r4. But I still have the error with "chown -h rose:users some_symbolic_link", the owner of the target and not the owner of the link is changed.

Juergen

root@thinkpad:/root(13)# emerge --info
Portage 2.1.2_pre2-r1 (default-linux/x86/2006.1, gcc-4.1.1, glibc-2.4-r4, 2.6.18 i686)
=================================================================
System uname: 2.6.18 i686 Intel(R) Pentium(R) M processor 1700MHz
Gentoo Base System version 1.12.5
Last Sync: Mon, 02 Oct 2006 06:00:07 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [disabled]
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r6
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium-m -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/grass60/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X1
1/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo 
/etc/texmf/web2c"
CXXFLAGS="-O2 -march=pentium-m -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks fixpackages metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror http://ftp-stud.fht-esslingen.de/pub/Mirro
rs/gentoo/ ftp://ftp.caliu.info/pub/gentoo/ http://ftp.caliu.info/pub/gentoo/ ftp://vlaai.snt.ipv6.utwente.nl/pub/os
/linux/gentoo/ http://www.gigaload.org/gentoo.org/"
LINGUAS="de fr"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --dele
te-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 Xaw3d a52 aac acpi amrr ao aotuv apache2 asf atlas auctex audiofile automount berkdb bitmap-fonts blas bono
bo bzip2 cairo cardbus cdda cddb cdf cdio cdparanoia cdr cgi cli corba crypt cups curl daap dbus devmap dga dlloader
 dri dvb dvd dvi dxr3 dynagraph effects elf elibc_glibc emacs epiphany esd evo evolution exif expat fam fame ffmpeg 
fftw fits flac fltk fortran fpx gdal gdbm geos gimp ginac glade glitz gml gmp gnuplot gphoto2 gpm graphviz grass gs 
gsl gsm guile hal hardened hddtemp hdf hdf5 hlapi icq id3 imagemagick innodb input_devices_keyboard input_devices_mo
use input_devices_synaptics ipv6 isdnlog jabber jbig john jp2 jpeg jpeg2k kernel_linux kexi lame lapack latex lcms l
dap libg++ libgda libsamplerate linguas_de linguas_fr lirc lua lzo lzw madwifi math matroska mmx mmxext mng mod mono
 mozcalendar mozdevelop mozilla mozsvg mozxmlterm mp4live mpeg2 mplayer musicbrainz mysql mysqli nautilus ncurses ne
tcdf network nfs nls nntp nptl nptlonly ntfs numarray numeric ocaml octave odbc ogdi pam pcre pdf perl plotutils plu
gin png posix postgres ppds pppd proj python qhull readline real reflection reiserfs rhythmbox rle rrdcgi rrdtool sa
mba session slang slp sndfile snmp sox spl sqlite sse sse2 ssl subtitles svg t1lib tcltk tcpd tetex theora tidy tiff
 truetype-fonts type1-fonts udev unicode userland_GNU v4l2 video_cards_fbdev video_cards_radeon video_cards_vesa wif
i win32codecs wmf xemacs xext xine xml2 xmlreader xmlrpc xorg xpm xvid xvmc zlib zvbi"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 9 SpanKY gentoo-dev 2006-11-10 23:36:42 UTC
*** Bug 153872 has been marked as a duplicate of this bug. ***
Comment 10 SpanKY gentoo-dev 2006-11-10 23:37:12 UTC
on the system where i had this problem, i upgraded to glibc-2.5 and now it's working ... can one of you guys confirm this ?
Comment 11 Jakub Moc (RETIRED) gentoo-dev 2006-11-11 00:58:12 UTC
(In reply to comment #10)
> on the system where i had this problem, i upgraded to glibc-2.5 and now it's
> working ... can one of you guys confirm this ?

Looks like that:

# touch a; ln -s a b; ls -l a b
-rw-r--r-- 1 root root 0 2006-11-11 09:56 a
lrwxrwxrwx 1 root root 1 2006-11-11 09:56 b -> a

# chown -h kuba:users b; ls -l a b
-rw-r--r-- 1 root root  0 2006-11-11 09:56 a
lrwxrwxrwx 1 kuba users 1 2006-11-11 09:56 b -> a
Comment 12 Juergen Rose 2006-11-11 09:45:33 UTC
Seems to be solved:

root@thinkpad:/home/rose(51)# rm -f a b
root@thinkpad:/home/rose(52)# touch a
root@thinkpad:/home/rose(53)# ln -s a b
root@thinkpad:/home/rose(54)# ls -l a b
-rw-r--r-- 1 root root 0 Nov 11 18:35 a
lrwxrwxrwx 1 root root 1 Nov 11 18:35 b -> a
root@thinkpad:/home/rose(55)# chown -h rose:users b
root@thinkpad:/home/rose(57)# ls -l a b
-rw-r--r-- 1 root root  0 Nov 11 18:35 a
lrwxrwxrwx 1 rose users 1 Nov 11 18:35 b -> a

root@thinkpad:/home/rose(60)# emerge -pvD coreutils glibc

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] sys-apps/coreutils-6.4  USE="nls -acl (-selinux) -static" 0 kB 
[ebuild   R   ] sys-libs/glibc-2.5  USE="hardened nls nptl nptlonly -build -glibc-compat20 -glibc-omitfp (-multilib) -profile (-selinux)" 169 kB 

Juergen
Comment 13 SpanKY gentoo-dev 2006-11-11 15:17:12 UTC
thanks for testing guys