Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Dec 2023 15:48:19 +0000
From:      bugzilla-noreply@freebsd.org
To:        desktop@FreeBSD.org
Subject:   [Bug 266532] x11/lightdm: Login sessions do not respect login.conf
Message-ID:  <bug-266532-39348-7dEuaiJdrm@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-266532-39348@https.bugs.freebsd.org/bugzilla/>
References:  <bug-266532-39348@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D266532

--- Comment #11 from Ivan Rozhuk <rozhuk.im@gmail.com> ---
This issue also actual for slim and probably other logon managers and tools
that do user logon.

As far I understand FreeBSD logon process a bit more complex than linux, at
least it requires additional syscalls to handle login classes.


To fix this I use "su -l ${USER}" in 2 wrapper scripts:
 1. logon_pre.sh: it save env to XDG_RUNTIME_DIR ("/var/run/user/`id -ur
${USER} | tr -d '\n'`") and run: /usr/bin/su -l "${USER}" -c "env
XDG_RUNTIME_DIR=3D${XDG_RUNTIME_DIR} ${THIS_SCRIPT_DIR}/logon_post.sh ${@}"

 2. logon_post.sh: it save its own env, restore env from firs script, resto=
re
its own env and run Xsession.

To use this you need:
1. save both scripts to /usr/local/etc/lightdm
2. chmod +x them
3. in file /usr/local/etc/lightdm/lightdm.conf replace:
session-wrapper=3D/usr/local/etc/lightdm/Xsession
with
session-wrapper=3D/usr/local/etc/lightdm/logon_pre.sh


Another cool hack:
xmir-command=3D/usr/bin/nice -n -15 /usr/local/bin/Xmir
xserver-command=3D/usr/bin/nice -n -15 /usr/local/bin/X
this increase xorg priority and fix some frizes.


For slim I use for a while:
login_cmd               /usr/bin/su -l ${USER} -c "env XAUTHORITY=3D${XAUTH=
ORITY}
XDG_SESSION_COOKIE=3D${XDG_SESSION_COOKIE} DISPLAY=3D${DISPLAY} ~/.xinitrc
%session"

This is a bit insecure since XDG_SESSION_COOKIE visible via "ps axd".

Ti increase xorg priority:
default_xserver         /usr/bin/nice
xserver_arguments       -n -15 /usr/local/bin/X -nolisten tcp vt09


Hope lightdm and slim maintainers will assimilate these scripts and config
hacks into ports tree.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-266532-39348-7dEuaiJdrm>