I don't know the precise history, but I think its a mistake to permit direct 
link() or unlink() of directories.  I do note that on BSD (MacOS at least) 
unlink returns EPERM if the executing user is not superuser.  I do see that the 
man page for unlink() says this on illumos:

                     The  named   file   is   a   directory   and
                     {PRIV_SYS_LINKDIR}  is  not  asserted in the
                     effective set of the calling process, or the
                     filesystem  implementation  does not support
                     unlink() or unlinkat() on directories.

I can't imagine why you'd *ever* want to support unlink() of a *directory* -- 
what's the use case for it anyway (outside of filesystem repair)?

Garrett D'Amore

On Jun 25, 2012, at 2:23 AM, Lionel Cons wrote:

> Does someone know the history which led to the EPERM for unlink() of
> directories on ZFS? Why was this done this way, and not something like
> allowing the unlink and execute it on the next scrub or remount?
> Lionel
> -------------------------------------------
> illumos-developer
> Archives: https://www.listbox.com/member/archive/182179/=now
> RSS Feed: https://www.listbox.com/member/archive/rss/182179/21239177-c925e33f
> Modify Your Subscription: 
> https://www.listbox.com/member/?member_id=21239177&id_secret=21239177-4dba8197
> Powered by Listbox: http://www.listbox.com

zfs-discuss mailing list

Reply via email to