fs/erasure: Ignore objects with / even for DeleteObject() (#4303)

Additionally GetObject() also returns errFileNotFound similar
to HeadObject().

Fixes #4302
This commit is contained in:
Harshavardhana
2017-05-09 14:32:24 -07:00
committed by GitHub
parent fc774957fe
commit 298b470f69
6 changed files with 44 additions and 19 deletions

View File

@@ -36,6 +36,10 @@ func checkBucketAndObjectNames(bucket, object string) error {
}
// Verify if object is valid.
if !IsValidObjectName(object) {
// Objects with "/" are invalid, verify to return a different error.
if hasSuffix(object, slashSeparator) || hasPrefix(object, slashSeparator) {
return traceError(ObjectNotFound{Bucket: bucket, Object: object})
}
return traceError(ObjectNameInvalid{Bucket: bucket, Object: object})
}
return nil