Files
seaweedFS/weed/filer/filer_buckets.go
Chris Lu 796a911cb3 Prevent bucket renaming in filer, fuse mount, and S3 (#8048)
* prevent bucket renaming in filer, fuse mount, s3

* refactor CanRename to support context propagation

* harden bucket rename validation to fail closed on find error
2026-01-16 19:48:09 -08:00

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
}