[prev in list] [next in list] [prev in thread] [next in thread]
List: freedesktop-xorg
Subject: Re: xdm-config for :0 doesn't call Xstartup?
From: IL Ka <kazakevichilya () gmail ! com>
Date: 2020-10-19 7:49:43
Message-ID: CAHv=rM3J+OidoKeCjDGJaPqfyfQXj=o_JNWEup2Oa+PGmiUzFw () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
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@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@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
> >
>
>
[Attachment #5 (text/html)]
<div dir="ltr">This is my private laptop, and "w" works when I add sessreg \
to the GiveConsole.<div><br></div><div>As far as I understand, the problem is \
resource "startup" overridden for display 0, because of concrete value \
that has more precedence than \
wildcard.</div><div><br></div><div>DisplayManager*startup: \
/usr/lib64/X11/xdm/Xstartup</div><div>DisplayManager._0.startup: \
/usr/lib64/X11/xdm/GiveConsole<br></div><div><br></div><div>I wrote a small tool to \
check my guess.</div><div><br></div><div>#include \
<stdio.h><br></div><div>#include <X11/Xresource.h><br><br>int main(int \
argc, char* argv[])<br>{<br> char *type;<br> XrmValue display0, \
display1;<br> XrmDatabase xrdb = \
XrmGetFileDatabase("/etc/X11/xdm/xdm-config");<br> \
XrmGetResource(xrdb, "DisplayManager._0.startup", "*", &type, \
&display0);<br> XrmGetResource(xrdb, \
"DisplayManager._1.startup", "*", &type, &display1);<br> \
printf("0: %s\n1: %s\n", display0.addr, display1.addr);<br> \
XrmDestroyDatabase(xrdb);<br> return \
0;<br>}<br></div><div><br></div><div><div>It's output is:</div><div>0: \
/usr/lib64/X11/xdm/GiveConsole<br>1: \
/usr/lib64/X11/xdm/Xstartup<br></div><div><br></div><div></div></div><div>So, for the \
_0 we have only GiveConsole, and it doesn't have anything about \
sessreg.</div><div><a \
href="https://github.com/freedesktop/xdm/blob/master/config/GiveConsole">https://githu \
b.com/freedesktop/xdm/blob/master/config/GiveConsole</a><br></div><div><br></div><div>Ilya.</div><div><br></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 19, 2020 at 7:40 AM \
Chris Sorenson <<a href="mailto:csoren@isd.net">csoren@isd.net</a>> \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Those snippets from \
your scripts look correct, is your sessreg set to <br> executable?<br>
<br>
Does anyone else have access to your system?<br>
<br>
Might it have been hacked to prevent programs like "w," "who," or \
<br> "lastlog" from showing that someone's ghosted in for nefarious \
purposes?<br> <br>
> <br>
> On 10/18/2020 05:11 PM, IL Ka wrote:<br>
> <br>
> ><br>
> > On Sun, Oct 18, 2020 at 5:35 PM Chris Sorenson <<a \
href="mailto:csoren@isd.net" target="_blank">csoren@isd.net</a>> wrote:<br> > \
><br> > <br>
> Hello.<br>
> <br>
> ><br>
> > xdm runs Xstartup on behalf of the user.<br>
> ><br>
> <br>
> Hmm.. man page says: "After the user logs in, xdm runs the Xstartup <br>
> script<br>
> as root.".<br>
> <br>
> There is a $USER argument passed to this script, but the script itself <br>
> runs<br>
> as root.<br>
> <br>
> ><br>
> > What does your Xstartup say?<br>
> ><br>
> <br>
> exec /usr/bin/sessreg -a -w /var/log/wtmp -u /var/run/utmp -x<br>
> /usr/lib64/X11/xdm/Xservers -l $DISPLAY -h "" $USER<br>
> <br>
> I am pretty sure the problem is the following line in xdm-config:<br>
> <br>
> DisplayManager*startup: /usr/lib64/X11/xdm/Xstartup<br>
> ! The following three resources set up display :0 as the console.<br>
> DisplayManager._0.startup: /usr/lib64/X11/xdm/GiveConsole<br>
> <br>
> GiveConsole is:<br>
> chown $USER /dev/console<br>
> <br>
> So, sessreg is simply not called when xdm serves screen :0<br>
> <br>
> I was able to fix it by copying sessreg line to the GiveConsole, but it<br>
> looks like a strange hack..<br>
> Ilya<br>
> <br>
<br>
</blockquote></div>
_______________________________________________
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic