mrrl-logincaps

MRRL version of logincaps
git clone https://ccx.te2000.cz/git/mrrl-logincaps
Log | Files | Refs

commit b729952bf6f969fdf4c38afd0562b24245dd43b5
parent bcd149b097c5af051ab11d0731d74b8306be4e51
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date:   Wed, 29 May 2019 03:25:00 +0200

Enable the X11 capability
Diffstat:
Msbin/logincaps | 46++++++++++++++++++++++++----------------------
1 file changed, 24 insertions(+), 22 deletions(-)

diff --git a/sbin/logincaps b/sbin/logincaps @@ -20,34 +20,36 @@ cleanup() { s6-svc -d /run/service/X$X fi } +typeset -f -t cleanup run_x() { (($+X)) || return 1 [[ $X == $1 ]] || return 2 shift - pretendrun s6-svc -wU -o /run/service/X$X - pretendrun truncate -s 0 /run/Xauthority.$X - pretendrun chmod 600 /run/Xauthority.$X - pretendrun chown $USER /run/Xauthority.$X - pretendrun cat /run/service/X$X/data/Xauthority \> /run/Xauthority.$X - pretendrun env XSVC=/run/service/X$X execlineb -s0 -c ' -fdmove -c 1 2 -redirfd -r 0 /dev/null -multisubstitute { - importas HOME HOME - importas USER USER - importas XSVC XSVC -} -ifthenelse -s { test -d $HOME } { - cd $HOME -} { - cd / -} - background { - pipeline { s6-svc -wd -c $XSVC } - s6-setuidgid $USER $@ -}' "$@" + s6-svc -wU -o /run/service/X$X && + truncate -s 0 /run/Xauthority.$X && + chmod 640 /run/Xauthority.$X && + chown root:$USER /run/Xauthority.$X && + cat /run/service/X$X/data/Xauthority > /run/Xauthority.$X +# pretendrun env XSVC=/run/service/X$X execlineb -s0 -c ' +#fdmove -c 1 2 +#redirfd -r 0 /dev/null +#multisubstitute { +# importas HOME HOME +# importas USER USER +# importas XSVC XSVC +#} +#ifthenelse -s { test -d $HOME } { +# cd $HOME +#} { +# cd / +#} +# background { +# pipeline { s6-svc -wd -c $XSVC } +# s6-setuidgid $USER $@ +#}' "$@" } +typeset -f -t run_x main() { local line term_cmd REPLY