Plan 9 support: Remove dependency on syscall.ELOOP
Provide package level ErrLoop instead.
Plan9 doesn't have symlinks so I'm not sure what the benefit is of using this on Plan9 -- filepath.Join should theoretically be correct on Plan9 (it isn't race-safe but neither is SecureJoin).
error.Is(err, unix.ELOOP) continuing to work would be nice as well.
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
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.
@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?