mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
Better yet, look for sftp-server on the user's PATH as well, which
allows individual users with shell access to install it without reference to the admin. [originally from svn r1229]
This commit is contained in:
parent
cb1aa5d0f3
commit
6dacf35120
23
psftp.c
23
psftp.c
@ -1513,26 +1513,23 @@ int main(int argc, char *argv[])
|
|||||||
* Set up fallback option, for SSH1 servers or servers with the
|
* Set up fallback option, for SSH1 servers or servers with the
|
||||||
* sftp subsystem not enabled but the server binary installed
|
* sftp subsystem not enabled but the server binary installed
|
||||||
* in the usual place. We only support fallback on Unix
|
* in the usual place. We only support fallback on Unix
|
||||||
* systems, and we use the kludgy command string
|
* systems, and we use a kludgy piece of shellery which should
|
||||||
|
* try to find sftp-server in various places (the obvious
|
||||||
|
* systemwide spots /usr/lib and /usr/local/lib, and then the
|
||||||
|
* user's PATH) and finally give up.
|
||||||
*
|
*
|
||||||
* if test ! -x /usr/lib/sftp-server -a -x /usr/local/lib/sftp-server
|
* test -x /usr/lib/sftp-server && exec /usr/lib/sftp-server
|
||||||
* then
|
* test -x /usr/local/lib/sftp-server && exec /usr/local/lib/sftp-server
|
||||||
* exec /usr/local/lib/sftp-server
|
* exec sftp-server
|
||||||
* else
|
|
||||||
* exec /usr/lib/sftp-server
|
|
||||||
* fi
|
|
||||||
*
|
*
|
||||||
* the idea being that this will attempt to use either of the
|
* the idea being that this will attempt to use either of the
|
||||||
* obvious pathnames and then give up, and when it does give up
|
* obvious pathnames and then give up, and when it does give up
|
||||||
* it will print the preferred pathname in the error messages.
|
* it will print the preferred pathname in the error messages.
|
||||||
*/
|
*/
|
||||||
cfg.remote_cmd_ptr2 =
|
cfg.remote_cmd_ptr2 =
|
||||||
"if test ! -x /usr/lib/sftp-server -a -x /usr/local/lib/sftp-server\n"
|
"test -x /usr/lib/sftp-server && exec /usr/lib/sftp-server\n"
|
||||||
"then\n"
|
"test -x /usr/local/lib/sftp-server && exec /usr/local/lib/sftp-server\n"
|
||||||
" exec /usr/local/lib/sftp-server\n"
|
"exec sftp-server";
|
||||||
"else\n"
|
|
||||||
" exec /usr/lib/sftp-server\n"
|
|
||||||
"fi";
|
|
||||||
cfg.ssh_subsys2 = FALSE;
|
cfg.ssh_subsys2 = FALSE;
|
||||||
|
|
||||||
back = &ssh_backend;
|
back = &ssh_backend;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user