修复unzip功能在用户数据目录和程序运行目录不同级时会找不到文件的问题
This commit is contained in:
parent
56c27c0090
commit
9fb103aee1
@ -303,7 +303,6 @@ func patchAction(ctx context.Context, action, src, dst string, d *data, fileCach
|
||||
if !d.user.Perm.Create {
|
||||
return errors.ErrPermissionDenied
|
||||
}
|
||||
|
||||
return fileutils.Copy(d.user.Fs, src, dst)
|
||||
case "rename":
|
||||
if !d.user.Perm.Rename {
|
||||
@ -335,12 +334,8 @@ func patchAction(ctx context.Context, action, src, dst string, d *data, fileCach
|
||||
if !d.user.Perm.Unzip {
|
||||
return errors.ErrPermissionDenied
|
||||
}
|
||||
if strings.HasPrefix(src, "/") {
|
||||
src = "." + src
|
||||
}
|
||||
if strings.HasPrefix(dst, "/") {
|
||||
dst = "." + dst
|
||||
}
|
||||
src = d.user.FullPath(src)
|
||||
dst = d.user.FullPath(dst)
|
||||
return archiver.Unarchive(src, dst)
|
||||
default:
|
||||
return fmt.Errorf("unsupported action %s: %w", action, errors.ErrInvalidRequestParams)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user