summaryrefslogtreecommitdiff
path: root/xserver/config
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2015-02-11 20:58:48 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2015-02-11 20:58:48 +0000
commit61c5fcfe608b38a9ce64b1db6393c392108cc89d (patch)
tree8ef036e5b54b6717be9c50782761a67170b6042d /xserver/config
parent4506119f5eb47a09843e68ff91de6ce5c63d0ba0 (diff)
Update to xserver 1.16.4.
Contains fix for CVE-2015-0255. ok dcoppa@
Diffstat (limited to 'xserver/config')
-rw-r--r--xserver/config/udev.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/xserver/config/udev.c b/xserver/config/udev.c
index a1b72c13b..71215afb3 100644
--- a/xserver/config/udev.c
+++ b/xserver/config/udev.c
@@ -69,6 +69,24 @@ static const char *itoa(int i)
return itoa_buf;
}
+static Bool
+check_seat(struct udev_device *udev_device)
+{
+ const char *dev_seat;
+
+ dev_seat = udev_device_get_property_value(udev_device, "ID_SEAT");
+ if (!dev_seat)
+ dev_seat = "seat0";
+
+ if (SeatId && strcmp(dev_seat, SeatId))
+ return FALSE;
+
+ if (!SeatId && strcmp(dev_seat, "seat0"))
+ return FALSE;
+
+ return TRUE;
+}
+
static void
device_added(struct udev_device *udev_device)
{
@@ -83,7 +101,6 @@ device_added(struct udev_device *udev_device)
struct udev_list_entry *set, *entry;
struct udev_device *parent;
int rc;
- const char *dev_seat;
dev_t devnum;
path = udev_device_get_devnode(udev_device);
@@ -93,14 +110,7 @@ device_added(struct udev_device *udev_device)
if (!path || !syspath)
return;
- dev_seat = udev_device_get_property_value(udev_device, "ID_SEAT");
- if (!dev_seat)
- dev_seat = "seat0";
-
- if (SeatId && strcmp(dev_seat, SeatId))
- return;
-
- if (!SeatId && strcmp(dev_seat, "seat0"))
+ if (!check_seat(udev_device))
return;
devnum = udev_device_get_devnum(udev_device);
@@ -506,6 +516,8 @@ config_udev_odev_probe(config_odev_probe_proc_ptr probe_callback)
goto no_probe;
else if (strncmp(sysname, "card", 4) != 0)
goto no_probe;
+ else if (!check_seat(udev_device))
+ goto no_probe;
config_udev_odev_setup_attribs(path, syspath, major(devnum),
minor(devnum), probe_callback);