(path string)
| 63 | ) |
| 64 | |
| 65 | func 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 | |
| 84 | type FileOp struct { |
| 85 | Fs afero.Fs |
no outgoing calls
no test coverage detected