repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
dc6a7d0
parent
091a675
author
Antonio Mika
date
2023-11-09 14:56:37 +0000 UTC
Fix sftp
1 files changed,  +7, -3
M wish/send/sftp/handler.go
+7, -3
 1@@ -40,6 +40,8 @@ func (f *handler) Filecmd(r *sftp.Request) error {
 2 		_, err := f.writeHandler.Write(f.session, entry)
 3 
 4 		return err
 5+	case "Setstat":
 6+		return nil
 7 	}
 8 	return errors.New("unsupported")
 9 }
10@@ -54,9 +56,11 @@ func (f *handler) Filelist(r *sftp.Request) (sftp.ListerAt, error) {
11 			return nil, err
12 		}
13 
14-		listData = slices.DeleteFunc(listData, func(f os.FileInfo) bool {
15-			return f.Name() == "/"
16-		})
17+		if r.Filepath != "/" {
18+			listData = slices.DeleteFunc(listData, func(f os.FileInfo) bool {
19+				return f.Name() == "/"
20+			})
21+		}
22 
23 		return listerat(listData), nil
24 	}