Skip to content

id: Fix incorrect human-readable output #7814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

frendsick
Copy link
Contributor

This PR fixes the human-readable output of the -p flag. Currently, it reports incorrect information about euid and does not include rgid when it differs from egid.

Reproduction instructions can be found in the related issue #7812.

fixes #7812

Copy link

GNU testsuite comparison:

GNU test failed: tests/misc/tee. tests/misc/tee is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)

@frendsick
Copy link
Contributor Author

Testing this has the same problem as #7796. The test would need to be run with elevated privileges and change the EUID and EGID of the process to be different from the actual UID and GID.
See: #7796 (comment)

@sylvestre
Copy link
Contributor

how can i test this locally ? :)

@frendsick
Copy link
Contributor Author

See the Reproduce section in the related issue #7812. The main branch prints the wrong output while this branch should print the expected output.

@sylvestre sylvestre force-pushed the fix/id-human-readable-output branch from 42c55a4 to 2d30c16 Compare May 25, 2025 21:01
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@frendsick frendsick force-pushed the fix/id-human-readable-output branch 2 times, most recently from 472ea3c to 613b777 Compare June 7, 2025 22:51
Copy link

github-actions bot commented Jun 7, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

Adds l10n translations for `id-output-rgid`
@frendsick frendsick force-pushed the fix/id-human-readable-output branch from 613b777 to cba4544 Compare June 9, 2025 10:26
Copy link

github-actions bot commented Jun 9, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

@frendsick frendsick force-pushed the fix/id-human-readable-output branch from 3fee559 to e78eda1 Compare June 14, 2025 09:38
@frendsick
Copy link
Contributor Author

The test_id_pretty_print_suid_binary test can be run by enabling the chmod and chown features. To test the output with different EUID and EGID values than the real UID and GID, you can use the following command:

sudo true && cargo test --features id,chown,chmod test_id_pretty_print_suid_binary

The sudo true command enables running commands with sudo without a password within the test, assuming the sudo's timestamp_timeout is not configured to 0 (always prompt for a password).

Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

id: Incorrect human-readable output
2 participants