Revert "weston: Drop priviledges early, and seteuid when needed"
authorKristian Høgsberg <krh@bitplanet.net>
Tue, 24 Jan 2012 17:37:17 +0000 (12:37 -0500)
committerJonas Ådahl <jadahl@gmail.com>
Sun, 10 Nov 2013 16:51:27 +0000 (17:51 +0100)
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.

src/evdev.c

index 101b63f..f489ede 100644 (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;