Repository navigation
use the attribute flags for the attributes of an open request - #675
Merged
Merged
Conversation
Since 159d286, requestFromPacket copies the attributes of an SSH_FXP_OPEN into Request.Attrs, but Request.Flags holds the open flags. AttrFlags and Attributes read Request.Flags, so for an open they decoded the attributes with the pflags as attribute flags. For example, an open for write, create and truncate reported UID/GID and times, and Attributes returned nil or wrong values. Keep the attribute flags of an open request and use them in AttrFlags and Attributes for Get, Put and Open requests. Fixes pkg#557
puellanivis
reviewed
Oct 19, 2026
Contributor
Author
|
Addressed this by using |
puellanivis
reviewed
Oct 19, 2026
Contributor
Author
|
CI caught two gaps in the branch. The Fsetstat path copied the attribute bitmap into Flags but did not preserve it in attrFlags, so handlers parsed attributes incorrectly; I now copy it there. I also restored the existing RealPath test handler setup and limited only the new Open attributes regression test to FilePut. These fixes are in 9a5ce85. |
puellanivis
reviewed
Oct 20, 2026
puellanivis
approved these changes
Nov 5, 2026
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.
Fixes #557
Since 159d286 (in #574),
requestFromPacketcopies the attributes of an SSH_FXP_OPEN intoRequest.Attrs, butRequest.Flagsholds the pflags for an open.AttrFlags()andAttributes()readRequest.Flags, so they decoded the attributes with the pflags as attribute flags. For example, an open for write, create and truncate that sends a size and permissions reported{UidGid: true, Acmodtime: true}, andAttributes()returned nil.The request now keeps the attribute flags of an open separately, and
AttrFlags()andAttributes()use them for Get, Put and Open requests. Setstat requests are unchanged.The test sends an open with a size and permissions through a
RequestServerand checks what the handler sees. It fails without the change.