Date: Sun, 24 Jan 2010 22:48:44 -0500 From: jhell <jhell@DataIX.net> To: Glen Barber <glen.j.barber@gmail.com> Cc: freebsd-stable@freebsd.org Subject: Re: su password prompt ti stdout instead of /dev/tty Message-ID: <alpine.BSF.2.00.1001242243460.72774@pragry.qngnvk.ybpny> In-Reply-To: <20100125025744.GA94378@orion.hsd1.pa.comcast.net> References: <4B5CEC53.3090402@laposte.net> <20100125025744.GA94378@orion.hsd1.pa.comcast.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 24 Jan 2010 21:57, glen.j.barber@ wrote: > 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@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >> >> I suppose this is a getpass() problem ? >> This is intended operation as su(1) may not always be affiliated with a TTY. This leaves it open for a script to chat with much like what samba does with its passwd chat mechanism. > > I cannot reproduce this. In fact, > > su root -c date > /tmp/date > > hangs waiting for input. > > orion % su root -c date > /tmp/date > ^C > su: Sorry > orion % less /tmp/date > Password: > orion % > This is essentially what the OP stated was happening except you forgot the 2>&1. > 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. > > For what it's worth: > orion % uname -a > FreeBSD orion 8.0-STABLE FreeBSD 8.0-STABLE #20 r202187: Wed Jan 13 > 11:51:15 EST 2010 root@orion:/usr/obj/usr/src/sys/ORION amd64 > > Regards, > > -- jhell
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1001242243460.72774>