Bug in su (?)

Kartik Subbarao subbarao at phoenix.Princeton.EDU
Thu May 30 11:07:48 AEST 1991


In article <1086 at eplunix.UUCP> mrn at eplunix.UUCP (Mark R. Nilsen) writes:
>I hope this posting is relevent here.  I do not regularly read this group.
>I have encountered a problem when using su with rsh.  This is what happens.
>
>I type from one of our vaxen:
>
>	rsh earlobe su
>
>I get:
>
>	Password:
>
>I start typing and my keystrokes are echoed!!
>
>If noone is looking over my shoulder and I type the correct password
>I get stuck in a very strange state.  I can do everything I want, 
>but I have no visible prompt.  The environment variable says my

Relax. There's no bug in su. The reason that you're seeing echoing is 
because there's no way to turn it off. when you say 'rsh foo su', the
rsh process is not associated with a tty on machine foo, therefore when
getpass() tries to ioctl() a tty, it can't find one, so things are echoed.
As to the shell after that, since isatty(0) is not true, it assumes that
it's not interactive and therefore does not print a prompt. (right, there's
no need to print a prompt in the general case if input is not from a tty).
If you wanted a prompt, all you have to say is 'rsh foo su -c "csh -i"', or
whatever your favorite shell is. Realize now that you won't be able to
interactively edit something via 'vi' or the likes. If you want a tty in the 
first place, you can have a kludge by saying say 'rsh foo pty -d su', if
you have Dan Bernstein's pty program. This, however, is not a really clean
approach, and if you want a darn tty in the first place, then you might as
well rlogin to the machine, get a shell, then su from the shell.

>"To skilled assembly language	      |	Mark Nilsen.	
>programmers, the 8088 is perhaps the  |
>most wonderful processor ever	      |	mrn%eplunix.UUCP at eddie.mit.edu	
>created, ..."-Dr Dobb's Journal, 3/91 |

Nah. It's not CISCy enough. The M680*0 series is a lot more nicer. Gotta
love that BFEXTU instruction!


			-Kartik


--
internet% whoami

subbarao at phoenix.Princeton.EDU -| Internet
kartik at silvertone.Princeton.EDU (NeXT mail)  
SUBBARAO at PUCC.BITNET			          - Bitnet



More information about the Comp.unix.admin mailing list