Eric Blake wrote: > Bernhard Voelker wrote: > > Eric Blake wrote: > >> Just noticing this context... > >>> # This test is too dangerous -- if there's a bug you're wiped out! > >>> # rm -fr / 2>/dev/null && fail=1 > >> > >> What if we use chroot to create a safer /, where failing the test would > >> only wipe out the chroot? > > > > That's not that easy. I think that it would be too complicated to be desired in the test suite. > > Alternatively, that test could be secured by "skip_if_root_" > > plus intercepting the unlinkat() call via LD_PRELOAD. > > Indeed, LD_PRELOAD is great for this - since the test passes when no > unlink/rmdir occurs, you just make the intercepts fail loudly if they > are invoked. Please make sure that if the LD_PRELOAD functionality fails that this test is not run. Since it would be a live fire exercise and if LD_PRELOAD doesn't function then the test would wipe the system out. I don't think it is worth the risk for this piece of functionality. Bob