1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-13 13:17:43 +03:00

add more warnings for invalid key operations

This commit is contained in:
Kay Sievers 2006-05-01 01:45:26 +02:00
parent a5df2c5732
commit b1c4f377c4

View File

@ -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 (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);
@ -421,12 +426,22 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
}
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) {
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;