chiark / gitweb /
warn if a PHYSEDV* key, the "device" link, or a parent attribute is used
authorKay Sievers <kay.sievers@suse.de>
Mon, 18 Sep 2006 00:01:29 +0000 (02:01 +0200)
committerKay Sievers <kay.sievers@suse.de>
Mon, 18 Sep 2006 00:01:29 +0000 (02:01 +0200)
udev_rules_parse.c

index 111fead9ad19a1c0579c137b84ae20df500df747..bc16f72e2c2cd662bea30d806719c59586e999ea 100644 (file)
@@ -373,6 +373,12 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
                                err("error parsing ATTRS attribute");
                                goto invalid;
                        }
+                       if (strncmp(attr, "device/", 7) == 0)
+                               err("the 'device' link is deprecated and will be removed from a future kernel, "
+                                   "please fix it in %s:%u", filename, lineno);
+                       else if (strchr(attr, '/') != NULL)
+                               err("do not reference parent sysfs directories directly, that may break with a future kernel, "
+                                   "please fix it in %s:%u", filename, lineno);
                        if (add_rule_key_pair(rule, &rule->attrs, operation, attr, value) != 0)
                                goto invalid;
                        valid = 1;
@@ -385,6 +391,9 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
                                err("error parsing ENV attribute");
                                goto invalid;
                        }
+                       if (strncmp(attr, "PHYSDEV", 7) == 0)
+                               err("PHYSDEV* values are deprected and will be removed from a future kernel, "
+                                   "please fix it in %s:%u", filename, lineno);
                        if (add_rule_key_pair(rule, &rule->env, operation, attr, value) != 0)
                                goto invalid;
                        valid = 1;