mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-01-19 23:24:33 +08:00
check bucket name in sql backend
fix https://github.com/seaweedfs/seaweedfs/issues/5710
This commit is contained in:
parent
8211b29689
commit
9ac1023362
@ -7,6 +7,7 @@ import (
|
||||
"github.com/seaweedfs/seaweedfs/weed/filer"
|
||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api/s3bucket"
|
||||
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||
"strings"
|
||||
"sync"
|
||||
@ -140,6 +141,8 @@ func (store *AbstractSqlStore) getTxOrDB(ctx context.Context, fullpath util.Full
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
err = fmt.Errorf("invalid bucket name %s", bucket)
|
||||
}
|
||||
|
||||
return
|
||||
@ -340,6 +343,9 @@ func (store *AbstractSqlStore) Shutdown() {
|
||||
}
|
||||
|
||||
func isValidBucket(bucket string) bool {
|
||||
if s3bucket.VerifyS3BucketName(bucket) != nil {
|
||||
return false
|
||||
}
|
||||
return bucket != DEFAULT_TABLE && bucket != ""
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user