mirror of
https://github.com/gin-gonic/gin.git
synced 2026-06-06 20:18:19 +08:00
test: improve upload permission coverage
This commit is contained in:
parent
a3e91a0053
commit
ca0bc54ee1
@ -740,9 +740,10 @@ func (c *Context) SaveUploadedFile(file *multipart.FileHeader, dst string, perm
|
|||||||
// Only chmod newly created directories. Attempting to chmod
|
// Only chmod newly created directories. Attempting to chmod
|
||||||
// pre-existing directories (e.g. /tmp) may fail with EPERM.
|
// pre-existing directories (e.g. /tmp) may fail with EPERM.
|
||||||
if !dirExisted {
|
if !dirExisted {
|
||||||
if err = os.Chmod(dir, mode); err != nil {
|
err = os.Chmod(dir, mode)
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
out, err := os.Create(dst)
|
out, err := os.Create(dst)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user