fix(x11): keep /usr/bin/Xorg non-setuid (0755) for rootless elogind startup
This commit is contained in:
@@ -36,8 +36,8 @@ if [ -z "$SXMO_NO_AUDIO" ]; then
|
||||
superctl start pulseaudio
|
||||
elif [ "$(command -v pipewire)" ]; then
|
||||
# pipewire-pulse will start pipewire
|
||||
superctl start pipewire-pulse
|
||||
superctl start wireplumber
|
||||
pidof -s pipewire >/dev/null 2>&1 || superctl start pipewire-pulse
|
||||
pidof -s wireplumber >/dev/null 2>&1 || superctl start wireplumber
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -42,10 +42,11 @@ if [ -d /home/user/.local/x11 ]; then
|
||||
rm -rf /tmp/x11
|
||||
ln -s /home/user/.local/x11 /tmp/x11
|
||||
cp -f /home/user/.local/x11/xorg-bananarchy.conf /tmp/xorg-bananarchy.conf 2>/dev/null || true
|
||||
XORG_CONFIG="/tmp/xorg-bananarchy.conf"
|
||||
else
|
||||
export FCITX_ADDON_DIRS=/home/user/.local/lib/fcitx5:/usr/lib/fcitx5
|
||||
export PATH=/home/user/.local/bin:/home/user/.config/sxmo/hooks:/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin
|
||||
cp -f /etc/X11/xorg.conf.d/10-bananarchy-msm8909.conf /tmp/xorg-bananarchy.conf 2>/dev/null || true
|
||||
XORG_CONFIG="xorg.conf.d/10-bananarchy-msm8909.conf"
|
||||
fi
|
||||
|
||||
unset WAYLAND_DISPLAY
|
||||
@@ -66,7 +67,7 @@ XORG_MODPATH="/usr/lib/xorg/modules/xlibre-25,/usr/lib/xorg/modules"
|
||||
[ -d /tmp/x11/usr/lib/xorg/modules ] && XORG_MODPATH="/tmp/x11/usr/lib/xorg/modules/xlibre-25,/tmp/x11/usr/lib/xorg/modules"
|
||||
|
||||
if ! pidof -s Xorg >/dev/null 2>&1; then
|
||||
"$XORG_BIN" :0 -s 0 -dpms -nocursor -nolisten tcp -config /tmp/xorg-bananarchy.conf -modulepath "$XORG_MODPATH" -logfile /tmp/Xorg.0.log >/dev/null 2>&1 </dev/null &
|
||||
"$XORG_BIN" :0 -s 0 -dpms -nocursor -nolisten tcp -config "$XORG_CONFIG" -modulepath "$XORG_MODPATH" -logfile /tmp/Xorg.0.log >/dev/null 2>&1 </dev/null &
|
||||
i=0
|
||||
while [ "$i" -lt 40 ]; do
|
||||
if xset s off s noblank s 0 0 -dpms >/dev/null 2>&1; then
|
||||
|
||||
@@ -36,8 +36,8 @@ if [ -z "$SXMO_NO_AUDIO" ]; then
|
||||
superctl start pulseaudio
|
||||
elif [ "$(command -v pipewire)" ]; then
|
||||
# pipewire-pulse will start pipewire
|
||||
superctl start pipewire-pulse
|
||||
superctl start wireplumber
|
||||
pidof -s pipewire >/dev/null 2>&1 || superctl start pipewire-pulse
|
||||
pidof -s wireplumber >/dev/null 2>&1 || superctl start wireplumber
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
+4
-1
@@ -141,11 +141,14 @@ EOF
|
||||
chown 0:5 "$ROOTFS/usr/bin/wall"
|
||||
chmod 2755 "$ROOTFS/usr/bin/wall"
|
||||
fi
|
||||
if [ -e "$ROOTFS/usr/bin/Xorg" ] && [ ! -L "$ROOTFS/usr/bin/Xorg" ]; then
|
||||
chown 0:0 "$ROOTFS/usr/bin/Xorg"
|
||||
chmod 0755 "$ROOTFS/usr/bin/Xorg"
|
||||
fi
|
||||
for suid_bin in \
|
||||
"$ROOTFS/bin/su" \
|
||||
"$ROOTFS/bin/mount" \
|
||||
"$ROOTFS/bin/umount" \
|
||||
"$ROOTFS/usr/bin/Xorg" \
|
||||
"$ROOTFS/usr/bin/doas" \
|
||||
"$ROOTFS/usr/bin/sudo" \
|
||||
"$ROOTFS/usr/bin/pkexec" \
|
||||
|
||||
Reference in New Issue
Block a user