bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #46305] Doing "find -L . -type d -delete" fails on symlinks to dire


From: Tavian Barnes
Subject: [bug #46305] Doing "find -L . -type d -delete" fails on symlinks to directories.
Date: Wed, 11 Jul 2018 23:45:53 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

Follow-up Comment #2, bug #46305 (project findutils):

I think this is an actual bug, despite the general danger of running -delete
together with -L.  In this setup:

$ mkdir foo
$ mkdir bar
$ ln -s ../foo bar/baz
$ find -L bar -delete
find: cannot delete ‘bar/baz’: Not a directory
find: cannot delete ‘bar’: Directory not empty

(No -type d necessary.)  strace shows that find tried to

unlinkat(AT_FDCWD, "bar/baz", AT_REMOVEDIR) = -1 ENOTDIR (Not a directory)

but "bar/baz" is not a directory so AT_REMOVEDIR is wrong.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46305>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]