Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Nov 2001 17:03:21 -0500 (EST)
From:      Robert Watson <rwatson@freebsd.org>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        arch@freebsd.org
Subject:   Re: /etc/ttys, /var/run/utmp, ttyslot(3) and {get|put}utx* API 
Message-ID:  <Pine.NEB.3.96L.1011107165935.47747B-100000@fledge.watson.org>
In-Reply-To: <36293.1005168516@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help

On Wed, 7 Nov 2001, Poul-Henning Kamp wrote:

> In message <Pine.NEB.3.96L.1011107074837.14344B-100000@fledge.watson.org>, Robe
> rt Watson writes:
> 
> >> I guess the correct solution is to implement the Single Unix
> >> "{get|put}utx" API backed by a db(3) file. 
> >> 
> >>     http://www.opengroup.org/onlinepubs/007908799/xsh/endutxent.html
> >> 
> >> Any comments ? 
> >
> >"Yet another thread-unsafe API for managing databases"?
> 
> Interesting point, I didn't think of that.  On the other hand, I don't
> see much point in multiple threads competing to fiddle this info since
> they will all have the same session... 

Well, one of the problems with some of the other thread-unsafe APIs is
when they get used by a library.  For example, the ACL spec requires an
acl_to_text() call, which (among other things) converts numeric uid's into
usernames.  The issue here is probably more of one of reentrance than
thread-safety: when acl_to_text() invokes getpwuid(), it may interfere
with the calling program.  It's not impossible to imagine these types of
calls interfering when used in a program such as a kde-ized or gnome-ized
xdm.

> Anyhow, I'm mightily leaning towards the idea that /var/run/utmp should
> die and be moved into the session in the kernel, apart from all the
> obvious things, this would make some interesting information available
> in kernel dumps.

I'm leaning that way also; there are some minor scoping issues, but I
think they can be addressed by caching a struct ucred in the kernel
session when the session is created, or possibly when the information is
updated.  This would allow virtual utmp entries to be ommitted based on
(for example) what jail or MLS compartment the user is in.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Project
robert@fledge.watson.org      NAI Labs, Safeport Network Services



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1011107165935.47747B-100000>