coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

rm: fix issue #6620 (refuse to remove '.' and '..')

Open just-an-engineer opened this issue 1 year ago • 8 comments

Before processing the directory, if it ends with "." or "..", it now immediately returns with the same error message as GNU Should close #6620

just-an-engineer avatar Aug 07 '24 15:08 just-an-engineer

I see this does the same thing as #6621

just-an-engineer avatar Aug 07 '24 16:08 just-an-engineer

but tests/rm/r-4 is fixed in the other PR (your modification is smaller than the other which is a +)

sylvestre avatar Aug 07 '24 17:08 sylvestre

Thanks. Do you want me to close this out? Or which PR will get merged?

just-an-engineer avatar Aug 07 '24 21:08 just-an-engineer

the other PR code is a bit more complex.

sylvestre avatar Aug 07 '24 21:08 sylvestre

GNU testsuite comparison:

Congrats! The gnu test tests/timeout/timeout is no longer failing!

github-actions[bot] avatar Aug 08 '24 15:08 github-actions[bot]

@just-an-engineer what is your plan wrt this PR?

sylvestre avatar Aug 13 '24 21:08 sylvestre

We can merge this one if @AnirbanHalder654322 doesn't have any progress on the other PR, since I already have it working without regex, it already works on Windows, and since I made them a coauthor on the commits. But if they responds and pushes whatever changes, I'll leave it to you or them, but if the other one gets merged, I can just close this one. So I can go either way. It can be merged right now, or it can be closed if Anirban pushes the necessary changes and you decide to go with that one

just-an-engineer avatar Aug 14 '24 00:08 just-an-engineer

@sylvestre, I'm marking this as a draft, and I'll close it out once @AnirbanHalder654322 PR gets merged. His is starting to look a bit cleaner and more fleshed out than mine. Particularly with removing trailing slashes, and more comprehensive tests, in my opinion.

just-an-engineer avatar Aug 14 '24 13:08 just-an-engineer

@just-an-engineer it is still marked as draft, are you still working on it? thanks

sylvestre avatar Dec 02 '24 09:12 sylvestre

Since #6621 was merged, maybe we can close this PR ?

RenjiSann avatar Feb 06 '25 11:02 RenjiSann

sounds good

sylvestre avatar Feb 16 '25 23:02 sylvestre