- dbg(rules->udev, "IMPORT is not executable, will be included as file (autotype)\n");
- rule->import_type = IMPORT_FILE;
- }
- }
- add_rule_key(rule, &rule->import, operation, value);
- valid = 1;
- continue;
- }
-
- if (strncasecmp(key, "TEST", sizeof("TEST")-1) == 0) {
- if (operation != KEY_OP_MATCH &&
- operation != KEY_OP_NOMATCH) {
- err(rules->udev, "invalid TEST operation\n");
- goto invalid;
- }
- attr = get_key_attribute(rules, key + sizeof("TEST")-1);
- if (attr != NULL)
- rule->test_mode_mask = strtol(attr, NULL, 8);
- add_rule_key(rule, &rule->test, operation, value);
- valid = 1;
- continue;
- }
-
- if (strncasecmp(key, "RUN", sizeof("RUN")-1) == 0) {
- attr = get_key_attribute(rules, key + sizeof("RUN")-1);
- if (attr != NULL) {
- if (strstr(attr, "ignore_error"))
- rule->run_ignore_error = 1;
- }
- add_rule_key(rule, &rule->run, operation, value);
- valid = 1;
- continue;
- }
-
- if (strcasecmp(key, "WAIT_FOR") == 0 || strcasecmp(key, "WAIT_FOR_SYSFS") == 0) {
- add_rule_key(rule, &rule->wait_for, operation, value);
- valid = 1;
- continue;
- }
-
- if (strcasecmp(key, "LABEL") == 0) {
- add_rule_key(rule, &rule->label, operation, value);
- valid = 1;
- continue;
- }
-
- if (strcasecmp(key, "GOTO") == 0) {
- add_rule_key(rule, &rule->goto_label, operation, value);
- valid = 1;
- continue;
- }
-
- if (strncasecmp(key, "NAME", sizeof("NAME")-1) == 0) {
- attr = get_key_attribute(rules, key + sizeof("NAME")-1);
- if (attr != NULL) {
- if (strstr(attr, "all_partitions") != NULL) {
- dbg(rules->udev, "creation of partition nodes requested\n");
- rule->partitions = DEFAULT_FAKE_PARTITIONS_COUNT;
- }
- if (strstr(attr, "ignore_remove") != NULL) {
- dbg(rules->udev, "remove event should be ignored\n");
- rule->ignore_remove = 1;
- }
- }
- if (value[0] == '\0')
- dbg(rules->udev, "name empty, node creation supressed\n");
- add_rule_key(rule, &rule->name, operation, value);
- continue;
- }
-
- if (strcasecmp(key, "SYMLINK") == 0) {
- if (operation == KEY_OP_MATCH ||
- operation == KEY_OP_NOMATCH)
- add_rule_key(rule, &rule->symlink_match, operation, value);
- else
- add_rule_key(rule, &rule->symlink, operation, value);
- valid = 1;
- continue;
- }
-
- if (strcasecmp(key, "OWNER") == 0) {
- valid = 1;
- if (rules->resolve_names && (!strchr(value, '$') && !strchr(value, '%'))) {
- char *endptr;
- strtoul(value, &endptr, 10);
- if (endptr[0] != '\0') {
- char owner[32];
- uid_t uid = lookup_user(rules->udev, value);
- dbg(rules->udev, "replacing username='%s' by id=%i\n", value, uid);
- sprintf(owner, "%u", (unsigned int) uid);
- add_rule_key(rule, &rule->owner, operation, owner);
- continue;