Repository navigation
Refine negotiation sniffer short-circuiting - #175
Merged
Merged
Conversation
oferchen
added a commit
that referenced
this pull request
Sep 1, 2026
* fix(engine): answer am_root from the process identity The local-copy privilege gate resolved `am_root` with `rustix::process::geteuid()`, while the two other consumers of the same question in this crate (`may_attempt_node_creation` and the metadata-sync options) already call `metadata::am_root()`. Route the third through the same helper so there is one answer. The two differ in a way that matters. On Linux rustix compiles `geteuid` to the bare syscall instruction rather than a call to the libc symbol (`mov w8, #175; svc #0` on aarch64), so `fakeroot`'s LD_PRELOAD interposition cannot see it and it reports the real unprivileged uid in exactly the runs - the upstream testsuite's fakeroot legs, and packaging builds - where upstream believes it is root. Upstream samples the libc `geteuid()` (`main.c:1764` `our_uid = MY_UID()`, `rsync.h:1455`), which fakeroot does intercept. It also re-samples it in `become_copy_as_user()` after the permanent `--copy-as` drop; `metadata::am_root()` honours that drop through the identity override, a raw syscall does not. The new test drives the identity in both directions, so it stays non-vacuous whether or not the test process runs as root. * fix(engine): retarget the am_root citation at the 3.5.0 pin `our_uid = MY_UID()` resolves at main.c:313 and main.c:1844 in 3.5.0, not 1764. The process-identity site is the one in main(), corroborated by the existing `main.c:1843 starttime = time(NULL)` citation one line above it; 313 is become_copy_as_user()'s re-sample after the --copy-as drop.
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
matchwith a guard, avoiding nestedifstatements while preserving behaviorOption::filterinside the read loop so the early return stays clear and clippy-cleanTesting