Skip to content

Commit 9892725

Browse files
committed
Add support for using sftp-server found within PATH
Before trying list of well-known candidates allow detection routine to check if the binary is discoverable inside PATH already. This covers cases for unknown distributions or user built packages, which could be symlinked into `/usr/local/bin` to be discoverable before system packages and Windows, where needed dependencies might have different packaging.
1 parent cedcbf9 commit 9892725

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/reversesshfs/reversesshfs.go

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ func (rsf *ReverseSSHFS) Prepare() error {
6363
}
6464

6565
func DetectOpensshSftpServerBinary() string {
66+
if exe, err := exec.LookPath("sftp-server"); err == nil {
67+
return exe
68+
}
6669
homebrewSSHD := []string{
6770
"/usr/local/sbin/sshd",
6871
"/opt/homebrew/sbin/sshd",

0 commit comments

Comments
 (0)