You are not logged in.

#1 2012-02-07 12:50:42

TheHebes
Member
From: New England
Registered: 2011-07-07
Posts: 138

X as root? [Solved]

Hi all--
So when I execute "startx" as a normal, underprivileged account, X starts as expected. However, when I run top, it reports that X is running as root. This strikes me as somewhat odd, as I have no idea how it has rights to do this. Is this something that I should be concerned about?

Last edited by TheHebes (2012-02-07 13:15:24)


Laptops:
MSI GS60 Ghost
Asus Zenbook Pro UX501VW
Lenovo Thinkpad X120e

Offline

#2 2012-02-07 13:05:00

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: X as root? [Solved]

Nothing odd about it, X has always been running as root. It has to. As to the rights... Xorg is a suid root binary.

Offline

#3 2012-02-07 13:15:05

TheHebes
Member
From: New England
Registered: 2011-07-07
Posts: 138

Re: X as root? [Solved]

Hmm. That seems rather foolish. Ah well, thanks for clearing that up.


Laptops:
MSI GS60 Ghost
Asus Zenbook Pro UX501VW
Lenovo Thinkpad X120e

Offline

#4 2012-02-07 18:46:20

Diaz
Member
From: Portugal
Registered: 2008-04-16
Posts: 366

Re: X as root? [Solved]

It should be possible to run X without root privileges but i don't know how to do it wink

Offline

#5 2012-02-07 19:15:35

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: X as root? [Solved]

Diaz wrote:

It should be possible to run X without root privileges

Not really. Not without source patching. Graphics shouldn't be a problem now that we have KMS, but there's still stuff left to do regarding input handling before the suid bit can be dropped from Xorg.

Offline

#6 2012-02-07 22:32:01

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,304

Re: X as root? [Solved]

Gusar wrote:

...before the suid bit can be dropped from Xorg.

In fact the setuid bit can already be dropped, it is in other distros (like OpenSuse).
It is only required when using startx after logging in as user to start graphical environment;
when using a display manager (xdm, kdm, ...) it is not necessary.
But nevertheless the Xorg server process is still run as root, because everything started at boot time run with root privileges, and the display manager is run at boot time, either in the DAEMON variable of /etc/rc.conf or in /etc/inittab.
So running Xorg as a non root user is distinct from the setuid bit of the xorg binary.

But this doesn't change the fact that the Xorg server process always runs presently with root privileges in every cases.
And it seems that no upstream devs is motivated enough to implement completely the possibility to run it without root privileges.
Though it would be nice to become so.

See http://en.gentoo-wiki.com/wiki/Non_Root_Xorg-Server for a solution to implement that with much re-compilations.

Offline

#7 2012-02-07 22:47:08

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: X as root? [Solved]

berbae wrote:

So running Xorg as a non root user is distinct from the setuid bit of the xorg binary.

ah. Thanks for the clarification.

berbae wrote:

See http://en.gentoo-wiki.com/wiki/Non_Root_Xorg-Server for a solution to implement that with much re-compilations.

Err...

Enable access to input devices, there must be a better way to do this, enabling this allows any application to tap keyboard/mouse.

That's just... baaaaaad.

Offline

#8 2012-02-20 08:42:15

dgbaley27
Member
Registered: 2011-07-22
Posts: 47

Re: X as root? [Solved]

Gusar wrote:

Enable access to input devices, there must be a better way to do this, enabling this allows any application to tap keyboard/mouse.

That's just... baaaaaad.

Changing the permissions of the /dev/input/* devices seems like something ConsoleKit should do.

Offline

Board footer

Powered by FluxBB