[PATCH 2/4] Properly register session with utmp.

Matthieu Herrb matthieu.herrb at laas.fr
Tue Aug 9 02:23:01 PDT 2011


On Mon, Aug 08, 2011 at 10:14:37PM +0200, Mark Kettenis wrote:
> > Date: Mon, 08 Aug 2011 12:57:45 -0700
> > From: Alan Coopersmith <alan.coopersmith at oracle.com>
> > 
> > On 08/08/11 12:45, Mark Kettenis wrote:
> > >> From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl at redhat.com>
> > >> Date: Mon,  8 Aug 2011 21:26:48 +0200
> > >>
> > >> I guess we should have corresponding sessreg -d call in config/TakeConsole
> > >> as well, right?
> > >>
> > >> diff --git a/config/GiveConsole b/config/GiveConsole
> > >> index f8a8c6d..d201a5c 100644
> > >> --- a/config/GiveConsole
> > >> +++ b/config/GiveConsole
> > >> @@ -7,3 +7,5 @@
> > >>  # causing serious grief.
> > >>  #
> > >>  chown $USER /dev/console
> > >> +exec /usr/bin/sessreg  -a -w "/var/log/wtmp" -u "/var/run/utmp" \
> > >> +        -x "/etc/X11/xdm/Xservers" -l $DISPLAY -h "" $USER
> > > 
> > > $ ls -l /usr/bin/sessreg
> > > ls: /usr/bin/sessreg: No such file or directory
> > > 
> > > Guess that's a NACK.
> > 
> > config/Xstartup.cpp & config/Xreset.cpp already call BINDIR/sessreg
> > so doing the same in another config file should be fine - but it
> > shouldn't be hardcoded to /usr/bin as this patch does.
> 
> Yup, that would indeed work.  And it shouldn't hardcode the pathnames
> for the utmp and wtmp files either.  I wonder though why it is
> necessary to specify those pathnames at all.  Doesn't sessreg already
> do the right thing if you don't specify them?
> 
> I'm also not sure if the writing to the utmp file is desired here.
> For OpenBSD Matthieu Herb added the following line to GiveConsole:
> 
> /usr/X11R6/bin/sessreg -a -l $DISPLAY -u none -x /usr/X11R6/lib/X11/xdm/Xservers $USER
> 
> So he specifically chose to *not* log to the utmp file on OpenBSD.
> 
> Matthieu, do you remember why?

I don't exactly remember the reason, so I had a look at CVS history. 
Apparently 11 years ago utmp support for OpenBSD was broken in
sessreg, so this is why explicitely used -u none when merging XFree86
4.0. 

But this would definatly need to be revisited. I'm also really behind
in merging recent xdm versions in OpenBSD because of many conflicts
with our patches to support the privilege separated X server. 

I will revisit this asap when I come back from vacation.

About the patch: I support the general idea of adding back sessreg
calls for DISPLAY 0 (this is what we do in OpenBSD) but I fully agree
that the path should rely on values probed by the configure logic.

I also think the incoherence in the names of the scripts create
confusion. the _0 scripts should be called Xstartup_0 and Xreset_0
instead of trying to describe what they do, since they override the
general Xstartup and Xreset scripts for DISPLAY 0.


> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel

-- 
Matthieu Herrb


More information about the xorg-devel mailing list