Subject: bug#15926: RFE: unlink command already uses 'unlink' call; make 'rm' use 'remove' call

From: Eric Blake <[email-masked]>
Date: Mon, 02 Dec 2013 08:48:19 -0700

On 11/30/2013 02:33 PM, Bob Proulx wrote:
> But for example what happens if the preferred unlink command ever
> changes from unlinkat() to something new about ten years in the
> future?  Can't say it won't change since we have already seen it
> change.

Indeed, we've already moved from unlink()/rmdir() to unlinkat() as our
preferred syscall(s).

But that's part of the sanity checks of the test - if the LD_PRELOAD
test runs, and the file is deleted, then the code base has switched away
from using unlinkat() as its deletion mechanism, and the test will be
skipped until someone updates it to override the new preferred syscall
instead.  The only way we attempt 'rm -r /' is if we FIRST prove that we
have safely prevented 'rm -r file dir' from deleting sub-trees in the
(safe) current working directory, so that we know that we are also
preventing any attempt to actually remove / and only end up testing the
other effects (such as the appropriate POSIX behavior of refusing to
remove / by default).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org