View previous topic :: View next topic |
Author |
Message |
mi_unixbird Tux's lil' helper
Joined: 24 Jul 2015 Posts: 137
|
Posted: Tue Nov 03, 2015 10:23 am Post subject: Running a root application in X as non root |
|
|
Okay, so I have X set up as nonroot. My system is a bit nonstandard however, not sure if any of these parts are relevant:
- runit is my pid1
- eudev is my udev
- no polkit
- no consolekit
- no acl support in kernel or userland
(no, I do not run logind)
To set up X as non root, I did the following:
1. emerge x11-base/xorg-server without the "suid" USE flag
2. add my account to the "input" group
3. put inside /etc/udev/rules.d/99-dev-input-group-rules 'SUBSYSTEM=="input", ACTION=="add", GROUP="input"\n'
Code: | —— — ls -l /dev/input/
total 0
drwxr-xr-x 2 root root 60 Oct 14 00:21 by-id
drwxr-xr-x 2 root root 120 Oct 14 00:21 by-path
crw-rw---- 1 root input 13, 64 Oct 14 01:16 event0
crw-rw---- 1 root input 13, 65 Oct 14 01:16 event1
crw-rw---- 1 root input 13, 74 Oct 14 01:16 event10
crw-rw---- 1 root input 13, 66 Oct 14 01:16 event2
crw-rw---- 1 root input 13, 67 Oct 14 01:16 event3
crw-rw---- 1 root input 13, 68 Oct 14 01:16 event4
crw-rw---- 1 root input 13, 69 Oct 14 01:16 event5
crw-rw---- 1 root input 13, 70 Oct 14 01:16 event6
crw-rw---- 1 root input 13, 71 Oct 14 01:16 event7
crw-rw---- 1 root input 13, 72 Oct 14 01:16 event8
crw-rw---- 1 root input 13, 73 Oct 14 01:16 event9
crw-rw---- 1 root input 13, 63 Oct 14 01:16 mice
crw-rw---- 1 root input 13, 32 Oct 14 01:16 mouse0 |
After stating X as nonroot with "startx -- vt1" it all seems to work flawlessly except that whenever I open a graphical application with root rights, say "kdesudo my-text-editor" the window remains perfectly white but clearly receives input and handles it accordingly, I can do whatever I know how to do by memory, I made a file and saved it blindly to test if it works and it seems to, but nothing is displayed in the window.
I'm also well aware of the security problems with running X as nonroot without sessions and logind, I'm not actually looking to permanently run X as nonroot. I'm only looking to see if I can make it work just cause, after that I will probably undo all the changes since I'm still playing with untested stuff. _________________ execctl --path exec filectl --current-directory list |
|
Back to top |
|
|
mi_unixbird Tux's lil' helper
Joined: 24 Jul 2015 Posts: 137
|
Posted: Wed Nov 04, 2015 1:24 pm Post subject: |
|
|
For future readers: I solve this problem. Turns out it was not an X thing per se but a Qt thing, turns out all the tested windows by coincidence just used Qt.
The problem is caused by the MITSHM extension that Qt uses. To stop it, simply add "QT_X11_NO_MITSHM=1" to /etc/environment or find another way on a per-application basis to set this environment variable. _________________ execctl --path exec filectl --current-directory list |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|