mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-08 00:04:21 +01:00
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
399a38893e
commit
d7f790755e
2 changed files with 10 additions and 0 deletions
|
|
@ -141,6 +141,14 @@ func copyFile(c *gin.Context) {
|
|||
}
|
||||
|
||||
dest := arg["dest"].(string)
|
||||
if util.IsSensitivePath(dest) {
|
||||
msg := fmt.Sprintf("refuse to copy sensitive file [%s]", dest)
|
||||
logging.LogErrorf(msg)
|
||||
ret.Code = -2
|
||||
ret.Msg = msg
|
||||
return
|
||||
}
|
||||
|
||||
if err = filelock.Copy(src, dest); err != nil {
|
||||
logging.LogErrorf("copy file [%s] to [%s] failed: %s", src, dest, err)
|
||||
ret.Code = -1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue