mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-04-05 20:52:50 +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 (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api/s3bucket"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
@ -256,6 +257,12 @@ func (f *Filer) ensureParentDirectoryEntry(ctx context.Context, entry *Entry, di
|
||||
// no such existing directory
|
||||
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
|
||||
if err = f.ensureParentDirectoryEntry(ctx, entry, dirParts, level-1, isFromOtherCluster); err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user