-
Notifications
You must be signed in to change notification settings - Fork 380
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
Memfile stuff #561
base: master
Are you sure you want to change the base?
Memfile stuff #561
Commits on Oct 31, 2023
-
This correctly handles wrapped errors as well.
Zeph / Liz Loss-Cutler-Hull committedOct 31, 2023 Configuration menu - View commit details
-
Copy full SHA for b9d7f36 - Browse repository at this point
Copy the full SHA b9d7f36View commit details -
Zeph / Liz Loss-Cutler-Hull committed
Oct 31, 2023 Configuration menu - View commit details
-
Copy full SHA for 8513fed - Browse repository at this point
Copy the full SHA 8513fedView commit details -
Move memfile's Setstat function, add features.
This makes it possible for memfile to handle mode changes, ctime changes, in addition to the already existing file size changes.
Zeph / Liz Loss-Cutler-Hull committedOct 31, 2023 Configuration menu - View commit details
-
Copy full SHA for 07a6b6a - Browse repository at this point
Copy the full SHA 07a6b6aView commit details -
Make a new interface for direct SetStat access.
I'm really not especially happy with this. It works, it's minimally invasive, and it feels like the wrong solution. I'm pretty sure that the right solution is a breaking change of the Request structure, to just flat out contain FileAttrFlags and FileStat, having requestFromPacket do the parsing into those structures. But that's an API change, and I doubt that we want a major version bump for this. As an alternative, we could have a new Request structure type, with that layout, and have public functions for converting between them. That would at least make it possible for someone to construct the Request structure for a Setstat command. The use case of this is being able to populate a memfile backed sftp server with test data that has specific timestamps, as part of the test framework of an internal program. I'm definitely open to other ideas on how to solve this problem.
Zeph / Liz Loss-Cutler-Hull committedOct 31, 2023 Configuration menu - View commit details
-
Copy full SHA for 7bf7a25 - Browse repository at this point
Copy the full SHA 7bf7a25View commit details -
Add SetAttributes as an alternate option.
This would replace the SetStat public function from the last commit. Instead, this makes it practical to construct a Setstat request. From some quick testing, this appears to do the job correctly, and it feels like a lot less of hack. It still doesn't feel entirely right, but it's closer.
Zeph / Liz Loss-Cutler-Hull committedOct 31, 2023 Configuration menu - View commit details
-
Copy full SHA for 6b2b978 - Browse repository at this point
Copy the full SHA 6b2b978View commit details
Commits on Nov 1, 2023
-
This is in favor of an alternate approach, we can always pull it back out of git history if we want to.
Zeph / Liz Loss-Cutler-Hull committedNov 1, 2023 Configuration menu - View commit details
-
Copy full SHA for 688c055 - Browse repository at this point
Copy the full SHA 688c055View commit details -
It will be replaced with an alternate method.
Zeph / Liz Loss-Cutler-Hull committedNov 1, 2023 Configuration menu - View commit details
-
Copy full SHA for a0a4a52 - Browse repository at this point
Copy the full SHA a0a4a52View commit details -
This should cover every single case where we were using == or != on an err. There may be other cases to address, but this covers a big one.
Zeph / Liz Loss-Cutler-Hull committedNov 1, 2023 Configuration menu - View commit details
-
Copy full SHA for 8ee6563 - Browse repository at this point
Copy the full SHA 8ee6563View commit details -
Merge SetStat back into Filecmd.
With us no longer offering an interface with SetStat, there is no reason for this to be it's own function anymore. This also cleaned up how we handle truncation errors.
Zeph / Liz Loss-Cutler-Hull committedNov 1, 2023 Configuration menu - View commit details
-
Copy full SHA for f215740 - Browse repository at this point
Copy the full SHA f215740View commit details -
Export ToFileMode and FromFileMode.
For the sake of sanity, we really should be offering _some_ way for users of memfile to get the file mode right. These two are what we use internally, so they make perfect sense to expose.
Zeph / Liz Loss-Cutler-Hull committedNov 1, 2023 Configuration menu - View commit details
-
Copy full SHA for d41c7d4 - Browse repository at this point
Copy the full SHA d41c7d4View commit details -
Zeph / Liz Loss-Cutler-Hull committed
Nov 1, 2023 Configuration menu - View commit details
-
Copy full SHA for 87fa218 - Browse repository at this point
Copy the full SHA 87fa218View commit details -
memfile: Check file permissions.
We now check to ensure that the permissions on a given file allow the user to perform the requested operation. For Filereader, the file must be readable. For Filewriter, the file must be writable. For OpenFile, the file must be readable and writable.
Zeph / Liz Loss-Cutler-Hull committedNov 1, 2023 Configuration menu - View commit details
-
Copy full SHA for a5d4316 - Browse repository at this point
Copy the full SHA a5d4316View commit details -
Zeph / Liz Loss-Cutler-Hull committed
Nov 1, 2023 Configuration menu - View commit details
-
Copy full SHA for 4404cc8 - Browse repository at this point
Copy the full SHA 4404cc8View commit details -
Explictly forbid changing the mode of a symlink.
Zeph / Liz Loss-Cutler-Hull committedNov 1, 2023 Configuration menu - View commit details
-
Copy full SHA for 656a9db - Browse repository at this point
Copy the full SHA 656a9dbView commit details -
Expose To/FromFileMode for plan9.
Missed this in the first pass.
Zeph / Liz Loss-Cutler-Hull committedNov 1, 2023 Configuration menu - View commit details
-
Copy full SHA for b1d53f7 - Browse repository at this point
Copy the full SHA b1d53f7View commit details
Commits on Nov 2, 2023
-
Add FileStat.MarshalTo and FAF.ForRequest.
FileStat.MarshalTo takes in flags, and generates the []byte that goes into Request.Attr FileAttrFlags.ForRequest() generates the uint32 bitmap that goes into Request.Flags
Zeph / Liz Loss-Cutler-Hull committedNov 2, 2023 Configuration menu - View commit details
-
Copy full SHA for cbf7fcd - Browse repository at this point
Copy the full SHA cbf7fcdView commit details -
Don't put the flags in the attrs.
Zeph / Liz Loss-Cutler-Hull committedNov 2, 2023 Configuration menu - View commit details
-
Copy full SHA for 4b73c93 - Browse repository at this point
Copy the full SHA 4b73c93View commit details -
Zeph / Liz Loss-Cutler-Hull committed
Nov 2, 2023 Configuration menu - View commit details
-
Copy full SHA for 82cd5ca - Browse repository at this point
Copy the full SHA 82cd5caView commit details -
Revert "Expose To/FromFileMode for plan9."
This reverts commit b1d53f7.
Zeph / Liz Loss-Cutler-Hull committedNov 2, 2023 Configuration menu - View commit details
-
Copy full SHA for 5fd4ff4 - Browse repository at this point
Copy the full SHA 5fd4ff4View commit details -
Revert "Export ToFileMode and FromFileMode."
This reverts commit d41c7d4.
Zeph / Liz Loss-Cutler-Hull committedNov 2, 2023 Configuration menu - View commit details
-
Copy full SHA for 660c973 - Browse repository at this point
Copy the full SHA 660c973View commit details -
Revert "Use errors.Is everywhere."
This reverts commit 8ee6563.
Zeph / Liz Loss-Cutler-Hull committedNov 2, 2023 Configuration menu - View commit details
-
Copy full SHA for 6c452cc - Browse repository at this point
Copy the full SHA 6c452ccView commit details -
Revert "Silence a linter warning."
This reverts commit 87fa218.
Zeph / Liz Loss-Cutler-Hull committedNov 2, 2023 Configuration menu - View commit details
-
Copy full SHA for 6563249 - Browse repository at this point
Copy the full SHA 6563249View commit details -
Zeph / Liz Loss-Cutler-Hull committed
Nov 2, 2023 Configuration menu - View commit details
-
Copy full SHA for ad0d7df - Browse repository at this point
Copy the full SHA ad0d7dfView commit details -
Let Setstat follow symlinks, and rework comments.
As best as I can tell, under POSIX chmod will follow symlinks. However I am definitely not sure if that is the case for common sftp servers on POSIX filesystems, we should consider checking... Some day.
Zeph / Liz Loss-Cutler-Hull committedNov 2, 2023 Configuration menu - View commit details
-
Copy full SHA for 7e1a518 - Browse repository at this point
Copy the full SHA 7e1a518View commit details -
Shadow err to avoid the value leaking.
Zeph / Liz Loss-Cutler-Hull committedNov 2, 2023 Configuration menu - View commit details
-
Copy full SHA for d3a55c7 - Browse repository at this point
Copy the full SHA d3a55c7View commit details -
Move the chmod logic to it's own method.
Zeph / Liz Loss-Cutler-Hull committedNov 2, 2023 Configuration menu - View commit details
-
Copy full SHA for bff300b - Browse repository at this point
Copy the full SHA bff300bView commit details -
Make marshalFileInfo use fileStat.MarshalTo
This avoids logic duplication.
Zeph / Liz Loss-Cutler-Hull committedNov 2, 2023 Configuration menu - View commit details
-
Copy full SHA for 1d040d6 - Browse repository at this point
Copy the full SHA 1d040d6View commit details -
That is, 0oNNN instead of 0oNNNN, this is because we don't have any current cases where we're using the 4th digit, and so things turned into 0o0200.
Zeph / Liz Loss-Cutler-Hull committedNov 2, 2023 Configuration menu - View commit details
-
Copy full SHA for 706f4f1 - Browse repository at this point
Copy the full SHA 706f4f1View commit details
Commits on Nov 3, 2023
-
MarshalTo now takes a []byte argument.
Zeph / Liz Loss-Cutler-Hull committedNov 3, 2023 Configuration menu - View commit details
-
Copy full SHA for 1ae2738 - Browse repository at this point
Copy the full SHA 1ae2738View commit details -
Add warning comments around the Extended logic.
Zeph / Liz Loss-Cutler-Hull committedNov 3, 2023 Configuration menu - View commit details
-
Copy full SHA for 3d7324a - Browse repository at this point
Copy the full SHA 3d7324aView commit details