- rule.config_line = lineno;
- strlcpy(rule.config_file, filename, sizeof(rule.config_file));
- retval = add_rule_to_list(&rule);
- if (retval) {
- dbg("add_rule_to_list returned with error %d", retval);
+ if (strcasecmp(key, "OPTIONS") == 0) {
+ const char *pos;
+
+ if (strstr(value, "last_rule") != NULL) {
+ dbg("last rule to be applied\n");
+ rule->last_rule = 1;
+ }
+ if (strstr(value, "ignore_device") != NULL) {
+ dbg("device should be ignored\n");
+ rule->ignore_device = 1;
+ }
+ if (strstr(value, "ignore_remove") != NULL) {
+ dbg("remove event should be ignored\n");
+ rule->ignore_remove = 1;
+ }
+ pos = strstr(value, "link_priority=");
+ if (pos != NULL) {
+ rule->link_priority = atoi(&pos[strlen("link_priority=")]);
+ dbg("link priority=%i\n", rule->link_priority);
+ }
+ pos = strstr(value, "event_timeout=");
+ if (pos != NULL) {
+ rule->event_timeout = atoi(&pos[strlen("event_timeout=")]);
+ dbg("event timout=%i\n", rule->event_timeout);
+ }
+ pos = strstr(value, "string_escape=");
+ if (pos != NULL) {
+ pos = &pos[strlen("string_escape=")];
+ if (strncmp(pos, "none", strlen("none")) == 0)
+ rule->string_escape = ESCAPE_NONE;
+ else if (strncmp(pos, "replace", strlen("replace")) == 0)
+ rule->string_escape = ESCAPE_REPLACE;
+ }
+ if (strstr(value, "all_partitions") != NULL) {
+ dbg("creation of partition nodes requested\n");
+ rule->partitions = DEFAULT_PARTITIONS_COUNT;
+ }
+ valid = 1;