fix(auth): harden Windows storage bridge
This commit is contained in:
@@ -65,6 +65,13 @@ func createCanonicalNewPrivateFile(path string, mode os.FileMode) (*os.File, err
|
||||
return file, nil
|
||||
}
|
||||
|
||||
func createCanonicalNewPrivateParentFile(path string, mode os.FileMode) (*os.File, error) {
|
||||
if err := ValidatePrivateDirectory(filepath.Dir(path)); err != nil {
|
||||
return nil, ErrUnsafeFile
|
||||
}
|
||||
return createCanonicalNewPrivateFile(path, mode)
|
||||
}
|
||||
|
||||
// ValidatePrivateRegular requires a canonical, single-link private regular file.
|
||||
func ValidatePrivateRegular(path string) error {
|
||||
if err := ValidateCanonicalPath(path); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user