Repository navigation
fix: complete chmod spec parser parity with upstream - #5534
Merged
Merged
Conversation
2 tasks
Daemon module directives `incoming chmod = SPEC` and `outgoing chmod = SPEC` were parsed off the wire and stored on `ModuleDefinition`, but never made it to the transfer engine. The receiver built `MetadataOptions` directly from the client-supplied flags, so any daemon-side chmod policy was a silent no-op. Thread a `chmod_modifiers: Option<ChmodModifiers>` field through `ServerConfig` / `ServerConfigBuilder`. The daemon's `build_server_config()` now resolves the module's `incoming_chmod()` (client push) or `outgoing_chmod()` (client pull) into the parsed modifier chain and seeds it on the config; the receiver's `setup_transfer` forwards it into `MetadataOptions::with_chmod`. A malformed spec is logged at warn level and ignored, matching upstream's `parse_chmod()` returning NULL. Also lock in upstream chmod-option.test parser parity with explicit clause-level tests for `F600`, `D755`, `Fu=rw,go-rwx`, `Dg+s`, `+X`, `Fo-x`, `ug-s,a+rX,D+w`, and `u=` so any drift from `chmod.c::parse_chmod()` surfaces here rather than in interop. # Conflicts: # crates/daemon/src/daemon/sections/module_access/client_args.rs # crates/transfer/src/config/builder.rs # crates/transfer/src/config/builder_tests.rs # crates/transfer/src/config/mod.rs # crates/transfer/src/receiver/transfer/setup.rs
oferchen
force-pushed
the
fix/uts-17-chmod-spec-parse
branch
from
June 10, 2026 11:07
1c1eee2 to
60a85e9
Compare
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
Daemon module directives `incoming chmod = SPEC` and `outgoing chmod = SPEC` were parsed off the wire and stored on `ModuleDefinition`, but never made it to the transfer engine. The receiver built `MetadataOptions` directly from the client-supplied flags, so any daemon-side chmod policy was a silent no-op. Thread a `chmod_modifiers: Option<ChmodModifiers>` field through `ServerConfig` / `ServerConfigBuilder`. The daemon's `build_server_config()` now resolves the module's `incoming_chmod()` (client push) or `outgoing_chmod()` (client pull) into the parsed modifier chain and seeds it on the config; the receiver's `setup_transfer` forwards it into `MetadataOptions::with_chmod`. A malformed spec is logged at warn level and ignored, matching upstream's `parse_chmod()` returning NULL. Also lock in upstream chmod-option.test parser parity with explicit clause-level tests for `F600`, `D755`, `Fu=rw,go-rwx`, `Dg+s`, `+X`, `Fo-x`, `ug-s,a+rX,D+w`, and `u=` so any drift from `chmod.c::parse_chmod()` surfaces here rather than in interop. # Conflicts: # crates/daemon/src/daemon/sections/module_access/client_args.rs # crates/transfer/src/config/builder.rs # crates/transfer/src/config/builder_tests.rs # crates/transfer/src/config/mod.rs # crates/transfer/src/receiver/transfer/setup.rs
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
Upstream testsuite
chmod-option.testexercises both the CLI--chmod=SPECparser and the daemon'sincoming chmod = SPEC/outgoing chmod = SPECmodule directives. The CLI side already routes--chmodthroughChmodModifiersinto the receiver'sMetadataOptions, but the daemon side parsed the directive intoModuleDefinitionand then dropped it on the floor: the spec never reached the transfer engine, so the test'sincoming chmod = Fo-xcase was a silent no-op.chmod_modifiers: Option<ChmodModifiers>toServerConfig/ServerConfigBuilder.build_server_config()resolvesmodule.incoming_chmod()(push) ormodule.outgoing_chmod()(pull) into the parsed modifier chain. A malformed spec is logged and skipped, matching upstream'sparse_chmod()NULL return.setup_transferforwards the daemon-sourced modifiers viaMetadataOptions::with_chmod, so they apply at the sameset_file_attrs()site as a client-side--chmod.Also adds upstream-corpus parser tests for
F600,D755,Fu=rw,go-rwx,Dg+s,+X,Fo-x,ug-s,a+rX,D+w, andu=so any drift fromchmod.c::parse_chmod()surfaces here instead of in interop.Test plan
--no-perms)