Conversation
…420) CI globally disabled deny_remote before running any tests, since the functional suite is driven over SSH, leaving the sshd parent-chain detection path in local.c completely untested. Add a dedicated test for that path and replace the blanket disable with a bypass scoped to just the current user's <user> config entry, so deny_remote stays enforced for everything except the handful of tests that need pamusb-check to succeed from the SSH-driven CI runner. Closes #420 🤖 This PR was generated with the assistance of Claude Code I have read the rules Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI globally disabled
deny_remotebefore running any tests (via a workflow step patching<defaults>directly), because the functional suite is driven entirely over SSH anddeny_remote(which defaults totrue) would otherwise deny everypamusb-checkcall. As a result, the sshd parent-process-chain detection path inlocal.chad zero test coverage — the one feature this CI environment is naturally positioned to exercise (since it always runs over SSH) was the one thing disabled before tests ran.test-check-deny-remote-ssh.sh, which exercises the sshd-ancestry denial path directly (no device/user setup needed, since the check fires before device inspection). It skips gracefully when not actually run over SSH, since there's no env var to fake an sshd ancestor (unlikeXRDP_SESSION).<user>config entry, gated behind a newPAMUSB_CI_MODE=1env var passed from the workflow. This keepsdeny_remoteenforced for everything except the handful of tests that need a successfulpamusb-checkcall from the SSH-driven runner.Why this approach
Scoping the bypass to the specific user (rather than
<defaults>) meansdeny_remotestays "on" by default for the whole suite, and only the tests that structurally require a granted auth over SSH get an explicit, narrow opt-out — instead of the feature being untested end-to-end. Tests that build their own temp config from a copy of the live config (test-check-many-devices.sh,test-check-superuser-filtering.sh) automatically inherit the scoped bypass with no changes needed on their end.Closes #420
Test plan
bash -nsyntax check on the new/modified shell scriptstest-check-deny-remote-ssh.shskips gracefully (exit 0) when not run over SSHtests/can-actually-be-used/run-tests.shrun on the dedicated CI runner (real SSH session) confirming: new test denies + logs the expected message, andtest-check-verify-created-config.sh/test-check-many-devices.sh/test-check-superuser-filtering.shstill pass underPAMUSB_CI_MODE=1make test🤖 This PR was generated with the assistance of Claude Code
I have read the rules