Subject: Re: xterm tty ownership
To: Christos Zoulas <christos@zoulas.com>
From: Gary Duzan <gary@duzan.org>
List: current-users
Date: 07/04/2007 10:06:49
In Message <20070704015039.720C956542@rebar.astron.com> ,
   christos@zoulas.com (Christos Zoulas) wrote:

=>On Jul 3,  9:23pm, gary@duzan.org (Gary Duzan) wrote:
=>-- Subject: Re: xterm tty ownership
=>
=>| In Message <f6dt3m$jnj$1@sea.gmane.org> ,
=>|    christos@astron.com (Christos Zoulas) wrote:
=>| 
=>| =>In article <200707031140.l63BeOUo028090@wheel.duzan.org>,
=>| =>Gary Duzan  <gary@duzan.org> wrote:
=>| =>>   For a couple weeks I've been getting:
=>| =>>
=>| =>>utmp_update: /dev/ttyp?: Is not owned by you
=>
=>The ? is the real tty letter I take it [0-9a-f];

   Correct.

=>| -r-xr-xr-x  1 root  wheel  351522 Jul  1 13:09 /usr/X11R6/bin/xterm*
=>| -r-sr-xr-x  1 root  wheel  11702 Jul  1 12:01 /usr/libexec/utmp_update*
=>| 
=>| =>Did you compile your kernel with COMPAT_BSDPTY?
=>| 
=>| options		COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
=>| 
=>| =>ls -l /dev/ptm*
=>| 
=>| crw-rw-rw-  1 root  wheel  165, 1 Dec  8  2004 /dev/ptm
=>| crw-rw-rw-  1 root  wheel  165, 0 Dec  8  2004 /dev/ptmx
=>| 
=>|    If it helps, I am running with one big LFS for everything, I
=>| have some debugging turned on in the kernel, and I'm running amd64.
=>
=>That all looks fine, but what is the permission of the pty before xterm
=>opens it?

===========================================================================
capo { ~ } % ls -l /dev/?ty?? > foo
capo { ~ } % xterm &
[1] 5842
capo { ~ } % ls -l /dev/?ty?? > bar
capo { ~ } % 
[1]    Done                          xterm
capo { ~ } % ls -l /dev/?ty?? > blah
capo { ~ } % diff foo bar
284c284
< crw-rw-rw-  1 root  wheel    5,      7 Jul  4 09:57 /dev/ttyp7
---
> crw-rw-rw-  1 root  wheel    5,      7 Jul  4 09:58 /dev/ttyp7
capo { ~ } % diff bar blah
284c284
< crw-rw-rw-  1 root  wheel    5,      7 Jul  4 09:58 /dev/ttyp7
---
> crw-rw-rw-  1 root  wheel    5,      7 Jul  4 09:59 /dev/ttyp7
capo { ~ } % 
===========================================================================

   ttyp7 was the tty for the xterm.

					Gary Duzan