Your message dated Mon, 14 Apr 2008 11:32:47 -0400
with message-id <[EMAIL PROTECTED]>
and subject line Re: Bug#476111: ln -sf fails to overwrite symlinks to
directories
has caused the Debian Bug report #476111,
regarding ln -sf fails to overwrite symlinks to directories
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [EMAIL PROTECTED]
immediately.)
--
476111: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=476111
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Package: coreutils
Version: 6.10-6
Severity: normal
File: /bin/ln
lapse:/tmp/cdt.wMW17026> ls -l #[315]
lrwxrwxrwx 1 madduck root 3 2008-04-14 16:48 bar -> foo/
drwx--S--- 2 madduck root 4096 2008-04-14 16:48 baz/
drwx--S--- 2 madduck root 4096 2008-04-14 16:48 foo/
Given this situation, I note that I have to
lapse:/tmp/cdt.wMW17026> ls -l bar #[319]
lrwxrwxrwx 1 madduck root 3 2008-04-14 16:48 bar -> foo/
lapse:/tmp/cdt.wMW17026> ls -l bar/ #[320]
total 0
append the trailing slash to get /bin/ls to dereference the symlink.
Yet,
lapse:/tmp/cdt.wMW17026> ln -sf baz bar #[316]
lapse:/tmp/cdt.wMW17026> ls -la #[317]
total 32
drwx--S--- 4 madduck root 4096 2008-04-14 16:48 ./
drwxrwsrwt 78 root root 20480 2008-04-14 16:47 ../
lrwxrwxrwx 1 madduck root 3 2008-04-14 16:48 bar -> foo/
drwx--S--- 2 madduck root 4096 2008-04-14 16:48 baz/
drwx--S--- 2 madduck root 4096 2008-04-14 16:48 foo/
lapse:/tmp/cdt.wMW17026> ls -l #[318]
total 8
lrwxrwxrwx 1 madduck root 3 2008-04-14 16:48 bar -> foo/
drwx--S--- 2 madduck root 4096 2008-04-14 16:48 baz/
drwx--S--- 2 madduck root 4096 2008-04-14 16:48 foo/
ln behaves differently, and IMHO wrongly. ln -sf baz bar should be
overwriting the symlink bar with a new one pointing to baz. ln -sf
baz bar/ would first dereference bar and thus drop the symlink in
the directory foo.
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1,
'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.24-1+scoflowctrl.1-686 (SMP w/1 CPU core)
Locale: LANG=en_GB, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages coreutils depends on:
ii libacl1 2.2.45-1 Access control list shared library
ii libc6 2.7-10 GNU C Library: Shared libraries
ii libselinux1 2.0.59-1 SELinux shared libraries
coreutils recommends no packages.
-- no debconf information
--
.''`. martin f. krafft <[EMAIL PROTECTED]>
: :' : proud Debian developer, author, administrator, and user
`. `'` http://people.debian.org/~madduck - http://debiansystem.info
`- Debian - when you have better things to do than fixing systems
digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)
--- End Message ---
--- Begin Message ---
On Mon, Apr 14, 2008 at 04:52:54PM +0200, martin f krafft wrote:
Package: coreutils
Version: 6.10-6
Severity: normal
File: /bin/ln
lapse:/tmp/cdt.wMW17026> ls -l #[315]
lrwxrwxrwx 1 madduck root 3 2008-04-14 16:48 bar -> foo/
drwx--S--- 2 madduck root 4096 2008-04-14 16:48 baz/
drwx--S--- 2 madduck root 4096 2008-04-14 16:48 foo/
Given this situation, I note that I have to
lapse:/tmp/cdt.wMW17026> ls -l bar #[319]
lrwxrwxrwx 1 madduck root 3 2008-04-14 16:48 bar -> foo/
lapse:/tmp/cdt.wMW17026> ls -l bar/ #[320]
total 0
append the trailing slash to get /bin/ls to dereference the symlink.
This is expected. Use ls -Hl to dereference links on the command line.
lapse:/tmp/cdt.wMW17026> ln -sf baz bar #[316]
lapse:/tmp/cdt.wMW17026> ls -la #[317]
total 32
drwx--S--- 4 madduck root 4096 2008-04-14 16:48 ./
drwxrwsrwt 78 root root 20480 2008-04-14 16:47 ../
lrwxrwxrwx 1 madduck root 3 2008-04-14 16:48 bar -> foo/
drwx--S--- 2 madduck root 4096 2008-04-14 16:48 baz/
drwx--S--- 2 madduck root 4096 2008-04-14 16:48 foo/
lapse:/tmp/cdt.wMW17026> ls -l #[318]
total 8
lrwxrwxrwx 1 madduck root 3 2008-04-14 16:48 bar -> foo/
drwx--S--- 2 madduck root 4096 2008-04-14 16:48 baz/
drwx--S--- 2 madduck root 4096 2008-04-14 16:48 foo/
That's also expected. Use ln -Tsf to do this.
In each case, the behavior is mandated by POSIX, and has been
implemented for decades; it is extremely unlikely to change.
ln behaves differently, and IMHO wrongly. ln -sf baz bar should be
overwriting the symlink bar with a new one pointing to baz. ln -sf
baz bar/ would first dereference bar and thus drop the symlink in
the directory foo.
POSIX mandates that symlinks be treated as the object they reference (in
your case, as a directory) by default, unless some specific option is
specified to treat the symlink specially, or if the command is intended
to interact with symlinks.
Mike Stone
--- End Message ---