You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: internal/safepath/k8s_safeopen_linux.go
+28-36Lines changed: 28 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -17,57 +17,49 @@ limitations under the License.
17
17
*/
18
18
19
19
import (
20
+
"context"
20
21
"fmt"
21
22
"path/filepath"
22
23
"strings"
23
-
"syscall"
24
24
25
+
"github.com/containerd/log"
26
+
"github.com/docker/docker/internal/unix_noeintr"
25
27
"golang.org/x/sys/unix"
26
-
"k8s.io/klog/v2"
27
-
"k8s.io/mount-utils"
28
28
)
29
29
30
-
const (
30
+
// kubernetesSafeOpen open path formed by concatenation of the base directory
31
+
// and its subpath and return its fd.
32
+
// Symlinks are disallowed (pathname must already resolve symlinks) and the path
33
+
// path must be within the base directory.
34
+
// This is minimally modified code from https://github.com/kubernetes/kubernetes/blob/55fb1805a1217b91b36fa8fe8f2bf3a28af2454d/pkg/volume/util/subpath/subpath_linux.go#L530
0 commit comments