MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / IsProtected

Function IsProtected

agent/utils/files/file_op.go:65–82  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

63)
64
65func IsProtected(path string) bool {
66 real, err := filepath.EvalSymlinks(path)
67 if err == nil {
68 path = real
69 }
70
71 abs, err := filepath.Abs(path)
72 if err == nil {
73 path = abs
74 }
75
76 for _, p := range protectedPaths {
77 if path == p {
78 return true
79 }
80 }
81 return false
82}
83
84type FileOp struct {
85 Fs afero.Fs

Callers 4

DeleteDirMethod · 0.85
DeleteFileMethod · 0.85
CleanDirMethod · 0.85
RmRfMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected