Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for validatePathNoBacksteps (0.33 sec)

  1. pkg/volume/validation/pv_validation.go

    	}
    	return allErrs
    }
    
    // ValidatePathNoBacksteps will make sure the targetPath does not have any element which is ".."
    func ValidatePathNoBacksteps(targetPath string) error {
    	parts := strings.Split(filepath.ToSlash(targetPath), "/")
    	for _, item := range parts {
    		if item == ".." {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Nov 09 11:14:08 UTC 2017
    - 2.2K bytes
    - Viewed (0)
  2. pkg/volume/validation/pv_validation_test.go

    	}{
    		"valid path": {
    			path: "/foo/bar",
    		},
    		"invalid path": {
    			path:        "/foo/bar/..",
    			expectedErr: true,
    		},
    	}
    
    	for name, tc := range testCases {
    		err := ValidatePathNoBacksteps(tc.path)
    
    		if err == nil && tc.expectedErr {
    			t.Fatalf("expected test `%s` to return an error but it didn't", name)
    		}
    
    		if err != nil && !tc.expectedErr {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Sep 16 11:12:06 UTC 2022
    - 3.2K bytes
    - Viewed (0)
Back to top