diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-04-15 10:53:04 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-04-15 10:53:04 -0700 |
| commit | 609e228578ff0e678aea7eab3c815dd28bc6e72a (patch) | |
| tree | d6e3f8e2123c46ccc1aa2ee6524dbd73eac50420 /weed/shell/command_fs_meta_save.go | |
| parent | ba92f2e7148108c362379f266a6292401b82b90c (diff) | |
| download | seaweedfs-609e228578ff0e678aea7eab3c815dd28bc6e72a.tar.xz seaweedfs-609e228578ff0e678aea7eab3c815dd28bc6e72a.zip | |
avoid forward slash in file names
Diffstat (limited to 'weed/shell/command_fs_meta_save.go')
| -rw-r--r-- | weed/shell/command_fs_meta_save.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/weed/shell/command_fs_meta_save.go b/weed/shell/command_fs_meta_save.go index d154fc12b..37d94fe42 100644 --- a/weed/shell/command_fs_meta_save.go +++ b/weed/shell/command_fs_meta_save.go @@ -6,6 +6,7 @@ import ( "io" "os" "path/filepath" + "strings" "sync" "sync/atomic" "time" @@ -89,6 +90,7 @@ func (c *commandFsMetaSave) Do(args []string, commandEnv *CommandEnv, writer io. ext := filepath.Ext(entry.Entry.Name) if encrypted, encErr := util.Encrypt([]byte(entry.Entry.Name), cipherKey); encErr == nil { entry.Entry.Name = util.Base64Encode(encrypted)[:len(entry.Entry.Name)] + ext + entry.Entry.Name = strings.ReplaceAll(entry.Entry.Name, "/", "x") } } bytes, err := proto.Marshal(entry) |
