libera/#devuan/ Tuesday, 2024-10-08

joergrwp: ((set -e then the control flow)) got a pointer05:40
joerg?05:41
rwpjoerg, http://mywiki.wooledge.org/BashFAQ/10507:21
joergthanks07:28
AlverstoneIf somebody uses elogind and managed to get Xorg running without root privileges and without adding yourself to video/input groups, please let me know.09:19
rrqXorg uses /dev/dri/card0 which thus the user running Xorg need to have access rights for10:07
rrqthe group "video" is the customary way of achieving that10:08
rrqinput devises are mediated by seatd or logind; and seatd interactions are via a socket that (in standard setup) also uses group "video"10:09
rrqdevices10:09
rrqlogind implements the mediation through (system) dbus10:10
AlverstoneExcellent. libgudev is broken in excalibur, need to install from daedalus and put on hold10:24
Alverstonefigured out by trying udisksd to start10:24
Alverstone10/1010:24
fsmithredIs it necessary to have dbus installed to run xorg as user?10:32
fsmithredor elogind?10:33
rrqno. You can use seatd.10:33
fsmithredmy nodbus install has seatd but xorg is running as root10:33
fsmithredno display manager if that makes a difference10:33
rrq(doesn't)10:35
rrq(could run as non-root)10:35
rrqnote that the user starting Xorg must be owner of the /dev/ttyN concerned10:44
rrqeg. by login; just doing "su - ralph" from a root login is no good10:45
fsmithredmy user owns tty1.10:48
fsmithredran startx to start openbox10:48
rrqthat sounds good so far (?)10:51
fsmithredyeah, but xorg is running as root10:51
fsmithredit's excalibur. I'm now upgrading 380 packages. Maybe that'll make a difference.10:52
fsmithreddo I need dummy-logind? Does that actually do anything?10:52
rrqno ... sounds like your Xorg as suid bit set10:53
fsmithredcan I just change that?10:53
rrqremove that, yes10:53
Alverstoneseatd rootless xorg relies on video group, probably also input group. It doesn't make sense. The whole point of rootless xorg is forced privilege separation. implement that in seatd and I'm removing elogind forever10:54
rrqno seatd runs as root service offering input mediation to user in video group (not in input group)10:54
Alverstoneseatd can't do the only thing I have ever asked of login daemons: rootless graphics, without any auxiliary groups10:54
AlverstoneAnd yes, you need dbus for rootless xorg under elogind10:55
rrqseatd doesn;t od graphics10:55
rrqit does input device mediation only10:55
Alverstonewell, until it can run my xorg the way elogind does, i won't be using it10:56
gnarfacewhat's the problem with the audio/video groups?10:56
rrqlogind doesn't do graphics either; only input mediation10:56
gnarfaceif you don't like them, you're free to alter the udev rules to change the permissions10:56
Alverstoneelogind does a good thing here, dunno why people are so resistant to implementing useful features just because they come from systemd10:56
gnarfacei mean, it's basic security10:56
Alverstonegnarface, audio/video groups allow unrestricted access to audio/video devices10:57
Alverstoneit does not make sense10:57
gnarfaceit's kinda one of the core complaints against systemd in fact, that it blows away the entire permissions model in the name of convenience10:57
Alverstoneelogind nicely manages permissions here10:57
Alverstonethe permissions model is broken here. there are no reasons to add users to some arbitrary groups just to just graphics10:58
Alverstonejust to run*10:58
rrqthe graphics device is operated with ioctls and requires capabilites as well as access; it's not mediated10:58
rrqit has the usual open/close separations between users10:59
gnarfaceAlverstone: look, you're just wrong, that's all. you are complaining about adding yourself to a group because it gives that group unrestricted access to the whole device class, then you're arguing that the solution is to remove all the restrictions in a blanket fashion, when you should be complaining that it doesn't make your user the owner of the devices for logical continuity... your argument doesn't make sense.11:00
gnarfacejust chmod your whole /dev/ tree 777 and be done with it11:01
Alverstonegnarface, what do you mean?11:01
Alverstonemy solution is elogind, which just gives me the permissions I want :)11:01
rrqelogind does not mediate graphics11:02
Alverstonerrq, seems like it, I just don't understand what you are trying to say11:02
rrqit mediates input device access just the same way as seatd does though with a more roundabout implementation (via dbus)11:02
Alverstonegraphics work out of the box iirc, even with no login daemons graphics will start, but input will be broken11:03
Alverstonedunno who manages that11:03
rrqXorg11:04
Alverstonewithout root?11:04
gnarfacedepends on the driver11:04
Alverstoneanyway11:04
gnarfaceas of daedalus though i believe nvidia was the only holdout still requiring Xorg to be suid root11:04
gnarfacecould be wrong about that11:04
gnarfacei thought even they were gonna fix that eventually11:04
Alverstonerrq, why does user have to be in video group for seatd to allow input devices?11:05
Alverstonewhat's the point?11:05
rrqbecause the communication socket has that permissions setting11:05
Alverstonefrom debian wiki:11:06
gnarface(my guess is that it's because it can't figure out which input devices belong to which "seat" without access to the video stack, but i don't use seatd either)11:06
Alverstonevideo: This group can be used locally to give a set of users access to a video device (like webcam)11:06
gnarfacei think seatd is also new with this release11:07
Alverstonewith elogind i don't need video group to access video devices iirc11:07
rrqthe seatd option is a devuan patch.. (not in debian)11:07
Alverstoneneed to reboot to test test that though :D11:07
Alverstonegonna take a minute :(11:08
Alverstonevideo devices work fine without the video group. iirc that must be the responsibility of elogind, because i once tried to access video from an inactive session and hit the wall11:24
Alverstonebut users in video group can access video devices always, without restriction11:25
Alverstonegets really broken one you use more than one user11:25
Alverstoneonce*11:25
rrqafaik it has nothing to do with elogind11:25
rrqrather it's because /dev/dri/card0 has those permissions11:27
rrqsorry I misread11:30
rrqbut I'm also not sure which program you talk about now11:31
Alverstone /dev/dri/card0 has 0660/crw-rw---- permissions11:33
Alverstoneroot:video ownership11:33
Alverstoneyou can't access it without a login daemon giving you permissions, unless you are a member of the video group11:34
Alverstonerrq, so elogind must handle video devices too11:34
Alverstonecouldn't possibly work otherwise11:34
rrqare you running Xorg without being in video group?11:35
Alverstoneyes11:35
Alverstonerrq, do you use seatd?11:36
rrqyes11:37
Alverstone`seatd -u root -g seatdadm` and then add a user to seatdadm group. Is it gonna work to launch Xorg without being a member of the video group?11:38
rrq(sorry; sidetracked) .. yes I think so11:50
rrqmay depend on the graphics driver though11:58
Alverstonerrq, yep, `seatd -u root -g seatdadm` worked as excepted. Guess I'll stick with seatd then for a while to see how it goes?13:35
Alverstoneanyway thank you for explanations13:36
Alverstonerelease notes and man pages were not helpful here13:36
fsmithredAlverstone, is that with or without elogind?13:40
Alverstonefsmithred, without elogind14:00
Alverstoneoh well14:01
Alverstonewait a minute I'll triple check14:01
Alverstonefsmithred, forget it14:37
fsmithredhuh?14:37
Alverstoneit was elogind after all, I removed it completely and X11 didn't start at all. seat initiated, but video driver failed to open video device. apparently seatd doesn't do anything at all there14:40
fsmithredoh14:40
fsmithrednot sure what config I have, lemme check14:41
Alverstoneplus udisks2 depends on elogind and i depend on udisks2, so much for my hopes14:41
fsmithredoops. The one that's booted doesn't even have X yet.14:42
fsmithredyeah, well elogind requires dbus and I pinned dbus to -1 on this build.14:43
fsmithredbut I can run X wiht startx14:43
Alverstoneit runs with root privileges14:44
Alverstonebeats me14:44
Alverstonei don't see a point in this, at this point in time graphics should run as regular user14:44
rrqdoes Xorg run as root? when started by a non-root user?14:46
fsmithredyes14:46
fsmithredhere anyway14:46
fsmithred /usr/lib/xorg/Xorg is running as root14:46
rrqso it has suid bit set?14:47
fsmithredmaybe because I have needs_root_rights=yes in /etc/X11/Xwrapper.config14:47
fsmithredand I don't have elogind or dbus14:47
rrqcan you clear suid bit and try again?14:48
fsmithredhow to do?14:48
Alverstonereminder: printscr+alt+r to unraw you keyboard14:48
Alverstonefsmithred,  needs_root_rights=no is enough14:48
rrqchmod u-s $file14:48
Alverstoneto test14:48
Alverstonerrq, just changing a config value is better imo14:49
rrqno it should not have suuid bit set14:49
Alverstonewhy/14:49
Alverstoneit doesn't bite afaik14:49
rrqit should not ruun as root unless started by root14:49
fsmithredI don't think it does. Shouldn't I see something like 's' in the ls -l output?14:49
rrqyes14:50
fsmithredI have -rwxr-xr-x on /usr/lib/xorg/Xorg14:50
Alverstonefsmithred, must have s, otherwise how can it run as root?14:50
Alverstoneahh14:50
Alverstoneyou don't need Xorg14:50
AlverstoneXorg.wrapper14:50
AlverstoneXorg.wrapper is the suid14:50
Alverstoneiirc14:50
fsmithredyup. 2 s's.14:51
fsmithredXorg.wrap14:51
rrqchmod 55514:51
Alverstone75514:52
Alverstone?14:52
fsmithredall running as user now. Thanks!!!14:54
fsmithredI did chmod u-s14:54
rrqand then user has permissions for /dev/dri/card014:54
fsmithredI guess because I'm in the video group14:55
fsmithredand I should keep the setting in Xwapper.config? (nees_root...)14:56
rrqit's now disabled... ineffective setting14:57
rrqi'm not sure if something else looks at it14:57
fsmithredI'll test. Rebooting now because vnc got stupid about caps lock.14:59
fsmithredstill works with that line commented15:01
Alverstonevideo group is better than root imo15:03
Alverstoneso congratulations!15:04
fsmithredthanks15:04
fsmithredI was in video group already, so this is definitely an improvement15:04
gnarfacefsmithred: doesn't seem like the right way to do that... mine isn't executing Xorg.wrap at all here...15:14
gnarfaceunless you're using nvidia drivers on that machine and it's another nvidia driver difference15:15
fsmithredno15:15
fsmithredmaybe you have something installed that I don15:15
fsmithredt?15:15
gnarfacethe comments in /etc/X11/Xwrapper.config infer that running "dpkg-reconfigure x11-common" will regenerate it... maybe that'll ask questions?15:15
fsmithredthis is a no-dbus build, no elogind no display manager15:15
gnarfacei do have dbus here, but not elogind or any other display manager15:16
fsmithredany *kits?15:16
gnarfacenope15:16
fsmithredit's squashing a live-iso right now, but I'll play with that later.15:17
gnarfaceand the only uncommented line in my presumably stock /etc/X11/Xwrapper.config is allowed_users=console15:17
fsmithredyeah, that's all I have now too. I commented out the other line.15:18
gnarfaceand what's more, this install used to have the nvidia drivers on it, which did use and require the suid wrapper15:18
gnarfacei thought what i did to change that was to just remove the xserver-xorg-legacy package, but i see it is still installed15:18
gnarfacemaybe i dpkg-reconfigured something else related to it though...15:19
gnarfacethe memory is foggy still15:19
gnarfacebut i can confirm that whatever it was it certainly did not involve removing the setuid bits on Xorg.wrap15:20
gnarfaceno polkit or consolekit or elogind15:21
gnarfacejust dbus and running startx by hand15:21
gnarfacenot even using seatd actually, it is installed but disabled15:22
gnarface(Xorg complains but works fine)15:22
fsmithredhow do you disable seatd?15:22
fsmithrednm, dumb question15:23
gnarfacejust with the /etc/rc*.d/ symlinks. i doubt that's the key difference though, as i'm pretty sure i had made this change when i switched to the AMD video card15:23
gnarfacewhich i think was sometime before switching to daedalus...15:23
gnarfacehmm, now that i say that i'm less sure though...15:23
fsmithredI can try a few things and see what happens15:24
gnarfacei feel like the missing key might have been a "dpkg-reconfigure [something]"15:24
fsmithredxserver-xorg15:25
fsmithredbeen a long time since I've done that15:25
gnarface"dpkg-reconfigure xserver-xorg" - is that what it really was? i only had to do it the one time15:39
fsmithredyeah, I did that with and without -plow and saw nothing15:53
fsmithredI must have run it a bunch of times in the past, because I remembered that option.15:54

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!