* prevent bucket renaming in filer, fuse mount, s3 * refactor CanRename to support context propagation * harden bucket rename validation to fail closed on find error
22 lines
301 B
Go
22 lines
301 B
Go
package filer
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
func (f *Filer) IsBucket(entry *Entry) bool {
|
|
if !entry.IsDirectory() {
|
|
return false
|
|
}
|
|
parent, dirName := entry.FullPath.DirAndName()
|
|
if parent != f.DirBucketsPath {
|
|
return false
|
|
}
|
|
if strings.HasPrefix(dirName, ".") {
|
|
return false
|
|
}
|
|
|
|
return true
|
|
|
|
}
|