[PATCH V4] xserver: check for elevated privileges not uid=0

Adam Jackson ajax at nwnk.net
Fri Dec 16 09:09:14 PST 2011


On 10/11/11 4:02 AM, Antoine Martin wrote:
> This allows us to run the server as a normal user whilst still
> being able to use the -modulepath, -logfile and -config switches
> We define a xf86PrivsElevated which will do the checks and cache
> the result in case it is called more than once.
> Also renamed the paths #defines to match their new meaning.
> Original discussion which led to this patch can be found here:
> http://lists.freedesktop.org/archives/xorg-devel/2011-September/025853.html
>
> Signed-off-by: Antoine Martin <antoine at nagafix.co.uk>

Thanks for refactoring this.  I was wanting to do something similar to 
check for elevated capabilities (for the case of setting CAP_SYS_ADMIN 
and etc on the binary instead of the setuid bit), this makes it a lot 
cleaner.

I don't think the WIN32 conditional is strictly necessary, as I'm pretty 
sure hw/xfree86 won't build under win32.  Outside of that, this looks at 
least as correct as what was there before.

Reviewed-by: Adam Jackson <ajax at redhat.com>

- ajax


More information about the xorg-devel mailing list