Bug 82 - scp: Command not found errors
Summary: scp: Command not found errors
Status: CLOSED INVALID
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: scp (show other bugs)
Version: -current
Hardware: All Other
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-26 09:04 AEDT by steve dum
Modified: 2004-04-14 12:24 AEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description steve dum 2002-01-26 09:04:49 AEDT
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.
Comment 1 Damien Miller 2002-01-26 10:14:22 AEDT
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.
Comment 2 steve dum 2002-01-26 13:47:41 AEDT
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.
Comment 3 Damien Miller 2002-01-26 14:24:20 AEDT
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);
Comment 4 steve dum 2002-01-26 16:51:19 AEDT
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.
Comment 5 Damien Miller 2004-04-14 12:24:17 AEST
Mass change of RESOLVED bugs to CLOSED