chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a5df2c5
)
add more warnings for invalid key operations
author
Kay Sievers
<kay.sievers@suse.de>
Sun, 30 Apr 2006 23:45:26 +0000
(
01:45
+0200)
committer
Kay Sievers
<kay.sievers@suse.de>
Sun, 30 Apr 2006 23:45:26 +0000
(
01:45
+0200)
udev_rules_parse.c
patch
|
blob
|
history
diff --git
a/udev_rules_parse.c
b/udev_rules_parse.c
index 442ec65390cef3d71d1bf2247a0644c00f501808..91cc9744fb6cb044e643a62906dbbd9cd628395b 100644
(file)
--- a/
udev_rules_parse.c
+++ b/
udev_rules_parse.c
@@
-342,6
+342,11
@@
static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
}
if (strncasecmp(key, "SYSFS", sizeof("SYSFS")-1) == 0) {
}
if (strncasecmp(key, "SYSFS", sizeof("SYSFS")-1) == 0) {
+ if (operation != KEY_OP_MATCH &&
+ operation != KEY_OP_NOMATCH) {
+ err("invalid SYSFS operation");
+ goto invalid;
+ }
attr = get_key_attribute(key + sizeof("SYSFS")-1);
if (attr == NULL) {
err("error parsing SYSFS attribute in '%s'", line);
attr = get_key_attribute(key + sizeof("SYSFS")-1);
if (attr == NULL) {
err("error parsing SYSFS attribute in '%s'", line);
@@
-421,12
+426,22
@@
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;
}
if (strcasecmp(key, "RESULT") == 0) {
add_rule_key(rule, &rule->driver, operation, value);
valid = 1;
continue;
}
if (strcasecmp(key, "RESULT") == 0) {
+ if (operation != KEY_OP_MATCH &&
+ operation != KEY_OP_NOMATCH) {
+ err("invalid RESULT operation");
+ goto invalid;
+ }
add_rule_key(rule, &rule->result, operation, value);
valid = 1;
continue;
add_rule_key(rule, &rule->result, operation, value);
valid = 1;
continue;