[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 &quot;w&quot; works when I add sessreg \
to the GiveConsole.<div><br></div><div>As far as I understand, the problem is \
resource  &quot;startup&quot; 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 \
&lt;stdio.h&gt;<br></div><div>#include &lt;X11/Xresource.h&gt;<br><br>int main(int \
argc, char* argv[])<br>{<br>            char *type;<br>            XrmValue display0, \
display1;<br>            XrmDatabase xrdb = \
XrmGetFileDatabase(&quot;/etc/X11/xdm/xdm-config&quot;);<br>            \
XrmGetResource(xrdb, &quot;DisplayManager._0.startup&quot;, &quot;*&quot;, &amp;type, \
&amp;display0);<br>            XrmGetResource(xrdb, \
&quot;DisplayManager._1.startup&quot;, &quot;*&quot;, &amp;type, &amp;display1);<br>  \
printf(&quot;0: %s\n1: %s\n&quot;, display0.addr, display1.addr);<br>            \
XrmDestroyDatabase(xrdb);<br>            return \
0;<br>}<br></div><div><br></div><div><div>It&#39;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&#39;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 &lt;<a href="mailto:csoren@isd.net">csoren@isd.net</a>&gt; \
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 &quot;w,&quot; &quot;who,&quot; or \
<br> &quot;lastlog&quot; from showing that someone&#39;s ghosted in for nefarious \
purposes?<br> <br>
&gt; <br>
&gt; On 10/18/2020 05:11 PM, IL Ka wrote:<br>
&gt; <br>
&gt; &gt;<br>
&gt; &gt; On Sun, Oct 18, 2020 at 5:35 PM Chris Sorenson &lt;<a \
href="mailto:csoren@isd.net" target="_blank">csoren@isd.net</a>&gt; wrote:<br> &gt; \
&gt;<br> &gt; <br>
&gt; Hello.<br>
&gt; <br>
&gt; &gt;<br>
&gt; &gt; xdm runs Xstartup on behalf of the user.<br>
&gt; &gt;<br>
&gt; <br>
&gt; Hmm.. man page says: &quot;After the user logs in, xdm runs the Xstartup <br>
&gt; script<br>
&gt; as root.&quot;.<br>
&gt; <br>
&gt; There is a $USER argument passed to this script, but the script itself <br>
&gt; runs<br>
&gt; as root.<br>
&gt; <br>
&gt; &gt;<br>
&gt; &gt; What does your Xstartup say?<br>
&gt; &gt;<br>
&gt; <br>
&gt; exec /usr/bin/sessreg   -a -w /var/log/wtmp -u /var/run/utmp -x<br>
&gt; /usr/lib64/X11/xdm/Xservers -l $DISPLAY -h &quot;&quot; $USER<br>
&gt; <br>
&gt; I am pretty sure the problem is the following line in xdm-config:<br>
&gt; <br>
&gt; DisplayManager*startup: /usr/lib64/X11/xdm/Xstartup<br>
&gt; ! The following three resources set up display :0 as the console.<br>
&gt; DisplayManager._0.startup: /usr/lib64/X11/xdm/GiveConsole<br>
&gt; <br>
&gt; GiveConsole is:<br>
&gt; chown $USER /dev/console<br>
&gt; <br>
&gt; So, sessreg is simply not called when xdm serves screen :0<br>
&gt; <br>
&gt; I was able to fix it by copying sessreg line to the GiveConsole, but it<br>
&gt; looks like a strange hack..<br>
&gt; Ilya<br>
&gt; <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