Bug 442362 - xwayland: Add local user to xhost
Summary: xwayland: Add local user to xhost
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-13 02:12 UTC by walktmp+s3q7a
Modified: 2021-11-12 15:12 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.23.4
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description walktmp+s3q7a 2021-09-13 02:12:09 UTC
Trying to run something under Xwayland, properly, as a different user is beyond a headache in Plasma Wayland. 

It just works(tm) under GNOME, see https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/735
Comment 1 Benn Snyder 2021-09-21 22:30:50 UTC
This used to work with kwin-5.21.5 but now it fails after kwin-5.22.5 update.

    $ xhost +SI:localuser:steam
    localuser:steam being added to access control list
    $ sudo -u steam glxinfo
    Password: 
    Error: unable to open display :0

glxinfo is just an example - all xwayland programs fail with a similar message.
Comment 2 Vlad Zahorodnii 2021-09-22 06:54:07 UTC
I think it doesn't work because the X11 socket (in /tmp/.X11-unix/) is not writable by other users.
Comment 3 Benn Snyder 2021-09-23 21:38:31 UTC
(In reply to Vlad Zahorodnii from comment #2)
> I think it doesn't work because the X11 socket (in /tmp/.X11-unix/) is not
> writable by other users.

Excellent, thank you!  Now I can start programs like this.

    xhost +SI:localuser:steam
    chgrp -R users /tmp/.X11-unix/*
    chmod -R g=u /tmp/.X11-unix/*
    sudo -u steam glxinfo

But still it would be great if this use case could work without such scripting.
Comment 4 Bug Janitor Service 2021-11-11 20:28:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1646
Comment 5 Vlad Zahorodnii 2021-11-12 09:02:53 UTC
Git commit 83a036e9d40475d5c07177bf2e8bba9bc0fd4aa5 by Vlad Zahorodnii, on behalf of Weng Xuetian.
Committed on 12/11/2021 at 09:02.
Pushed by vladz into branch 'master'.

Fix XWayland abstract socket address.

NUL-termination byte is not needed for abstract socket. This leads to
XWayland listening to a wrong address.

Confirmed with lsof.

M  +4    -5    src/xwl/lib/xwaylandsocket.cpp

https://invent.kde.org/plasma/kwin/commit/83a036e9d40475d5c07177bf2e8bba9bc0fd4aa5
Comment 6 Vlad Zahorodnii 2021-11-12 09:03:23 UTC
Git commit 5a9a3e96898bd29ccbf31d9ff92dfb80274ce265 by Vlad Zahorodnii, on behalf of Weng Xuetian.
Committed on 12/11/2021 at 09:03.
Pushed by vladz into branch 'Plasma/5.23'.

Fix XWayland abstract socket address.

NUL-termination byte is not needed for abstract socket. This leads to
XWayland listening to a wrong address.

Confirmed with lsof.


(cherry picked from commit 83a036e9d40475d5c07177bf2e8bba9bc0fd4aa5)

M  +4    -5    src/xwl/lib/xwaylandsocket.cpp

https://invent.kde.org/plasma/kwin/commit/5a9a3e96898bd29ccbf31d9ff92dfb80274ce265