From owner-freebsd-standards@FreeBSD.ORG Fri Jan 29 09:17:09 2010 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7506E106566C for ; Fri, 29 Jan 2010 09:17:09 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta06.emeryville.ca.mail.comcast.net (qmta06.emeryville.ca.mail.comcast.net [76.96.30.56]) by mx1.freebsd.org (Postfix) with ESMTP id 594C88FC21 for ; Fri, 29 Jan 2010 09:17:09 +0000 (UTC) Received: from omta03.emeryville.ca.mail.comcast.net ([76.96.30.27]) by qmta06.emeryville.ca.mail.comcast.net with comcast id bM3T1d0010b6N64A6M40sN; Fri, 29 Jan 2010 09:04:00 +0000 Received: from koitsu.dyndns.org ([98.248.46.159]) by omta03.emeryville.ca.mail.comcast.net with comcast id bM3y1d0053S48mS8PM3zky; Fri, 29 Jan 2010 09:03:59 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id C81011E3033; Fri, 29 Jan 2010 01:03:57 -0800 (PST) Date: Fri, 29 Jan 2010 01:03:57 -0800 From: Jeremy Chadwick To: Oliver Fromme Message-ID: <20100129090357.GA38872@icarus.home.lan> References: <4B6228EF.5050400@laposte.net> <201001290802.o0T829sd050043@lurza.secnetix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201001290802.o0T829sd050043@lurza.secnetix.de> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: jhell@DataIX.net, freebsd-standards@FreeBSD.ORG, freebsd-stable@FreeBSD.ORG, glen.j.barber@gmail.com Subject: Re: su password prompt to stdout instead of /dev/tty X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2010 09:17:09 -0000 On Fri, Jan 29, 2010 at 09:02:09AM +0100, Oliver Fromme wrote: > Cyrille Lefevre wrote: > > found it, the guilty is prompt() in > > src/contrib/openpam/lib/openpam_ttyconv.c and not getpass() as usual... > > Are you sure this affects su(1) only? > > > => fputs(msg, stdout); > > > > which should be, IMHO, something like : > > > > FILE *ttyp; > > ttyp = fopen("/dev/tty", "w") > > if (!stdtty) > > ttyp = isatty(fileno(stderr)) ? stderr : stdout; > > fputs(msg, ttyp); > > > > or, at least : > > > > fputs(msg, stderr); > > As long as it's still possible to easily redirect the prompt > on the command line, it's fine with me. > Right now I can do this in a script: > > echo -n "$myprompt: " ; su $somerole >/dev/null ... > > If that doesn't work anymore, I'll complain. ;-) OpenPAM is des@'s responsibility. Has anyone brought this up to him? -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |