X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=namedev.c;h=126453cc892654751eb850e636870dc80be68ebb;hb=9af5bb2f8fdbf54c064ddbd319d61092f28a4132;hp=8bf3c0e73e87ac1d702d56df0425d8cbd1339950;hpb=6818c51d7abeab9914eb7193968b1efa9459a853;p=elogind.git diff --git a/namedev.c b/namedev.c index 8bf3c0e73..126453cc8 100644 --- a/namedev.c +++ b/namedev.c @@ -36,7 +36,7 @@ #include "libsysfs/sysfs/libsysfs.h" #include "list.h" #include "udev.h" -#include "udev_lib.h" +#include "udev_utils.h" #include "udev_version.h" #include "logging.h" #include "namedev.h" @@ -626,6 +626,17 @@ static int match_rule(struct config_device *dev, struct sysfs_class_device *clas } } + /* check for matching driver */ + if (dev->driver[0] != '\0') { + dbg("check for " FIELD_DRIVER " dev->driver='%s' sysfs_device->driver_name='%s'", dev->driver, sysfs_device->driver_name); + if (strcmp_pattern(dev->driver, sysfs_device->driver_name) != 0) { + dbg(FIELD_DRIVER " is not matching"); + goto try_parent; + } else { + dbg(FIELD_DRIVER " matches"); + } + } + /* check for matching bus id */ if (dev->id[0] != '\0') { dbg("check " FIELD_ID); @@ -796,6 +807,12 @@ found: goto done; udev->partitions = dev->partitions; + udev->ignore_remove = dev->ignore_remove; + + if (dev->group[0] != '\0') { + strfieldcpy(udev->group, dev->group); + apply_format(udev, udev->group, sizeof(udev->group), class_dev, sysfs_device); + } /* get permissions given in rule */ set_empty_perms(udev, dev->mode,