We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b1d1c0 commit ff37912Copy full SHA for ff37912
cos-csi-mounter/server/utils.go
@@ -41,7 +41,7 @@ func pathValidator(targetPath string) error {
41
if err != nil {
42
return fmt.Errorf("failed to resolve absolute mount path: %v", err)
43
}
44
- if !(strings.HasPrefix(absPath, safeMountDirs[0]) || strings.HasPrefix(absPath, safeMountDirs[1])) {
+ if !strings.HasPrefix(absPath, safeMountDirs[0]) && !strings.HasPrefix(absPath, safeMountDirs[1]) {
45
return fmt.Errorf("bad value for target path \"%v\"", targetPath)
46
47
return nil
0 commit comments