From: Matthias Bolte Date: Sat, 30 Jan 2010 23:53:40 +0000 (+0100) Subject: udev: Don't let strtoul parse USB busnum and devnum as octal X-Git-Tag: v0.7.6~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33e25a3984e50d6f36d98d1941623ac3bed53bde;p=thirdparty%2Flibvirt.git udev: Don't let strtoul parse USB busnum and devnum as octal udevGetUintProperty was called with base set to 0 for busnum and devnum. With base 0 strtoul parses the number as octal if it start with a 0. But busnum and devnum are decimal and udev returns them padded with leading zeros. So strtoul parses them as octal. This works for certain decimal values like 001-007, but fails for values like 008. Change udevProcessUSBDevice to use base 10 for busnum and devnum. --- diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index dcd889d95f..2bc2d32a35 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -500,14 +500,14 @@ static int udevProcessUSBDevice(struct udev_device *device, if (udevGetUintProperty(device, "BUSNUM", &data->usb_dev.bus, - 0) == PROPERTY_ERROR) { + 10) == PROPERTY_ERROR) { goto out; } if (udevGetUintProperty(device, "DEVNUM", &data->usb_dev.device, - 0) == PROPERTY_ERROR) { + 10) == PROPERTY_ERROR) { goto out; }