Plan 9 support: Remove dependency on syscall.ELOOP#51
Plan 9 support: Remove dependency on syscall.ELOOP#51rminnich wants to merge 1 commit intocyphar:mainfrom
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 |
cyphar
left a comment
There was a problem hiding this comment.
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 <rminnich@gmail.com>
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? |
4c33ea6 to
f9f2d4c
Compare
The plan9/amd64 build fails because the vendored cyphar/filepath-securejoin uses syscall.ELOOP, which doesn't exist on plan9. Upstream fix (cyphar/filepath-securejoin#51) is stalled. Given ~0 user demand (46 downloads total, one release), remove the target rather than carry a local patch. Closes #774 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Provide package level ErrLoop instead.