1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00
systemd/src/libsystemd
Maxim Mikityanskiy 9a9c7dc2cb sd-device: fix enumeration of devices without subsystem
Prior to commit c32eb440ba, libudev's
function udev_enumerate_scan_devices() had behaved differently. If
parent match was added with udev_enumerate_add_match_parent(),
udev_enumerate_scan_devices() did not return error if some child devices
had no subsystem symlink in sysfs. An example of such devices is USB
endpoints /sys/bus/usb/devices/*/ep_*. If there was a parent match
against USB device, old implementation of udev_enumerate_scan_devices()
did not treat ep_* device directories without subsystem symlink as error
and just ignored them, but new implementation returns -ENOENT (also
ignoring these devices) though correctly enumerates all other matching
devices.

To compare, you could look at 96df036fe3,
in src/libudev/libudev-enumerate.c, function parent_add_child():

    if (!match_subsystem(enumerate, udev_device_get_subsystem(dev)))
            goto nomatch;

udev_device_get_subsystem() was returning NULL, match_subsystem() was
returning false, and USB endpoint device was ignored.

New parent_add_child() from src/libsystemd/sd-device/device-enumerator.c
checks return value of sd_device_get_subsystem() and fails if subsystem
was not found. Absence of subsystem symlink should not be really treated
as error because all enumerations of children of USB devices will fail
with -ENOENT. This new behavior also breaks system-config-printer.

So restore old behavior and treat absence of subsystem symlink as no
match.
2015-08-22 11:33:32 +03:00
..
sd-bus Merge pull request #977 from richardmaw-codethink/machinectl-userns-login-v2 2015-08-17 15:12:15 +02:00
sd-daemon sd-daemon: return EBADF for invalid fd numbers 2015-08-07 11:30:18 -04:00
sd-device sd-device: fix enumeration of devices without subsystem 2015-08-22 11:33:32 +03:00
sd-event tree-wide: generate EBADF when we get invalid fds 2015-08-14 18:23:16 +02:00
sd-hwdb hashmap: fix iterators to not skip entries 2015-06-14 16:56:02 +02:00
sd-id128 build-sys: add all source files and no built files to the tar ball 2015-06-23 12:43:15 +02:00
sd-login tree-wide: generate EBADF when we get invalid fds 2015-08-14 18:23:16 +02:00
sd-netlink tree-wide: generate EBADF when we get invalid fds 2015-08-14 18:23:16 +02:00
sd-network sd-network: fix CID 1306198 2015-06-11 14:08:56 +05:30
sd-path tree-wide: there is no ENOTSUP on linux 2015-03-13 14:10:39 +01:00
sd-resolve Add (void) where we don't care about return value 2015-03-15 17:26:58 -04:00
sd-utf8 libsystemd: split up into subdirs 2014-01-21 14:41:35 +01:00
.gitignore libsystemd: remove list of symbols to export only in the future 2015-06-17 16:21:13 +02:00
libsystemd.pc.in build-sys: update .pc.in files 2014-01-25 18:55:58 -05:00
libsystemd.sym sd-bus: introduce new sd_bus_flush_close_unref() call 2015-07-03 19:49:03 +02:00
Makefile libsystemd-bus: rename to libsystemd 2014-01-13 18:54:19 +01:00