- if (strcasecmp(key, "DEVPATH") == 0) {
- add_rule_key(rule, &rule->devpath, operation, value);
+ if (strncasecmp(key, "ATTR{", sizeof("ATTR{")-1) == 0) {
+ attr = get_key_attribute(key + sizeof("ATTR")-1);
+ if (attr == NULL) {
+ err("error parsing ATTR attribute");
+ goto invalid;
+ }
+ if (add_rule_key_pair(rule, &rule->attr, operation, attr, value) != 0)
+ goto invalid;
+ valid = 1;
+ continue;
+ }
+
+ if (strcasecmp(key, "KERNELS") == 0 ||
+ strcasecmp(key, "ID") == 0) {
+ if (operation != KEY_OP_MATCH &&
+ operation != KEY_OP_NOMATCH) {
+ err("invalid KERNELS operation");
+ goto invalid;
+ }
+ add_rule_key(rule, &rule->kernels, operation, value);