Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Running a root application in X as non root
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 102

PostPosted: Tue Nov 03, 2015 10:23 am    Post subject: Running a root application in X as non root Reply with quote

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
View user's profile Send private message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 102

PostPosted: Wed Nov 04, 2015 1:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
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