Skip to content

Commit fbc9a2a

Browse files
committed
Plan 9 support, try 2: continue with syscall.ELOOP for unix
Signed-off-by: Ronald G Minnich <[email protected]>
1 parent d9ac84b commit fbc9a2a

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

errors_plan9.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright (C) 2014-2015 Docker Inc & Go Authors. All rights reserved.
2+
// Copyright (C) 2017-2025 SUSE LLC. All rights reserved.
3+
// Use of this source code is governed by a BSD-style
4+
// license that can be found in the LICENSE file.
5+
6+
package securejoin
7+
8+
// ErrLoop is returned when too many symbolic links are encountered.
9+
var ErrLoop = errors.New("Too many symbolic links were encountered in translating the pathname")

errors_unix.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (C) 2014-2015 Docker Inc & Go Authors. All rights reserved.
2+
// Copyright (C) 2017-2025 SUSE LLC. All rights reserved.
3+
// Use of this source code is governed by a BSD-style
4+
// license that can be found in the LICENSE file.
5+
6+
//go:build !plan9
7+
8+
package securejoin
9+
10+
import "syscall"
11+
12+
// ErrLoop is returned when too many symbolic links are encountered.
13+
var ErrLoop = syscall.ELOOP

join.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ import (
1515

1616
const maxSymlinkLimit = 255
1717

18-
// ErrLoop is returned when too many symbolic links are encountered.
19-
var ErrLoop = errors.New("Too many symbolic links were encountered in translating the pathname")
20-
2118
// IsNotExist tells you if err is an error that implies that either the path
2219
// accessed does not exist (or path components don't exist). This is
2320
// effectively a more broad version of [os.IsNotExist].

0 commit comments

Comments
 (0)