Skip to content
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

rewrite arg0_passed tests #919

Merged
merged 1 commit into from
Nov 28, 2024
Merged

rewrite arg0_passed tests #919

merged 1 commit into from
Nov 28, 2024

Conversation

squell
Copy link
Member

@squell squell commented Nov 28, 2024

See #735. The test cases we had worked because on modern Debian systems /bin and /usr/bin are symlinked. But they made it a bit hard to see what was being tested (and why one of the test cases is ignored--and probably that test case succeeded on FreeBSD).

This change alters one of the tests so it should reliably fail with sudo-rs (and so indicate a subtle incompatibility).

Note that this incompatibility is unfixable since sudo-rs uses "realpath" commandmatching whereas ogsudo uses "inode based" matching.

@squell squell added the minor minor issue, PR without an issue label Nov 28, 2024
@squell squell force-pushed the nit-overhaul-arg0-passing-test branch from 470d057 to 1060010 Compare November 28, 2024 14:02
@squell squell merged commit b293c2a into main Nov 28, 2024
13 checks passed
@squell squell deleted the nit-overhaul-arg0-passing-test branch November 28, 2024 15:17
}
assert_starts_with!(stderr, "foo: unrecognized option");
let stderr = output.stderr();
assert_starts_with!(stderr, "/nib/sleep:");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out this doesn't actually work on FreeBSD:

---- sudo::path_search::arg0_native_is_passed_from_commandline stdout ----
thread 'sudo::path_search::arg0_native_is_passed_from_commandline' panicked at sudo-compliance-tests/src/sudo/path_search.rs:130:5:
"usage: sleep number[unit] ...\nUnit can be 's' (seconds, the default), m (minutes), h (hours), or d (days)." did not start with "/nib/sleep:"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #922

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

Successfully merging this pull request may close these issues.

2 participants