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

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)

Reply via email to