aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-04-15 11:41:34 -0700
committerChris Lu <chris.lu@gmail.com>2021-04-15 11:41:34 -0700
commitb971317a167ac806a02947047c65ba6c2a2a7bad (patch)
tree51bf8418b393a45ee62c8f325453dbf76d44525d
parent283d703d50a3379f84333c5850ea117ba9f6dc30 (diff)
downloadseaweedfs-b971317a167ac806a02947047c65ba6c2a2a7bad.tar.xz
seaweedfs-b971317a167ac806a02947047c65ba6c2a2a7bad.zip
avoid possible corrupted file names
-rw-r--r--weed/shell/command_fs_meta_load.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/weed/shell/command_fs_meta_load.go b/weed/shell/command_fs_meta_load.go
index 69ae9454c..46dc07e9a 100644
--- a/weed/shell/command_fs_meta_load.go
+++ b/weed/shell/command_fs_meta_load.go
@@ -4,6 +4,7 @@ import (
"fmt"
"io"
"os"
+ "strings"
"github.com/golang/protobuf/proto"
@@ -72,6 +73,7 @@ func (c *commandFsMetaLoad) Do(args []string, commandEnv *CommandEnv, writer io.
return err
}
+ fullEntry.Entry.Name = strings.ReplaceAll(fullEntry.Entry.Name, "/", "x")
if err := filer_pb.CreateEntry(client, &filer_pb.CreateEntryRequest{
Directory: fullEntry.Dir,
Entry: fullEntry.Entry,