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
NetBSD). 

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 inst.xxx
$ ln inst.xxx machine
ln: machine: Operation not permitted
$ uname
NetBSD

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

-- 
Emmanuel Dreyfus
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index