On 17/11/15 20:37, Bob Proulx wrote:
> Adam Brenner wrote:
>> I have an enhancement requests and patch ready for unlink to support
>> multiple arguments. Currently unlink does not accept more than one
>> argument to remove a link. I have a patch that adds that
>> functionality. For example:
>>
>>     $ unlink link1 link2 link3
> 
> Why are you using unlink here instead of rm?  I think you are using
> the wrong tool for the job.  Why even care if unlink can take multiple
> arguments?
> 
> It used to be that unlink existed for tasks such as allowing the
> superuser to unlink the ".." entry from a directory.  Which was one
> additional layer in a chroot to prevent crawling out of it.  Which was
> why the older documentation mentions needing sufficient privileges.
> This unlinking of ".." isn't allowed anymore on recent file systems
> and other container practices have appeared making this practice
> obsolete.

Good info thanks. Yes rm will not unlink() a dir.

>> Is this something the community would like for me to submit?
> 
> I do not have a strong opinion.  Traditional Unix systems only allowed
> one argument and no options.  *BSD now allows multiple arguments and
> includes various options.  It would be nice to be compatible with *BSD.

I'm not sure they do?
Note the rm and unlink man pages are merged in FreeBSD at least,
which might confuse things.

thanks,
Pádraig

Reply via email to