chimera-linux / turnstile

Independent session/login tracker
BSD 2-Clause "Simplified" License
89 stars 8 forks source link

Issue with groups #2

Closed high1 closed 2 years ago

high1 commented 2 years ago

Coming from discussion on Artix Linux forum, https://forum.artixlinux.org/index.php/topic,4258.0.html, I've reported an issue that I have using dinit-userservd to start a user dbus-session. All the services (dbus, pipewire, pipewire-pulse and wireplumber) that I use are started properly, and GNOME is using the dbus session started by dinit user instance, but doas (sudo) is not working - and groups command returns only my primary group, although I'm a memeber of wheel group. Long story short, davmac pointed that the issue could be: Looking quickly at the dinit-userservd code, I can see that it uses only the uid and gid of the user when launching the dinit user instance. He suggested that I open an issue here, so here I am. I'm using this https://github.com/XynonWasTaken/dinit-userservd, a port of this repo for Artix Linux.

q66 commented 2 years ago

i don't see why doas would be influenced by dbus? why does dbus being started in some way matter to your current login?

that said, yes, userservd should be patched to call initgroups, and I can see that influencing operation of dbus, but I don't see why it would matter to your login instance

davmac314 commented 2 years ago

That confused me too actually - perhaps @high1 is starting a terminal via a dinit service, or something like that? Or otherwise, at least part of the desktop session is being launched via dbus. It would be interesting to see output from pstree.

high1 commented 2 years ago

I'm not sure what's actually going on here - but do bear in mind that I'm using GNOME terminal or BlackBox, so maybe that contributes to the issue. The issue doesn't have anything to do with doas particularly, it's just that the process that's executing the terminal and commands inside it is not seeing my groups - and that probably comes from dbus user session that GNOME connects to. If I let GNOME spawn a session itself, there are no groups issues. Will update the post with pstree output later.

q66 commented 2 years ago

how are you starting gnome?

q66 commented 2 years ago

try this commit https://github.com/chimera-linux/dinit-userservd/commit/52ddb5049226a5917205b20561e30c82432ff8dc

you probably won't be able to use the git ToT directly because of https://github.com/chimera-linux/dinit-userservd/commit/8c08f5b38eca32d8c9077f6145e19a67b750ffb9 (requires current dinit git master), so just cherry-pick it into your own tree or whatever if you like

high1 commented 2 years ago

Gnome is started with GDM. I'm using dinit-userservd to start dbus and other services, an implementation is available here https://github.com/XynonWasTaken/dinit-userservd-services.

q66 commented 2 years ago

i'm reasonably sure that the issue is gone, so closing

high1 commented 2 years ago

I can't test this, unfortunately, since dinit on artix is the latest released version, so it doesn't include the necessary PR. Will report back once I'm in position to verify. Thanks.

q66 commented 2 years ago

that's why i told you to cherry-pick the specific commit

high1 commented 2 years ago

Confirmed working with 52ddb50 cherry picked.