Revert "weston: Drop priviledges early, and seteuid when needed"

This reverts commit fc6ccb868fa735ee9c6592806f381aa1262bf0b2.

We still need root permissions for drmDrop/SetMaster.  Without
integration with ConsoleKit or systemd we also don't have access
to /dev/dri/cardX in the case where we open a new VT.
This commit is contained in:
Kristian Høgsberg 2012-01-24 12:37:17 -05:00 committed by Jonas Ådahl
parent f7968296c6
commit 0f0dd81107

View file

@ -20,8 +20,6 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -441,7 +439,6 @@ evdev_input_device_create(struct evdev_input *master,
struct evdev_input_device *device;
struct wl_event_loop *loop;
struct weston_compositor *ec;
uid_t saved_uid, uid, euid;
device = malloc(sizeof *device);
if (device == NULL)
@ -459,10 +456,7 @@ evdev_input_device_create(struct evdev_input *master,
device->rel.dx = 0;
device->rel.dy = 0;
getresuid(&uid, &euid, &saved_uid);
seteuid(saved_uid);
device->fd = open(path, O_RDONLY);
seteuid(euid);
if (device->fd < 0)
goto err0;