From owner-freebsd-standards@FreeBSD.ORG Fri Jan 29 08:02:38 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 73256106566B; Fri, 29 Jan 2010 08:02:38 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id ED4E98FC12; Fri, 29 Jan 2010 08:02:37 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id o0T82AHn050044; Fri, 29 Jan 2010 09:02:26 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id o0T829sd050043; Fri, 29 Jan 2010 09:02:09 +0100 (CET) (envelope-from olli) Date: Fri, 29 Jan 2010 09:02:09 +0100 (CET) Message-Id: <201001290802.o0T829sd050043@lurza.secnetix.de> From: Oliver Fromme To: freebsd-standards@FreeBSD.ORG, cyrille.lefevre-lists@laposte.net, jhell@DataIX.net, freebsd-stable@FreeBSD.ORG, glen.j.barber@gmail.com In-Reply-To: <4B6228EF.5050400@laposte.net> X-Newsgroups: list.freebsd-standards User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Fri, 29 Jan 2010 09:02:26 +0100 (CET) Cc: 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 08:02:38 -0000 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. ;-) Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead." -- RFC 1925