SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
s3: reject reserved bucket name "filemeta" (#9760)
Chris Lu35ab67fa8ac5
diff --git a/weed/s3api/s3bucket/s3api_bucket.go b/weed/s3api/s3bucket/s3api_bucket.goindex 4fab933d9b..238c49efa4 100644--- a/weed/s3api/s3bucket/s3api_bucket.go+++ b/weed/s3api/s3bucket/s3api_bucket.go@@ -7,11 +7,19 @@ import ("unicode")+// Reserved because it is the default table/collection name of the filer+// store; a bucket of the same name collides with it and wedges the bucket+// (cannot be deleted, breaks fsck) on SQL backends with per-bucket tables.+const reservedBucketName = "filemeta"+// https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.htmlfunc VerifyS3BucketName(name string) (err error) {if len(name) < 3 || len(name) > 63 {return fmt.Errorf("bucket name must between [3, 63] characters")}+ if name == reservedBucketName {+ return fmt.Errorf("bucket name %q is reserved", name)+ }for idx, ch := range name {if !(unicode.IsLower(ch) || ch == '.' || ch == '-' || unicode.IsNumber(ch)) {return fmt.Errorf("bucket name can only contain lower case characters, numbers, dots, and hyphens")diff --git a/weed/s3api/s3bucket/s3api_bucket_test.go b/weed/s3api/s3bucket/s3api_bucket_test.goindex b81ace85ec..9d19e4a080 100644--- a/weed/s3api/s3bucket/s3api_bucket_test.go+++ b/weed/s3api/s3bucket/s3api_bucket_test.go@@ -17,6 +17,7 @@ func Test_verifyBucketName(t *testing.T) {"grehtrry-","----------","x@fdsgr032",+ "filemeta",}for _, invalidName := range invalidS3BucketNames {err := VerifyS3BucketName(invalidName)