summaryrefslogtreecommitdiff
path: root/udev_rules_parse.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2006-08-20 18:15:29 +0200
committerKay Sievers <kay.sievers@suse.de>2006-08-20 18:15:29 +0200
commit38895e573c6f17014393dc35a9e53d5f016172c3 (patch)
treee30c5e7bcf4dbba5dc9704689f1fefb9e61aa7dc /udev_rules_parse.c
parent95776dc6ec174f47fa4dd4d8abf5d457223e5dd4 (diff)
skip rule, if too may keys of the same type are used
Diffstat (limited to 'udev_rules_parse.c')
-rw-r--r--udev_rules_parse.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/udev_rules_parse.c b/udev_rules_parse.c
index 5e93e60d4f..d527bf4bad 100644
--- a/udev_rules_parse.c
+++ b/udev_rules_parse.c
@@ -329,10 +329,11 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
}
attr = get_key_attribute(key + sizeof("ATTR")-1);
if (attr == NULL) {
- err("error parsing ATTR attribute in '%s'", line);
- continue;
+ err("error parsing ATTR attribute");
+ goto invalid;
}
- add_rule_key_pair(rule, &rule->attr, operation, attr, value);
+ if (add_rule_key_pair(rule, &rule->attr, operation, attr, value) != 0)
+ goto invalid;
valid = 1;
continue;
}
@@ -381,10 +382,11 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
}
attr = get_key_attribute(key + sizeof("ATTRS")-1);
if (attr == NULL) {
- err("error parsing ATTRS attribute in '%s'", line);
- continue;
+ err("error parsing ATTRS attribute");
+ goto invalid;
}
- add_rule_key_pair(rule, &rule->attrs, operation, attr, value);
+ if (add_rule_key_pair(rule, &rule->attrs, operation, attr, value) != 0)
+ goto invalid;
valid = 1;
continue;
}
@@ -393,9 +395,10 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
attr = get_key_attribute(key + sizeof("ENV")-1);
if (attr == NULL) {
err("error parsing ENV attribute");
- continue;
+ goto invalid;
}
- add_rule_key_pair(rule, &rule->env, operation, attr, value);
+ if (add_rule_key_pair(rule, &rule->env, operation, attr, value) != 0)
+ goto invalid;
valid = 1;
continue;
}