From owner-freebsd-stable@FreeBSD.ORG Mon Jan 25 03:54:10 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 1A8471065672 for ; Mon, 25 Jan 2010 03:54:10 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-qy0-f201.google.com (mail-qy0-f201.google.com [209.85.221.201]) by mx1.freebsd.org (Postfix) with ESMTP id BC1798FC15 for ; Mon, 25 Jan 2010 03:54:09 +0000 (UTC) Received: by qyk39 with SMTP id 39so1713177qyk.27 for ; Sun, 24 Jan 2010 19:54:09 -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=Je32P3fsBsMhfA8KQIEHoQuBkjr5+ocjgaU1q8sJjPk=; b=kzjXSy3bW+K8CVWi32Ktqb/nkORqp8nyjXCN9Cq/fCgk92sdPy7/H/djNKQ2ShMWIP 0qWzWZ3vItK0lyGUPxjUrpLtrN/OhVIWqnl3To3Vtr8awDdIap6Ym1oekfrCnidB0Lfh TFKXDBb5W5Px4/W0ea7n11lHIvtDw8ya9U0FU= 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=vv1kfr5eHvQ1KshjCyIAuIHZT4khf2lJTNqL/KpbCPOhEy1UIAeP9cRCEeMAqnqjH5 PQP0p68gKbDcl64BIRBdGBnxjVRav+A4/9pTlf8hYGbyEQvcuvI7qgPh6Ph+kKdMkHRv BTo8tv6auTIDoJAZGXwAkGVhToKlVwSXvnfvc= Received: by 10.224.7.82 with SMTP id c18mr3049861qac.317.1264391649012; Sun, 24 Jan 2010 19:54:09 -0800 (PST) Received: from centel.dataix.local (ppp-21.20.dialinfree.com [209.172.21.20]) by mx.google.com with ESMTPS id 7sm10933583qwf.4.2010.01.24.19.54.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 24 Jan 2010 19:54:07 -0800 (PST) Sender: "J. Hellenthal" Date: Sun, 24 Jan 2010 22:53:47 -0500 From: jhell To: Glen Barber In-Reply-To: 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:54:10 -0000 On Sun, 24 Jan 2010 22:48, jhell@ wrote: > > 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. > If you mean for the program to appropriately append or overwrite to a file you should ( su user -c 'date >output 2>&1' ) instead >> >> 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