Skip to contentSkip to conversation

Trailing slash with symlinks and rmdir/rename

DISCUSSION Ross Lagerwall 1 participant 1 message Sep 9, 2013 VFS

lore
Share & tools
lore
#0 lore raw

Hi,

I have noticed that if X is a symlink to a directory Y, doing "rmdir X/" or "mv X/ Z" does not behave how I expect.

My reading of POSIX 2008 (and the behaviour of FreeBSD and OpenIndiana) is that a symbolic link to a directory followed by a trailing slash should behave as though it names the directory pointed to by the symbolic link.

So while Linux gives ENOTDIR for "rmdir X/", the others remove Y.

Is this a bug? If it is, I can have a go at writing a patch.

Regards

Signature · 1 line
Ross Lagerwall