First, the FAQ discussion item 3.7 is out of date and needs updated. the 'scp: Command not found' errors seem to typically get generated because the default search path doesn't include /usr/local/bin which is where scp is located. It is fixed by adding /usr/local/bin to one's login setup scripts. Next, the configure --with-default-path suggestion is a bum steer. The option --with-default-path no longer effects the makefiles, header files or source code. It did in Version 1.x but certianly its gone from 3.x and later 2.x's. This option should be removed from configure, since it's no longer used.
The --with-default-path option most certainly does work. You probably have some environment or shell initialisation which is clobbering your $PATH env var. I don't see how the FAQ is out of date.
Yes, in 3.0.2p1 it causes USER_PATH to be defined in config.h. However, it's not used in any of the code. The old behavior, e.g. 1.2.3, when USER_PATH was defined, it caused _PATH_STDPATH to be defined (in config.h). This in turn was used by sshd.c in a call to child_set_env(...) to set it in the environment. That code isn't there any longer. More important, it looks like sshd forks off a user's shell to execute the scp command, so now we are stuck with the system default settings for PATH, and as you point out, what the user's local initialization code does. So even if --with-default-path did work, it would be overridden, making the advice of the FAQ not very helpful.
Please read the code. From defines.h: #ifdef USER_PATH # ifdef _PATH_STDPATH # undef _PATH_STDPATH # endif # define _PATH_STDPATH USER_PATH #endif From session.c: child_set_env(&env, &envsize, "PATH", _PATH_STDPATH);
Apologies, your right. The FAQ should be updated to indicate that another reason this error occurs is if ones shell initialiation excludes the directory that scp is in from the PATH variable.
Mass change of RESOLVED bugs to CLOSED