mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 14:40:31 +00:00
print warning for invalid TEST operations
This commit is contained in:
@@ -994,7 +994,8 @@ static int match_rule(struct udevice *udev, struct udev_rule *rule)
|
||||
}
|
||||
}
|
||||
|
||||
if (rule->test.operation != KEY_OP_UNSET) {
|
||||
if (rule->test.operation == KEY_OP_MATCH ||
|
||||
rule->test.operation == KEY_OP_NOMATCH) {
|
||||
char filename[PATH_SIZE];
|
||||
char devpath[PATH_SIZE];
|
||||
char *attr;
|
||||
|
||||
@@ -469,6 +469,11 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
|
||||
}
|
||||
|
||||
if (strncasecmp(key, "TEST", sizeof("TEST")-1) == 0) {
|
||||
if (operation != KEY_OP_MATCH &&
|
||||
operation != KEY_OP_NOMATCH) {
|
||||
err("invalid TEST operation");
|
||||
goto invalid;
|
||||
}
|
||||
attr = get_key_attribute(key + sizeof("TEST")-1);
|
||||
if (attr != NULL)
|
||||
rule->test_mode_mask = strtol(attr, NULL, 8);
|
||||
|
||||
Reference in New Issue
Block a user