From owner-freebsd-hackers Tue May 20 11:33:15 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id LAA17970 for hackers-outgoing; Tue, 20 May 1997 11:33:15 -0700 (PDT) Received: from jocki.domestic.de (kuebart.stuttgart.netsurf.de [194.233.216.182]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id LAA17965 for ; Tue, 20 May 1997 11:33:09 -0700 (PDT) Received: (from joki@localhost) by jocki.domestic.de (8.8.5/8.8.5) id UAA06937; Tue, 20 May 1997 20:33:03 +0200 (CEST) Message-ID: X-Mailer: XFMail 1.0 [p0] on FreeBSD Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Tue, 20 May 1997 20:17:15 +0200 (CEST) From: Joachim Kuebart To: Joachim Kuebart Subject: RE: xdm and login.conf Cc: FreeBSD Hackers Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On 20-May-97 at 00:20:58 Joachim Kuebart wrote: >HI! > >I am now using FreeBSD 2.2.2-RELEASE (or is it 2.2-STABLE, jkh? :-) > >I wonder if anyone has included support for /etc/login.conf in xdm´s login >widget, xlogin? > >If so, would be nice to use the code. If not, I´ll see into it myself ... > Hey guys, you´re too slow. I solved the problem (for me) by calling setusercontext from the global Xsession. All programs of a session are childs to this process (I hope!). In order to call setusercontext I wrote a small C program which is available from me. For those who are interested: setusercontext.c calls setusercontext() to get the same permissions and limits and environment variables as the user needs. It then execve()´s a shell (/bin/sh) with those privileges. This shell is the shell that xdm uses to run Xsession. When the shell terminates, the session is finished. In order to do this with the least possible overhead I have set the interpreter for Xsession to setusercontext, i.e.: /usr/X11R6/lib/X11/xdm/Xsession: #!/usr/local/bin/setusercontext # # Rest of Xsession follows cu Jo --------------------------------------------------------------------- FreeBSD - top breeders recommend it Joachim Kuebart Tel: +49 711 653706 Germany