X não root

Ter o X server rodando sem privilégio de root é um sonho de anos. Não existia infraestrutura para implementá-lo assim. Graças ao majestoso trabalho de David Herrmann, a partir do systemd 208, o logind possui uma API que cuida da tarefa (será aproveitada pelos compositores Wayland também).

http://dvdhrm.wordpress.com/2013/08/24/session-management-on-linux/
http://dvdhrm.wordpress.com/2013/08/24/how-vt-switching-works/
http://dvdhrm.wordpress.com/2013/08/25/sane-session-switching/

http://thread.gmane.org/gmane.comp.sysutils.systemd.devel/13114
http://thread.gmane.org/gmane.comp.sysutils.systemd.devel/14812

Na forma atual, o próprio X é encarregado de gerenciar os dispositivos e, por isso, precisa ser root. Com o logind, não mais.

O X server 1.16 suportará essa configuração.

http://thread.gmane.org/gmane.comp.freedesktop.xorg.devel/40262
http://cgit.freedesktop.org/xorg/xserver/commit/?id=1c61d38528a573caadee2468ee59ea558c822e09

Mudanças relacionadas:

http://thread.gmane.org/gmane.linux.kernel.input/31636
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c7dc65737c9a607d3e6f8478659876074ad129b8

http://thread.gmane.org/gmane.comp.freedesktop.xorg.devel/40508
http://cgit.freedesktop.org/xorg/xserver/commit/?id=ddc3888bbaaddc47706a9cb96459738683d72cb3
http://cgit.freedesktop.org/xorg/xserver/commit/?id=4e3d9690e1868d286dcb766b429f9c99313f2401
http://cgit.freedesktop.org/xorg/xserver/commit/?id=8d3f63dbe9bfd816beb6475fd0e00df4dbba269f
http://cgit.freedesktop.org/xorg/xserver/commit/?id=0e972b6037d3709c13d46adef9d14b702f477abc
http://cgit.freedesktop.org/xorg/xserver/commit/?id=2b77b208daf9402472ba7fb709156a14eb487299

http://thread.gmane.org/gmane.comp.freedesktop.xorg.devel/41686
http://cgit.freedesktop.org/xorg/xserver/commit/?id=15460eaed28b5353a94a17091d7795cfaeda9146

http://thread.gmane.org/gmane.comp.freedesktop.xorg.devel/40844
http://cgit.freedesktop.org/xorg/xserver/commit/?id=c0d3a13e7ee42be26d6d1923c9f3ae0355497869
http://cgit.freedesktop.org/xorg/xserver/commit/?id=9d65c515d83d2158b5949e249777ca2a02b31901
http://cgit.freedesktop.org/xorg/xserver/commit/?id=dc48bd653c7e1013e2d69e3f59ae3cbc0c893473

Os principais drivers estão adaptados:

xf86-video-intel
http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id=28cab948f50b1d67468edbd9c8e10d3d696155f5
http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id=6446bf96f0cc01e730c240f7ed5c91f5d2292139

xf86-video-ati
http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/commit/?id=a63342ad15408071437c80b411d14196f3288aed
http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/commit/?id=3d7861fe112f25874319d4cdc12b745fbcd359cf
http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/commit/?id=ed0cfbb4fe77146b0b38f777bc28f3a4ea6da07f

xf86-video-nouveau
http://cgit.freedesktop.org/nouveau/xf86-video-nouveau/commit/?id=47f08aa6d713da4e6ae9c35ce691e790ffaed09d
http://cgit.freedesktop.org/nouveau/xf86-video-nouveau/commit/?id=0c13843e300d1a9db2bfed18dc1b5df38c5adfdf

xf86-video-modesetting
http://cgit.freedesktop.org/xorg/driver/xf86-video-modesetting/commit/?id=509dbe8cab339e44b02fed3728bbef7de5c60d05

xf86-input-evdev
http://cgit.freedesktop.org/xorg/driver/xf86-input-evdev/commit/?id=ae67f64f02434171e1828b00fbf4277c8166966e

Apenas drivers de vídeo que usem KMS funcionam no novo esquema. Com os demais, o servidor ainda rodará como root:

http://thread.gmane.org/gmane.comp.freedesktop.xorg.devel/40587
http://cgit.freedesktop.org/xorg/xserver/commit/?id=e7b84ca46944895971a8f048c7e34869b7de01c0

O milagre está sendo elaborado no Fedora, porém todo trabalho é upstream e chegará nas demais distribuições.

http://thread.gmane.org/gmane.linux.redhat.fedora.devel/191077
https://fedoraproject.org/wiki/Changes/XorgWithoutRootRights
http://hansdegoede.livejournal.com/14268.html

Comentários