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.
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
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
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
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
this is your problem: 25752 chown32("b", 1203, 100) = 0 that should be an lstat() followed by an lchown()
And what should I do? Emerge once more glibc? Juergen
looks like a bug in glibc ... i'm looking into it as i found an x86 that i can reproduce this problem on
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
*** Bug 153872 has been marked as a duplicate of this bug. ***
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 ?
(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
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
thanks for testing guys