Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for hasBadPathComponent (1.39 sec)

  1. cmd/generic-handlers_test.go

    	}
    	for _, tt := range tests {
    		t.Run(tt.name, func(b *testing.B) {
    			b.SetBytes(int64(len(tt.input)))
    			b.ReportAllocs()
    			for b.Loop() {
    				if got := hasBadPathComponent(tt.input); got != tt.want {
    					t.Fatalf("hasBadPathComponent() = %v, want %v", got, tt.want)
    				}
    			}
    		})
    	}
    Registered: Sun Sep 07 19:28:11 UTC 2025
    - Last Modified: Fri Aug 29 02:39:48 UTC 2025
    - 6.2K bytes
    - Viewed (0)
  2. cmd/generic-handlers.go

    		return nil
    	}
    	_, err := xnet.ParseHost(host)
    	return err
    }
    
    // Check if the incoming path has bad path components,
    // such as ".." and "."
    func hasBadPathComponent(path string) bool {
    	n := len(path)
    	if n > 32<<10 {
    		// At 32K we are beyond reasonable.
    		return true
    	}
    	i := 0
    	// Skip leading slashes (for sake of Windows \ is included as well)
    Registered: Sun Sep 07 19:28:11 UTC 2025
    - Last Modified: Fri Aug 29 02:39:48 UTC 2025
    - 20.7K bytes
    - Viewed (1)
  3. cmd/admin-handlers.go

    		writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrInvalidRequest), r.URL)
    		return
    	}
    
    	file = filepath.ToSlash(file)
    	// Reject attempts to traverse parent or absolute paths.
    	if hasBadPathComponent(volume) || hasBadPathComponent(file) {
    		writeErrorResponse(r.Context(), w, errorCodes.ToAPIErr(ErrInvalidResourceName), r.URL)
    		return
    	}
    
    	var publicKey *rsa.PublicKey
    
    Registered: Sun Sep 07 19:28:11 UTC 2025
    - Last Modified: Fri Aug 29 02:39:48 UTC 2025
    - 99.6K bytes
    - Viewed (0)
  4. cmd/object-api-utils.go

    	}
    	return IsValidObjectPrefix(object)
    }
    
    // IsValidObjectPrefix verifies whether the prefix is a valid object name.
    // Its valid to have a empty prefix.
    func IsValidObjectPrefix(object string) bool {
    	if hasBadPathComponent(object) {
    		return false
    	}
    	if !utf8.ValidString(object) {
    		return false
    	}
    	if strings.Contains(object, `//`) {
    		return false
    	}
    	// This is valid for AWS S3 but it will never
    Registered: Sun Sep 07 19:28:11 UTC 2025
    - Last Modified: Wed Jun 25 15:08:54 UTC 2025
    - 37.3K bytes
    - Viewed (0)
Back to top