diff --git a/cmd/object-api-utils.go b/cmd/object-api-utils.go index 90a1f9a84..4bec241e4 100644 --- a/cmd/object-api-utils.go +++ b/cmd/object-api-utils.go @@ -183,6 +183,16 @@ func checkObjectNameForLengthAndSlash(bucket, object string) error { Object: object, } } + if runtime.GOOS == globalWindowsOSName { + // Explicitly disallowed characters on windows. + // Avoids most problematic names. + if strings.ContainsAny(object, `:*?"|<>`) { + return ObjectNameInvalid{ + Bucket: bucket, + Object: object, + } + } + } return nil } diff --git a/cmd/posix.go b/cmd/posix.go index a16fcf0d1..d9a196f35 100644 --- a/cmd/posix.go +++ b/cmd/posix.go @@ -1289,6 +1289,9 @@ func (s *posix) CreateFile(volume, path string, fileSize int64, r io.Reader) (er // Create top level directories if they don't exist. // with mode 0777 mkdir honors system umask. if err = mkdirAll(slashpath.Dir(filePath), 0777); err != nil { + if errors.Is(err, &os.PathError{}) { + return errFileAccessDenied + } return err }