| David Mathog 2005-06-17, 5:53 pm |
| David Mathog wrote:
> Now the odd part: this modified rsh works just fine for root but for any
> other user the rcmd call works once (for the first host) and
> then gives a
>
> rcmd: socket: Permission denied
>
> when it attempts a second rcmd call.
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
mathog@caltech.edu
|