chiark / gitweb /
update DRIVER== changes
authorKay Sievers <kay.sievers@suse.de>
Sat, 24 Feb 2007 22:43:04 +0000 (23:43 +0100)
committerKay Sievers <kay.sievers@suse.de>
Sat, 24 Feb 2007 22:43:04 +0000 (23:43 +0100)
TODO
extras/volume_id/vol_id.c
udev_rules_parse.c

diff --git a/TODO b/TODO
index f64273cab445859e41c292c61445f4ef5ef87f19..7afef5fe9d082e8027686f80dc4f549731245ffe 100644 (file)
--- a/TODO
+++ b/TODO
@@ -4,10 +4,6 @@ These things would be nice to have:
     any of the links at that time
 
 These things will change in future udev versions:
     any of the links at that time
 
 These things will change in future udev versions:
-  o make DRIVER== to match only the event device
-    (DRIVERS must be used, we currently translate it to DRIVERS and print
-     a warning if DRIVER is used)
-
   o warn if BUS, ID, SYSFS are used as keys
     (they are SUBSYSTEMS, KERNELS, ATTRS now)
 
   o warn if BUS, ID, SYSFS are used as keys
     (they are SUBSYSTEMS, KERNELS, ATTRS now)
 
index 73843ef6995d2cd2b9c92c1bba438c3bbcea7b3a..92f00e0c50006f2ee43c6cb024bc340d8257a7d6 100644 (file)
@@ -188,7 +188,8 @@ int main(int argc, char *argv[])
        /* try to drop all privileges before reading disk content */
        pw = getpwnam ("nobody");
        if (pw != NULL && pw->pw_uid > 0 && pw->pw_gid > 0) {
        /* try to drop all privileges before reading disk content */
        pw = getpwnam ("nobody");
        if (pw != NULL && pw->pw_uid > 0 && pw->pw_gid > 0) {
-               dbg("dropping privileges to %u:%u", (unsigned int)pw->pw_uid, (unsigned int)pw->pw_gid);
+               dbg("dropping privileges to %u:%u",
+                   (unsigned int)pw->pw_uid, (unsigned int)pw->pw_gid);
                if (setgroups(0, NULL) != 0 ||
                    setgid(pw->pw_gid) != 0 ||
                    setuid(pw->pw_uid) != 0) {
                if (setgroups(0, NULL) != 0 ||
                    setgid(pw->pw_gid) != 0 ||
                    setuid(pw->pw_uid) != 0) {
index 00b53285faf7796bce19e14d1b792a376955046b..8ef5ffee46431dd3e60510240eeb851d39e0af73 100644 (file)
@@ -307,6 +307,11 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
                }
 
                if (strcasecmp(key, "DRIVER") == 0) {
                }
 
                if (strcasecmp(key, "DRIVER") == 0) {
+                       if (operation != KEY_OP_MATCH &&
+                           operation != KEY_OP_NOMATCH) {
+                               err("invalid DRIVER operation");
+                               goto invalid;
+                       }
                        add_rule_key(rule, &rule->driver, operation, value);
                        valid = 1;
                        continue;
                        add_rule_key(rule, &rule->driver, operation, value);
                        valid = 1;
                        continue;