From owner-freebsd-stable@FreeBSD.ORG Mon Jan 25 03:49:12 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 211611065670 for ; Mon, 25 Jan 2010 03:49:12 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by mx1.freebsd.org (Postfix) with ESMTP id B9A588FC15 for ; Mon, 25 Jan 2010 03:49:11 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 5so174729qwd.7 for ; Sun, 24 Jan 2010 19:49:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=mRp940PYNrO970YC529oAuOgcMJb32rpR7obzN+sFjk=; b=QgXJz1sbgQM+WH53FFyOh4UhoxeuWJDEki/pDbWUFoRVg8muxWMsjEYDnemOHNNZUw DjmVrfS4t8QF01/I1V/jdpnGPfHmIOgtlgSKbMwyuW6YNeTbV2EJLbFOC4B6+R+Vdyhm Pf9AEeb+L63XG8+eBYIPKsH8jAAIptt8No7zY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=HJL0lmW95IlPrvERMT1HdL7a2a1syt8kCx4Y71utZNyy0zCBTE+fgjkAIJ7/YjqqzL dHCseEXFAIULwK3m6XFoz4tUQ7p3u+s5l5R0OlyT+b/HmqJIVXkrV2sKapE7YOC5BDQl 6d0l2fiLxRBypAbVtgBizndc90GeIS1JSiJzc= Received: by 10.224.49.10 with SMTP id t10mr2438519qaf.102.1264391350849; Sun, 24 Jan 2010 19:49:10 -0800 (PST) Received: from centel.dataix.local (ppp-21.20.dialinfree.com [209.172.21.20]) by mx.google.com with ESMTPS id 8sm16439858qwj.53.2010.01.24.19.49.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 24 Jan 2010 19:49:09 -0800 (PST) Sender: "J. Hellenthal" Date: Sun, 24 Jan 2010 22:48:44 -0500 From: jhell To: Glen Barber In-Reply-To: <20100125025744.GA94378@orion.hsd1.pa.comcast.net> Message-ID: References: <4B5CEC53.3090402@laposte.net> <20100125025744.GA94378@orion.hsd1.pa.comcast.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-stable@freebsd.org Subject: Re: su password prompt ti stdout instead of /dev/tty X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2010 03:49:12 -0000 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