mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-24 23:11:45 +08:00
ensure correct auto bucket creation
fix https://github.com/seaweedfs/seaweedfs/issues/6497
This commit is contained in:
parent
fc4df944a0
commit
a75271dd43
@ -3,6 +3,7 @@ package filer
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/s3api/s3bucket"
|
||||||
"os"
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
@ -256,6 +257,12 @@ func (f *Filer) ensureParentDirectoryEntry(ctx context.Context, entry *Entry, di
|
|||||||
// no such existing directory
|
// no such existing directory
|
||||||
if dirEntry == nil {
|
if dirEntry == nil {
|
||||||
|
|
||||||
|
if len(dirParts) >= 2 && level == 2 && dirParts[0] == "buckets" {
|
||||||
|
if err := s3bucket.VerifyS3BucketName(dirParts[1]); err != nil {
|
||||||
|
return fmt.Errorf("invalid bucket name %s: %v", dirParts[1], err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ensure parent directory
|
// ensure parent directory
|
||||||
if err = f.ensureParentDirectoryEntry(ctx, entry, dirParts, level-1, isFromOtherCluster); err != nil {
|
if err = f.ensureParentDirectoryEntry(ctx, entry, dirParts, level-1, isFromOtherCluster); err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user