xdm-config for :0 doesn't call Xstartup?

IL Ka kazakevichilya at gmail.com
Mon Oct 19 07:49:43 UTC 2020


This is my private laptop, and "w" works when I add sessreg to the
GiveConsole.

As far as I understand, the problem is resource "startup" overridden for
display 0, because of concrete value that has more precedence than wildcard.

DisplayManager*startup:         /usr/lib64/X11/xdm/Xstartup
DisplayManager._0.startup:      /usr/lib64/X11/xdm/GiveConsole

I wrote a small tool to check my guess.

#include <stdio.h>
#include <X11/Xresource.h>

int main(int argc, char* argv[])
{
        char *type;
        XrmValue display0, display1;
        XrmDatabase xrdb = XrmGetFileDatabase("/etc/X11/xdm/xdm-config");
        XrmGetResource(xrdb, "DisplayManager._0.startup", "*", &type,
&display0);
        XrmGetResource(xrdb, "DisplayManager._1.startup", "*", &type,
&display1);
        printf("0: %s\n1: %s\n", display0.addr, display1.addr);
        XrmDestroyDatabase(xrdb);
        return 0;
}

It's output is:
0: /usr/lib64/X11/xdm/GiveConsole
1: /usr/lib64/X11/xdm/Xstartup

So, for the _0 we have only GiveConsole, and it doesn't have anything about
sessreg.
https://github.com/freedesktop/xdm/blob/master/config/GiveConsole

Ilya.


On Mon, Oct 19, 2020 at 7:40 AM Chris Sorenson <csoren at isd.net> wrote:

> Those snippets from your scripts look correct, is your sessreg set to
> executable?
>
> Does anyone else have access to your system?
>
> Might it have been hacked to prevent programs like "w," "who," or
> "lastlog" from showing that someone's ghosted in for nefarious purposes?
>
> >
> > On 10/18/2020 05:11 PM, IL Ka wrote:
> >
> > >
> > > On Sun, Oct 18, 2020 at 5:35 PM Chris Sorenson <csoren at isd.net> wrote:
> > >
> >
> > Hello.
> >
> > >
> > > xdm runs Xstartup on behalf of the user.
> > >
> >
> > Hmm.. man page says: "After the user logs in, xdm runs the Xstartup
> > script
> > as root.".
> >
> > There is a $USER argument passed to this script, but the script itself
> > runs
> > as root.
> >
> > >
> > > What does your Xstartup say?
> > >
> >
> > exec /usr/bin/sessreg  -a -w /var/log/wtmp -u /var/run/utmp -x
> > /usr/lib64/X11/xdm/Xservers -l $DISPLAY -h "" $USER
> >
> > I am pretty sure the problem is the following line in xdm-config:
> >
> > DisplayManager*startup: /usr/lib64/X11/xdm/Xstartup
> > ! The following three resources set up display :0 as the console.
> > DisplayManager._0.startup: /usr/lib64/X11/xdm/GiveConsole
> >
> > GiveConsole is:
> > chown $USER /dev/console
> >
> > So, sessreg is simply not called when xdm serves screen :0
> >
> > I was able to fix it by copying sessreg line to the GiveConsole, but it
> > looks like a strange hack..
> > Ilya
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg/attachments/20201019/9d1f8928/attachment.htm>


More information about the xorg mailing list