-
Notifications
You must be signed in to change notification settings - Fork 21
Plan 9 support: Remove dependency on syscall.ELOOP #51
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
base: main
Are you sure you want to change the base?
Conversation
|
Plan9 doesn't have symlinks so I'm not sure what the benefit is of using this on Plan9 --
|
|
what's a better way to do this? Maybe just rewrite the whole thing for plan 9 without symlinks? I can't remove it, somebody else is using it ... go-nfs |
|
This will be zero behavioral change on unix, and only change what happens on plan 9 |
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.
Please squash your commits.
I guess that making SecureJoin a wrapper for filepath.Join on Plan9 would feel a little weird. But so is having special symlink-related logic for a system that doesn't have symlinks. I'm fine with either I guess, it's just a bit odd.
|
Basically my suggestion would be to have something like //go:build plan9
// SecureJoin is equivalent to filepath.Join, as plan9 doesn't have symlinks.
func SecureJoin(root, unsafePath string) (string, error) {
return filepath.Join(root, unsafePath), nil
}
// Ditto for SecureJoinVFS.But I'm not sure if that's really preferable... |
|
Your suggestion is much preferable to what I've done. |
|
All non-symlink tests pass on Plan 9, and in fact found an error, thanks for the push. |
Since Plan 9 does not have symlinks, these problems do not occur. Therefore, SecureJoinVFS and SecureJoin can map to filepath.Join, along with the test for rootpath containing .. Split tests so some can run on Plan 9 Move common variables and functions into common.go Signed-off-by: Ronald G Minnich <[email protected]>
325f6cb to
70d0ea2
Compare
bc37ffe to
bc371b5
Compare
|
@rminnich Do you know of any way to get GHA to run a Plan9 VM (and a recommendation of which VM systems might work well with it) by any chance? |
Provide package level ErrLoop instead.