fix(logname): return error exit code when there is an error#9313
fix(logname): return error exit code when there is an error#9313rodrigost23 wants to merge 3 commits intouutils:mainfrom
Conversation
|
could you please add a test to make sure we don't regress in the future? thanks |
CodSpeed Performance ReportMerging #9313 will not alter performanceComparing Summary
Footnotes
|
|
GNU testsuite comparison: |
| use uutests::util_name; | ||
| let ts = TestScenario::new(util_name!()); | ||
|
|
||
| ts.cmd("unshare") |
There was a problem hiding this comment.
I've tried making getlogin return null by
- setting stdin to /dev/null
- using
terminal_sim_stdiowithstdinset tofalse - using
setsid logname
On my machine, none of these caused it to return null. Running it with unshare -U logname did produce the expected error.
Do you know a more reliable way to trigger this behavior without using unshare?
There was a problem hiding this comment.
@rodrigost23 User NS sandbox is disabled at Ubuntu by default. Would you add to CI file something like https://github.com/oech3/coreutils/blob/9cf774bed8919636f437caf0e7ee379fc701cdab/.github/workflows/GnuTests.yml#L121-L123 (with spell-checker:ignore userns)?
|
GNU testsuite comparison: |
Fixes #9312