mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
remove rsync support
rsync was executed as an external command, which means we have no insight into or control over what it actually does. From a security perspective, this is far from ideal. To be clear, there's nothing inherently wrong with rsync itself. However, if we were to support it properly within SFTPGo, we would need to implement the low-level protocol internally rather than relying on launching an external process. This would ensure it works seamlessly with any storage backend, just as SFTP does, for example. We recommend using one of the many alternatives that rely on the SFTP protocol, such as rclone Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -876,27 +876,6 @@ func (u *User) HasAnyPerm(permissions []string, path string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// HasRecursivePerms returns true if the user has all the specified permissions
|
||||
// in the given folder and in every subfolder that has explicit permissions
|
||||
// defined.
|
||||
func (u *User) HasRecursivePerms(permissions []string, virtualPath string) bool {
|
||||
if !u.HasPerms(permissions, virtualPath) {
|
||||
return false
|
||||
}
|
||||
for dir, perms := range u.Permissions {
|
||||
if len(dir) > len(virtualPath) {
|
||||
if strings.HasPrefix(dir, virtualPath+"/") {
|
||||
for _, permission := range permissions {
|
||||
if !slices.Contains(perms, permission) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// HasPerms returns true if the user has all the given permissions
|
||||
func (u *User) HasPerms(permissions []string, path string) bool {
|
||||
perms := u.GetPermissionsForPath(path)
|
||||
|
||||
Reference in New Issue
Block a user