From owner-freebsd-current Mon Sep 18 13: 4:53 2000 Delivered-To: freebsd-current@freebsd.org Received: from lorax.ubergeeks.com (lorax.ubergeeks.com [209.145.74.241]) by hub.freebsd.org (Postfix) with ESMTP id 843D137B422; Mon, 18 Sep 2000 13:04:45 -0700 (PDT) Received: from localhost (adrian@localhost) by lorax.ubergeeks.com (8.9.3/8.8.8) with ESMTP id QAA26343; Mon, 18 Sep 2000 16:03:14 -0400 (EDT) (envelope-from adrian@ubergeeks.com) Date: Mon, 18 Sep 2000 16:03:14 -0400 (EDT) From: Adrian Filipi-Martin Reply-To: Adrian Filipi-Martin To: Bruce Evans Cc: Ben Smithurst , Poul-Henning Kamp , Peter Pentchev , Julian Elischer , Chris Costello , hackers@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: Fdescfs updates--coming to a devfs near you! In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 19 Sep 2000, Bruce Evans wrote: > On Sun, 17 Sep 2000, Adrian Filipi-Martin wrote: > > > I recently ran into revelant problem with /dev/stdout, while > > working on some software under linux that expected /dev/stdout as an > > argument instead of using stdout. > > > > Using the device file breaks, if the process is suid to a non-root > > user. This is because it cannot open /dev/stdout, which is owned by your > > UID and not the EUID of the process to which the device was passed. My > > solution was to add the "-" hack and use the existing open descriptor. > > Um, open on fdesc devices doesn't check either uid. It just checks > the access mode. > > Perhaps the software expected /dev/stdout to for read-write like a > tty would be. Then opening /dev/stdout would fail for normal shell > output redirection which only opens for writing. No, it wasn't a RW/W issue. I dug a little deeper. It looks like the BSD implmentation of /dev/stdout is smarter than the linux version. Linux's is a symlink into /proc and the device ownership is determined by the UID of the invoking user. I guess I wouldn't have have had a problem under BSD. no suprise here. Adrian -- [ adrian@ubergeeks.com -- Ubergeeks Consulting -- http://www.ubergeeks.com/ ] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message