From b971317a167ac806a02947047c65ba6c2a2a7bad Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 15 Apr 2021 11:41:34 -0700 Subject: [PATCH] avoid possible corrupted file names --- weed/shell/command_fs_meta_load.go | 2 ++ 1 file changed, 2 insertions(+) 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,