mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
replace hand-written slice utilities with methods from slices package
SFTPGo depends on Go 1.22 so we can use slices package Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -221,9 +221,9 @@ func (c *Connection) Filelist(request *sftp.Request) (sftp.ListerAt, error) {
|
||||
}
|
||||
modTime := time.Unix(0, 0)
|
||||
if request.Filepath != "/" {
|
||||
lister.Add(vfs.NewFileInfo("..", true, 0, modTime, false))
|
||||
lister.Prepend(vfs.NewFileInfo("..", true, 0, modTime, false))
|
||||
}
|
||||
lister.Add(vfs.NewFileInfo(".", true, 0, modTime, false))
|
||||
lister.Prepend(vfs.NewFileInfo(".", true, 0, modTime, false))
|
||||
return lister, nil
|
||||
case "Stat":
|
||||
if !c.User.HasPerm(dataprovider.PermListItems, path.Dir(request.Filepath)) {
|
||||
|
||||
Reference in New Issue
Block a user