Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jan 2010 09:02:09 +0100 (CET)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-standards@FreeBSD.ORG, cyrille.lefevre-lists@laposte.net, jhell@DataIX.net, freebsd-stable@FreeBSD.ORG, glen.j.barber@gmail.com
Subject:   Re: su password prompt to stdout instead of /dev/tty
Message-ID:  <201001290802.o0T829sd050043@lurza.secnetix.de>
In-Reply-To: <4B6228EF.5050400@laposte.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001290802.o0T829sd050043>