[comp.bugs.4bsd] 4.3 rcp dies if /usr/ucb is not in path

whm@arizona.edu (Bill Mitchell) (05/04/87)

Under certain circumstances, rcp executes rsh.  If /usr/ucb is not in
the search path, you'll get the diagnostic "sh: rsh: not found", which
can be pretty mysterious.  You can reproduce this by (in sh):

	PATH=. /bin/rcp h:/a h:/b

This bug was discovered when trying to run rcp via cron.

The problem is that rsh is being located using path search rather than
being named explicitly.  There might be a good reason to use the path
search, but I can't think of one.  If you want rcp to always run /usr/ucb/rsh,
just change the two occurrences of "rsh" to "/usr/ucb/rsh" in rcp.c.

Incidentally, there's a setuid() to change back to the user's uid before rsh
is fired up, so the path search doesn't present a security hole.

					Bill Mitchell
					whm@arizona.edu
					{allegra,cmcl2,ihnp4,noao}!arizona!whm