-
Notifications
You must be signed in to change notification settings - Fork 235
Be more explicit about future changes to mode
#231
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
Be more explicit about future changes to mode
#231
Conversation
The perm kerfuffle doesn't let me add reviewers: tagging @achingbrain @Stebalien |
I'm not sure about the language - for a spec 'must' is very strong. If an implementation didn't mask the values we might say it had a bug but would it be was noncompliant? Maybe 'It is recommended that' would be better? |
I used
|
I think must is a requirement. Otherwise, these bits will have host-specific meaning. However, we should probably also note that implementations MUST NOT reject modes with these bits set and MUST round-trip them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the mask 0777, not 07777?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(wrong button)
The spec defines 4 bit-tripplets: https://github.com/ipfs/specs/blame/86c928d32ad180500576933ad3dd2f20d52ec4e4/UNIXFS.md#L86-L87 |
Ah, yeah, fair enough. Package managers and the like probably need those bits. |
@Stebalien when you say 'round trip' them, do you mean expose them to callers or just to make sure they are still written into the protobuf if the deserialized form of the UnixFS entry is mutated & persisted by the caller, or something else? |
The latter. Modifying a file shouldn't remove the bits. However, the caller shouldn't see them. |
@Stebalien actually now I am confused myself
doesn't square with my proposed text of:
Are we saying something like:
|
That's what I was thinking. That is, if I modify/move a file, I shouldn't touch the mode bits. On the other hand... users usually set the mode by:
This should preserve unknown bits. However, if the user straight-up sets the mode (0750), that should override the bits. So... I wonder if we just want to return them and say "Bits not within the mask 07777 are reserved and should be ignored by the application". Basically, what we had. At the end of the day, I think any of these solutions will work. |
I think it's a case of caching the original Either way, this behaviour should be added to the spec so it's specific. |
I'll leave it up to the two of you. I trust that, between the two of you, you'll make a reasonable choice. |
To clarify - decisions should be owned by one person and have a clear
deadline. I'm assuming Alex is the DRI for making the best decision
possible with the available info (synthesized from Steve/Peter/etc). What
is the deadline to make a call, Alex?
…On Wed, Dec 18, 2019, 12:52 PM Steven Allen ***@***.***> wrote:
I'll leave it up to the two of you. I trust that, between the two of you,
you'll make a reasonable choice.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#231?email_source=notifications&email_token=AAEXAF66XZPTRVSOCR2GJG3QZIFGVA5CNFSM4J2CHNS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHF34HQ#issuecomment-567000606>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEXAF62E3H2DK45RMCE2ITQZIFGVANCNFSM4J2CHNSQ>
.
|
I think we should be able to get this wrapped up by tomorrow, I think we're pretty close to a decision. |
Assuming implementers encapsulate the protobuf serialization/deserialization I don't think we should then expect the consumers of the encapsulation to do the masking, it just makes it a leaky abstraction . @ribasushi I propose we require the implementer of the spec to mask off and not try to interpret bits not defined in the spec, but also to persist the bits not in the spec when serializing. This should allow older implementations to not inadvertently trample over newer features if/when higher bits are documented in subsequent updates. What do you think? |
Add wording for the two common cases of use
@achingbrain this is now ready for a re-read. It is a bit more wordy than I'd like, but it's difficult to capture this without spelling it out. I also noticed a couple issues while reading this, will address in additional PRs |
Incorporate suggestions from @achingbrain Co-Authored-By: Alex Potsides <[email protected]>
@achingbrain applied both of your suggestions verbatim. Not sure what the exact protocol is here to merge things. |
LGTM. @achingbrain ping me when you've given a signoff. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ping @Stebalien |
No description provided.