program calls rcmd() twice, _second_ call works for root but not normal users

program calls rcmd() twice, _second_ call works for root but not normal users

Post by David Math » Sun, 19 Jun 2005 02:26:18



I figured it out. Carried over from the original inetutils/rsh.c
code were two lines

seteuid (uid);
setuid (uid);

just before the signal stuff was set up but after the rcmd() call.
All of this was within the loop over target hosts. Removing these
two lines fixed the problem so that any user could run multiple
rcmd(). It's not clear to me what the purpose of these lines was
in the first place since rsh runs perfectly well without it in the
limited tests I performed.

On the other hand,

rsh -l someotheruser targetnode 'ls'

apparently doesn't work with either my modified code or with
the original code. It just hangs on the sending machine. My
code is based on inetutils 1.4.2


Thanks,

David Mathog
XXXX@XXXXX.COM