su password prompt ti stdout instead of /dev/tty

Cyrille Lefevre cyrille.lefevre-lists at laposte.net
Mon Jan 25 09:33:54 UTC 2010


Glen Barber a écrit :
> Hi,
> 
> Cyrille Lefevre wrote: 
>> Hi,
>>
>> su password prompt is displayed to *stdout* instead of */dev/tty*.
>>
>> # su user
>> $ su root -c date > /tmp/date 2>&1
>> (nothing displayed)
>> $ cat /tmp/date
>> Password:su: Sorry
>> $ uname -a
>> FreeBSD freebsd8.my.domain 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 
>> 21 15:48:17 UTC 2009 
>> root at almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>>
>> I suppose this is a getpass() problem ?
>>
> 
> I cannot reproduce this.  In fact,
> 
> 	su root -c date > /tmp/date
> 
> hangs waiting for input.

in fact, you exactly reproduce what I want, su hangs for input bcoz the
password prompt is displayed onto stdout, but you don't know it unless
you look at the output file.

> 	orion % su root -c date > /tmp/date 
> 	^C
> 	su: Sorry
> 	orion % less /tmp/date 
> 	Password:
> 	orion % 
> 
> Also, you appear to be running an unpatched version of FreeBSD 8.0,
> subject to the rtld exploit (among a few others).  I'd suggest upgrading.

don't care, it's a vmware guest for testing. thanks anyway.

Regards,

Cyrille Lefevre
-- 
mailto:Cyrille.Lefevre-lists at laposte.net




More information about the freebsd-stable mailing list