Skip to content

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.

mount, s3: clarify allowOthers requirement and bucket name error (#12197)

Ping Qiu9df7d62b4b6a
diff --git a/weed/command/mount.go b/weed/command/mount.go
index 3c81aa8cac..0b2fc929fb 100644
--- a/weed/command/mount.go
+++ b/weed/command/mount.go
@@ -115,7 +115,7 @@ func init() {
mountOptions.cacheMetaTtlSec = cmdMount.Flag.Int("cacheMetaTtlSec", 60, "metadata cache validity seconds")
mountOptions.cacheDirMaxEntries = cmdMount.Flag.Int("cacheDirMaxEntries", 100000, "a directory with more children than this is not cached locally but read directly from the filer; 0 caches everything")
mountOptions.dataCenter = cmdMount.Flag.String("dataCenter", "", "prefer to write to the data center")
- mountOptions.allowOthers = cmdMount.Flag.Bool("allowOthers", true, "allows other users to access the file system")
+ mountOptions.allowOthers = cmdMount.Flag.Bool("allowOthers", true, "allows other users to access the file system; on Linux, when mounting as a non-root user, this requires 'user_allow_other' in /etc/fuse.conf, so set -allowOthers=false otherwise")
mountOptions.defaultPermissions = cmdMount.Flag.Bool("defaultPermissions", true, "enforce permissions by the operating system")
mountOptions.umaskString = cmdMount.Flag.String("umask", "022", "octal umask, e.g., 022, 0111")
mountOptions.nonempty = cmdMount.Flag.Bool("nonempty", false, "allows the mounting over a non-empty directory")
diff --git a/weed/s3api/s3bucket/s3api_bucket.go b/weed/s3api/s3bucket/s3api_bucket.go
index 238c49efa4..b3d3da351e 100644
--- a/weed/s3api/s3bucket/s3api_bucket.go
+++ b/weed/s3api/s3bucket/s3api_bucket.go
@@ -15,14 +15,14 @@ const reservedBucketName = "filemeta"
// https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html
func VerifyS3BucketName(name string) (err error) {
if len(name) < 3 || len(name) > 63 {
- return fmt.Errorf("bucket name must between [3, 63] characters")
+ return fmt.Errorf("bucket name must be between 3 and 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")
+ return fmt.Errorf("bucket name can only contain lowercase letters, numbers, dots, and hyphens")
}
if idx > 0 && (ch == '.' && name[idx-1] == '.') {
return fmt.Errorf("bucket names must not contain two adjacent periods")
@@ -30,19 +30,19 @@ func VerifyS3BucketName(name string) (err error) {
//TODO buckets with s3 transfer acceleration cannot have . in name
}
if name[0] == '.' || name[0] == '-' {
- return fmt.Errorf("name must start with number or lower case character")
+ return fmt.Errorf("bucket name must start with a letter or number")
}
if name[len(name)-1] == '.' || name[len(name)-1] == '-' {
- return fmt.Errorf("name must end with number or lower case character")
+ return fmt.Errorf("bucket name must end with a letter or number")
}
if strings.HasPrefix(name, "xn--") {
- return fmt.Errorf("prefix xn-- is reserved and not allowed in bucket prefix")
+ return fmt.Errorf("bucket name must not start with 'xn--'")
}
if strings.HasSuffix(name, "-s3alias") {
- return fmt.Errorf("suffix -s3alias is reserved and not allowed in bucket suffix")
+ return fmt.Errorf("bucket name must not end with '-s3alias'")
}
if net.ParseIP(name) != nil {
- return fmt.Errorf("bucket name cannot be ip addresses")
+ return fmt.Errorf("bucket name must not be formatted as an IP address")
}
return nil
}