mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
system commands: recursively verify required permissions
If any permission is missing at any level, return a "Permission Denied" error Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -262,7 +262,7 @@ func (c *sshCommand) executeSystemCommand(command systemCommand) error { //nolin
|
||||
}
|
||||
perms := []string{dataprovider.PermDownload, dataprovider.PermUpload, dataprovider.PermCreateDirs, dataprovider.PermListItems,
|
||||
dataprovider.PermOverwrite, dataprovider.PermDelete}
|
||||
if !c.connection.User.HasPerms(perms, sshDestPath) {
|
||||
if !c.connection.User.HasRecursivePerms(perms, sshDestPath) {
|
||||
return c.sendErrorResponse(c.connection.GetPermissionDeniedError())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user