From owner-freebsd-questions@FreeBSD.ORG Thu Jul 17 19:21:59 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B021537B401 for ; Thu, 17 Jul 2003 19:21:59 -0700 (PDT) Received: from lifesupport.shutdown.com (dsl092-048-059.sfo2.dsl.speakeasy.net [66.92.48.59]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB7AB43F75 for ; Thu, 17 Jul 2003 19:21:58 -0700 (PDT) (envelope-from llewelly@lifesupport.shutdown.com) Received: (from llewelly@localhost) by lifesupport.shutdown.com (8.11.2/8.11.2) id h6I2Hb203845; Thu, 17 Jul 2003 19:17:37 -0700 (PDT) To: freebsd-questions@freebsd.org References: <44d6g989za.fsf@be-well.ilk.org> From: LLeweLLyn Reese Date: 17 Jul 2003 19:17:35 -0700 In-Reply-To: <44d6g989za.fsf@be-well.ilk.org> Message-ID: Lines: 50 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit cc: "Gerald S. Stoller" Subject: Re: xterm X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 02:22:00 -0000 Lowell Gilbert writes: > "Gerald S. Stoller" writes: > > > FreeBSD 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Sat Apr 21 10:54:49 GMT 2001 > > jkh@narf.osd.bsdi.com:/usr/src/sys/compile/GENERIC i386 > > > > When working in a Unix system, I like to work with several > > windows (if possible) and organize my work among them. I use xterm > > (as on the line 'xterm &') to open new windows. Recently, I wanted > > to check on my processes and issued the command 'ps -l' and was > > surprised to not find any xterm processes among them. So I issued > > the command 'ps -la' and there I found the xterm processes but they > > were owned by root , not by me who had issued the command. Even > > though I wasn’t listed *by the ‘ps –la’ command as the > > owner, I could still kill the xterm processes. I don’t know > > where the incongruity is, in the kernel’s tables or in the > > reporting by ps . > > > > In multi-user (commercial) systems, I believe that the user > > who invokes the xterm processes is (listed as) its owner. > > I prefer that all processes running in FreeBSD be owned by > > the user who invoked them, the exceptions being some system ( root ) > > processes used in the login process. (The xterm processes are > > included here as non-system processes, so they should be owned by the > > user who invoked them.) I would like to see FreeBSD changed to > > reflect this, but the bug reporting site is down now. If anyone knows > > of any reasons why the current operation is correct and should be left > > as is, please inform me. > > xterm is suid-root, because it needs to open a terminal. The *shell* > running in the xterm should be owned by the user, but the user doesn't > have sufficient permissions for opening the terminal. > > I believe you're wrong about X behaving otherwise on other Unix > systems. [snip] I'm seeing rxvt processes started by uid 1001 showing up as uid 1001 with ps -l and ps -la. (xterm behaves as you describe, however). So I don't think that's the whole story. Also, I don't see why a program needing a terminal couldn't suid root, chown the terminal, and then suid original user. (I note the TT field of all my xterms shows up as '??', but the tty indicated by the TT field of my rxvt processes is owned by the user that started the rxvt.) I don't pretend to know precisely why any of this, however.