tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

link(2) on a symlink to a directory fails

Hello everyone

I was trying to track down a bug in glusterfs on NetBSD and encountered a
behavior difference between NetBSD and Linux. NetBSD will refuse (EPERM)
to link(2) on a symlink to a directory, while Linux is fine with such
an operation (but fails to link(2) directly to a directory, just like

A simple case showing the difference is below. Anyone has an opinion 
about this? Who is standard compliant, and does it make sense to "fix"
our link(2) to match Linux? 

$ cd /tmp 
$ mkdir i386
$ ln -s i386
$ ln machine
ln: machine: Operation not permitted
$ uname

$  mkdir i386
$ ln -s i386
$ ln machine
$ ls -ld machine
lrwxrwxrwx  2 manu manu 4 jui 29 10:03 machine -> i386
$ uname

Emmanuel Dreyfus

Home | Main Index | Thread Index | Old Index