chmod: fix error handling if multiple files are handled#9793
chmod: fix error handling if multiple files are handled#9793sylvestre merged 4 commits intouutils:mainfrom
Conversation
|
could you please add a test to make sure we don't regress? thanks |
|
GNU testsuite comparison: |
I don’t think this should actually conflict with your PR #9802. I looked through your code and added my test locally; it does fail for this specific issue, but it i double checked and verified its fixed by the same online change as in this PR. If this PR lands in main, it should be straightforward to resolve with a rebase. Worst case, it would just require manually applying the fix (a simple .and(r) on l. 422 in your current fork). I still think keeping these as separate PRs makes sense, since it provides clearer documentation of what fixes which issue and ensures the corresponding regression tests are in place. |
Test has been added. |
* chmod: fix error handling if multiple files are handled * chmod: add regression test for correct exit codes * chmod: fix test expected error msg --------- Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
fixing #9790.
When multiple files are parsed only the last exit code would be returned. This means if the command succeeded for the last file the return code for the whole command would always be success even though an earlier files would be unsuccesful.