Trailing slash with symlinks and rmdir/rename

From: Ross Lagerwall
Date: Mon Sep 09 2013 - 17:09:03 EST


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
--
Ross Lagerwall
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/