coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

rm: add support for removing empty dir with invalid permissions

Open shinhs0506 opened this issue 1 year ago • 16 comments

add support for removing inaccessible/unreadable empty directories on unix platforms

I had to refactor handle_dir because it was becoming unreadable and it fixed other GNU tests where we previously had to alter its output.

~~I don't think the last 2 fails are regressions according to #2949, but can someone confirm?~~

also partially fixes tests/rm/empty-inacc.sh

shinhs0506 avatar Jun 05 '23 20:06 shinhs0506

GNU testsuite comparison:

Congrats! The gnu test tests/rm/ir-1 is no longer failing!
GNU test failed: tests/misc/pwd-long. tests/misc/pwd-long is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/cycle. tests/rm/cycle is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/deep-2. tests/rm/deep-2 is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/fail-eacces. tests/rm/fail-eacces is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/rm2. tests/rm/rm2 is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/unread2. tests/rm/unread2 is passing on 'main'. Maybe you have to rebase?

github-actions[bot] avatar Jun 05 '23 20:06 github-actions[bot]

GNU testsuite comparison:

Congrats! The gnu test tests/rm/ir-1 is no longer failing!
GNU test failed: tests/misc/pwd-long. tests/misc/pwd-long is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/cycle. tests/rm/cycle is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/deep-2. tests/rm/deep-2 is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/fail-eacces. tests/rm/fail-eacces is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/rm2. tests/rm/rm2 is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/unread2. tests/rm/unread2 is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?

github-actions[bot] avatar Jun 05 '23 22:06 github-actions[bot]

GNU testsuite comparison:

Congrats! The gnu test tests/rm/ir-1 is no longer failing!
Congrats! The gnu test tests/rm/rm1 is no longer failing!
Congrats! The gnu test tests/rm/unreadable is no longer failing!
Congrats! The gnu test tests/tail-2/inotify-dir-recreate is no longer failing!
GNU test failed: tests/misc/pwd-long. tests/misc/pwd-long is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/deep-2. tests/rm/deep-2 is passing on 'main'. Maybe you have to rebase?

github-actions[bot] avatar Jun 06 '23 01:06 github-actions[bot]

GNU testsuite comparison:

Congrats! The gnu test tests/rm/ir-1 is no longer failing!
Congrats! The gnu test tests/rm/rm1 is no longer failing!
Congrats! The gnu test tests/rm/unreadable is no longer failing!
GNU test failed: tests/misc/pwd-long. tests/misc/pwd-long is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/deep-2. tests/rm/deep-2 is passing on 'main'. Maybe you have to rebase?

github-actions[bot] avatar Jun 06 '23 17:06 github-actions[bot]

GNU testsuite comparison:

Congrats! The gnu test tests/rm/ir-1 is no longer failing!
Congrats! The gnu test tests/rm/rm1 is no longer failing!
Congrats! The gnu test tests/rm/unreadable is no longer failing!
GNU test failed: tests/misc/pwd-long. tests/misc/pwd-long is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/deep-2. tests/rm/deep-2 is passing on 'main'. Maybe you have to rebase?

github-actions[bot] avatar Jun 06 '23 22:06 github-actions[bot]

both tests/misc/pwd-long & tests/rm/deep-2 were passing. Could you please have a look? thanks

sylvestre avatar Jun 07 '23 06:06 sylvestre

GNU testsuite comparison:

Congrats! The gnu test tests/rm/ir-1 is no longer failing!
Congrats! The gnu test tests/rm/rm1 is no longer failing!
Congrats! The gnu test tests/rm/unreadable is no longer failing!

github-actions[bot] avatar Jun 07 '23 20:06 github-actions[bot]

GNU testsuite comparison:

Congrats! The gnu test tests/rm/ir-1 is no longer failing!
Congrats! The gnu test tests/rm/rm1 is no longer failing!
Congrats! The gnu test tests/rm/unreadable is no longer failing!

github-actions[bot] avatar Jun 08 '23 19:06 github-actions[bot]

resolves #3722

shinhs0506 avatar Jun 15 '23 21:06 shinhs0506

sorry we didn't merge this yet. I tried to rebase it, let's see if it works

sylvestre avatar Sep 24 '23 08:09 sylvestre

GNU testsuite comparison:

Congrats! The gnu test tests/rm/rm2 is no longer failing!
Congrats! The gnu test tests/rm/unreadable is no longer failing!
GNU test failed: tests/rm/d-3. tests/rm/d-3 is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/rm3. tests/rm/rm3 is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/rm5. tests/rm/rm5 is passing on 'main'. Maybe you have to rebase?

github-actions[bot] avatar Sep 24 '23 11:09 github-actions[bot]

We will need to fix the last three

sylvestre avatar Sep 24 '23 11:09 sylvestre

GNU testsuite comparison:

Congrats! The gnu test tests/rm/ir-1 is no longer failing!
Congrats! The gnu test tests/rm/rm2 is no longer failing!
Congrats! The gnu test tests/rm/unreadable is no longer failing!

github-actions[bot] avatar Oct 05 '23 23:10 github-actions[bot]

@sylvestre resolved, the lint error is fixed by #5360

shinhs0506 avatar Oct 05 '23 23:10 shinhs0506

Oh I forgot about this PR while writing https://github.com/uutils/coreutils/pull/5344, we're definitely gonna have some difficult merge conflicts between those two. I'll probably rebase mine on top of yours, but I'll look at this PR some more first to see how much we can port over.

An alternative solution is that I take what you've done here and implement it on my branch (with credit in git of course).

tertsdiepraam avatar Oct 06 '23 14:10 tertsdiepraam

@tertsdiepraam you might need to update this one too :)

sylvestre avatar Dec 25 '23 12:12 sylvestre