udev-rules.c revision 91a75e4ad4071d9d0ce1adb5c8d8272aac379d0a
/*
* Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <ctype.h>
#include <unistd.h>
#include <errno.h>
#include <dirent.h>
#include <fnmatch.h>
#include "udev.h"
#define PREALLOC_TOKEN 2048
/* KEY=="", KEY!="", KEY+="", KEY="", KEY:="" */
enum operation_type {
};
static const char *operation_str[] = {
[OP_UNSET] = "UNSET",
[OP_MATCH] = "match",
[OP_NOMATCH] = "nomatch",
[OP_MATCH_MAX] = "MATCH_MAX",
[OP_ADD] = "add",
[OP_ASSIGN] = "assign",
[OP_ASSIGN_FINAL] = "assign-final",
};
enum string_glob_type {
GL_PLAIN, /* no special chars */
GL_GLOB, /* shell globs ?,*,[] */
GL_SPLIT, /* multi-value A|B */
GL_SPLIT_GLOB, /* multi-value with glob A*|B* */
GL_SOMETHING, /* commonly used "?*" */
};
#ifdef DEBUG
static const char *string_glob_str[] = {
[GL_UNSET] = "UNSET",
[GL_PLAIN] = "plain",
[GL_GLOB] = "glob",
[GL_SPLIT] = "split",
[GL_SPLIT_GLOB] = "split-glob",
[GL_SOMETHING] = "split-glob",
[GL_FORMAT] = "format",
};
#endif
enum token_type {
TK_M_ACTION, /* val */
TK_M_DEVPATH, /* val */
TK_M_KERNEL, /* val */
TK_M_DEVLINK, /* val */
TK_M_NAME, /* val */
TK_M_ENV, /* val, attr */
TK_M_SUBSYSTEM, /* val */
TK_M_DRIVER, /* val */
TK_M_WAITFOR, /* val */
TK_M_ATTR, /* val, attr */
TK_M_KERNELS, /* val */
TK_M_SUBSYSTEMS, /* val */
TK_M_DRIVERS, /* val */
TK_M_ATTRS, /* val, attr */
TK_M_TEST, /* val, mode_t */
TK_M_PROGRAM, /* val */
TK_M_IMPORT_FILE, /* val */
TK_M_IMPORT_PROG, /* val */
TK_M_IMPORT_PARENT, /* val */
TK_M_RESULT, /* val */
TK_A_NUM_FAKE_PART, /* int */
TK_A_DEVLINK_PRIO, /* int */
TK_A_OWNER, /* val */
TK_A_GROUP, /* val */
TK_A_MODE, /* val */
TK_A_OWNER_ID, /* uid_t */
TK_A_GROUP_ID, /* gid_t */
TK_A_MODE_ID, /* mode_t */
TK_A_ENV, /* val, attr */
TK_A_NAME, /* val */
TK_A_DEVLINK, /* val */
TK_A_EVENT_TIMEOUT, /* int */
TK_A_ATTR, /* val, attr */
TK_A_RUN, /* val, bool */
TK_A_GOTO, /* size_t */
};
static const char *token_str[] = {
[TK_UNSET] = "UNSET",
[TK_RULE] = "RULE",
[TK_M_ACTION] = "M ACTION",
[TK_M_DEVPATH] = "M DEVPATH",
[TK_M_KERNEL] = "M KERNEL",
[TK_M_DEVLINK] = "M DEVLINK",
[TK_M_NAME] = "M NAME",
[TK_M_ENV] = "M ENV",
[TK_M_SUBSYSTEM] = "M SUBSYSTEM",
[TK_M_DRIVER] = "M DRIVER",
[TK_M_WAITFOR] = "M WAITFOR",
[TK_M_ATTR] = "M ATTR",
[TK_M_KERNELS] = "M KERNELS",
[TK_M_SUBSYSTEMS] = "M SUBSYSTEMS",
[TK_M_DRIVERS] = "M DRIVERS",
[TK_M_ATTRS] = "M ATTRS",
[TK_M_PARENTS_MAX] = "M PARENTS_MAX",
[TK_M_TEST] = "M TEST",
[TK_M_PROGRAM] = "M PROGRAM",
[TK_M_IMPORT_FILE] = "M IMPORT_FILE",
[TK_M_IMPORT_PROG] = "M IMPORT_PROG",
[TK_M_IMPORT_PARENT] = "M MPORT_PARENT",
[TK_M_RESULT] = "M RESULT",
[TK_M_MAX] = "M MAX",
[TK_A_IGNORE_DEVICE] = "A IGNORE_DEVICE",
[TK_A_STRING_ESCAPE_NONE] = "A STRING_ESCAPE_NONE",
[TK_A_STRING_ESCAPE_REPLACE] = "A STRING_ESCAPE_REPLACE",
[TK_A_NUM_FAKE_PART] = "A NUM_FAKE_PART",
[TK_A_DEVLINK_PRIO] = "A DEVLINK_PRIO",
[TK_A_OWNER] = "A OWNER",
[TK_A_GROUP] = "A GROUP",
[TK_A_MODE] = "A MODE",
[TK_A_OWNER_ID] = "A OWNER_ID",
[TK_A_GROUP_ID] = "A GROUP_ID",
[TK_A_MODE_ID] = "A MODE_ID",
[TK_A_ENV] = "A ENV",
[TK_A_NAME] = "A NAME",
[TK_A_DEVLINK] = "A DEVLINK",
[TK_A_EVENT_TIMEOUT] = "A EVENT_TIMEOUT",
[TK_A_IGNORE_REMOVE] = "A IGNORE_REMOVE",
[TK_A_ATTR] = "A ATTR",
[TK_A_RUN] = "A RUN",
[TK_A_GOTO] = "A GOTO",
[TK_A_LAST_RULE] = "A LAST_RULE",
[TK_END] = "END",
};
struct token {
enum token_type type;
union {
struct {
unsigned int next_rule;
unsigned int label_off;
unsigned int filename_off;
} rule;
struct {
unsigned short op;
unsigned short glob;
unsigned int value_off;
union {
unsigned int attr_off;
int ignore_error;
int i;
unsigned int rule_goto;
int num_fake_part;
int devlink_prio;
int event_timeout;
};
} key;
};
};
#define MAX_TK 64
struct rule_tmp {
struct udev_rules *rules;
unsigned int token_cur;
};
struct uid_gid {
unsigned int name_off;
union {
};
};
struct udev_rules {
int resolve_names;
/* every key in the rules file becomes a token */
unsigned int token_cur;
unsigned int token_max;
/* all key strings are copied to a single string buffer */
char *buf;
unsigned int buf_count;
unsigned int uids_cur;
unsigned int uids_max;
unsigned int gids_cur;
unsigned int gids_max;
};
/* NOTE: we could lookup and return existing strings, or tails of strings */
{
int off;
/* offset 0 is always '\0' */
if (str[0] == '\0')
return 0;
/* grow buffer if needed */
char *buf;
unsigned int add;
/* double the buffer size */
return -1;
}
return off;
}
{
/* grow buffer if needed */
unsigned int add;
/* double the buffer size */
if (add < 8)
add = 8;
return -1;
}
return 0;
}
{
unsigned int i;
unsigned int off;
/* lookup, if we know it already */
return uid;
}
}
/* grow buffer if needed */
unsigned int add;
/* double the buffer size */
if (add < 1)
add = 8;
return uid;
}
if (off <= 0)
return uid;
return uid;
}
{
unsigned int i;
unsigned int off;
/* lookup, if we know it already */
return gid;
}
}
/* grow buffer if needed */
unsigned int add;
/* double the buffer size */
if (add < 1)
add = 8;
return gid;
}
if (off <= 0)
return gid;
return gid;
}
{
char *key;
char *val;
/* find key */
key++;
/* comment or empty line */
return -1;
return -1;
val[0] = '\0';
val++;
/* find value */
val++;
/* terminate key */
if (len == 0)
return -1;
len--;
/* terminate value */
if (len == 0)
return -1;
len--;
if (len == 0)
return -1;
/* unquote */
return -1;
}
val++;
}
/* handle device, renamed by external tool, returning new path */
char syspath[UTIL_PATH_SIZE];
} else {
struct udev_list_entry *entry;
/* store in db */
}
return 0;
}
{
FILE *f;
char line[UTIL_LINE_SIZE];
if (f == NULL)
return -1;
fclose(f);
return 0;
}
{
char **envp;
char result[2048];
char *line;
return -1;
char *pos;
pos[0] = '\0';
}
}
return 0;
}
{
struct udev_device *dev_parent;
struct udev_list_entry *list_entry;
if (dev_parent == NULL)
return -1;
struct udev_list_entry *entry;
/* store in db */
}
}
return 0;
}
#define WAIT_LOOP_PER_SECOND 50
{
char filepath[UTIL_PATH_SIZE];
/* a relative path is a device attribute */
if (file[0] != '/') {
}
while (--loop) {
/* lookup file */
return 0;
}
/* make sure, the device did not disappear in the meantime */
return -2;
}
}
return -1;
}
{
char *pos;
int found = 0;
char str[UTIL_PATH_SIZE];
continue;
found = 1;
break;
}
}
}
if (!found)
}
return found;
}
static int get_key(struct udev *udev, char **line, char **key, enum operation_type *op, char **value)
{
char *linepos;
char *temp;
return -1;
/* skip whitespace */
linepos++;
/* get the key */
if (linepos[0] == '\0')
return -1;
while (1) {
linepos++;
if (linepos[0] == '\0')
return -1;
break;
if (linepos[0] == '=')
break;
break;
}
/* remember end of key */
/* skip whitespace after key */
linepos++;
if (linepos[0] == '\0')
return -1;
/* get operation type */
linepos += 2;
*op = OP_NOMATCH;
linepos += 2;
linepos += 2;
} else if (linepos[0] == '=') {
linepos++;
*op = OP_ASSIGN_FINAL;
linepos += 2;
} else
return -1;
/* terminate key */
temp[0] = '\0';
/* skip whitespace after operator */
linepos++;
if (linepos[0] == '\0')
return -1;
/* get the value */
if (linepos[0] == '"')
linepos++;
else
return -1;
/* terminate */
if (!temp)
return -1;
temp[0] = '\0';
temp++;
/* move line to next key */
return 0;
}
/* extract possible KEY{attr} */
{
char *pos;
char *attr;
attr++;
return NULL;
}
pos[0] = '\0';
return attr;
}
return NULL;
}
enum operation_type op,
{
enum string_glob_type glob;
switch (type) {
case TK_M_ACTION:
case TK_M_DEVPATH:
case TK_M_KERNEL:
case TK_M_SUBSYSTEM:
case TK_M_DRIVER:
case TK_M_WAITFOR:
case TK_M_DEVLINK:
case TK_M_NAME:
case TK_M_KERNELS:
case TK_M_SUBSYSTEMS:
case TK_M_DRIVERS:
case TK_M_PROGRAM:
case TK_M_IMPORT_FILE:
case TK_M_IMPORT_PROG:
case TK_M_IMPORT_PARENT:
case TK_M_RESULT:
case TK_A_OWNER:
case TK_A_GROUP:
case TK_A_MODE:
case TK_A_NAME:
case TK_A_DEVLINK:
case TK_A_GOTO:
break;
case TK_M_ENV:
case TK_M_ATTR:
case TK_M_ATTRS:
case TK_A_ATTR:
case TK_A_ENV:
break;
case TK_M_TEST:
break;
case TK_A_IGNORE_DEVICE:
case TK_A_STRING_ESCAPE_NONE:
case TK_A_IGNORE_REMOVE:
case TK_A_LAST_RULE:
break;
case TK_A_RUN:
break;
case TK_A_NUM_FAKE_PART:
break;
case TK_A_DEVLINK_PRIO:
break;
case TK_A_OWNER_ID:
break;
case TK_A_GROUP_ID:
break;
case TK_A_MODE_ID:
break;
case TK_A_EVENT_TIMEOUT:
break;
case TK_RULE:
case TK_M_PARENTS_MAX:
case TK_M_MAX:
case TK_END:
case TK_UNSET:
return -1;
}
/* check if we need to split or call fnmatch() while matching rules */
int has_split;
int has_glob;
} else if (has_split) {
} else if (has_glob) {
glob = GL_SOMETHING;
else
}
} else {
/* check if we need to substitute format strings for matching rules */
}
}
return -1;
}
return 0;
}
#ifdef DEBUG
{
switch (type) {
case TK_RULE:
{
break;
}
case TK_M_ACTION:
case TK_M_DEVPATH:
case TK_M_KERNEL:
case TK_M_SUBSYSTEM:
case TK_M_DRIVER:
case TK_M_WAITFOR:
case TK_M_DEVLINK:
case TK_M_NAME:
case TK_M_KERNELS:
case TK_M_SUBSYSTEMS:
case TK_M_DRIVERS:
case TK_M_PROGRAM:
case TK_M_IMPORT_FILE:
case TK_M_IMPORT_PROG:
case TK_M_IMPORT_PARENT:
case TK_M_RESULT:
case TK_A_NAME:
case TK_A_DEVLINK:
case TK_A_OWNER:
case TK_A_GROUP:
case TK_A_MODE:
case TK_A_RUN:
break;
case TK_M_ATTR:
case TK_M_ATTRS:
case TK_M_ENV:
case TK_A_ATTR:
case TK_A_ENV:
break;
case TK_A_IGNORE_DEVICE:
case TK_A_STRING_ESCAPE_NONE:
case TK_A_LAST_RULE:
case TK_A_IGNORE_REMOVE:
break;
case TK_M_TEST:
break;
case TK_A_NUM_FAKE_PART:
break;
case TK_A_DEVLINK_PRIO:
break;
case TK_A_OWNER_ID:
break;
case TK_A_GROUP_ID:
break;
case TK_A_MODE_ID:
break;
case TK_A_EVENT_TIMEOUT:
break;
case TK_A_GOTO:
break;
case TK_END:
break;
case TK_M_PARENTS_MAX:
case TK_M_MAX:
case TK_UNSET:
break;
}
}
{
unsigned int i;
}
#else
#endif /* DEBUG */
{
unsigned int i;
unsigned int start = 0;
unsigned int next_idx;
unsigned int j;
/* find smallest value */
continue;
next_idx = j;
}
}
/* add token and mark done */
return -1;
/* shrink range */
start++;
end--;
}
return 0;
}
{
int valid = 0;
char *linepos;
char *attr;
int physdev = 0;
while (1) {
char *key;
char *value;
enum operation_type op;
break;
if (op > OP_MATCH_MAX) {
goto invalid;
}
valid = 1;
continue;
}
if (op > OP_MATCH_MAX) {
goto invalid;
}
valid = 1;
continue;
}
if (op > OP_MATCH_MAX) {
goto invalid;
}
valid = 1;
continue;
}
if (op > OP_MATCH_MAX) {
goto invalid;
}
/* bus, class, subsystem events should all be the same */
} else
valid = 1;
continue;
}
if (op > OP_MATCH_MAX) {
goto invalid;
}
valid = 1;
continue;
}
goto invalid;
}
if (op < OP_MATCH_MAX) {
} else {
}
valid = 1;
continue;
}
if (op > OP_MATCH_MAX) {
goto invalid;
}
valid = 1;
continue;
}
if (op > OP_MATCH_MAX) {
goto invalid;
}
valid = 1;
continue;
}
if (op > OP_MATCH_MAX) {
goto invalid;
}
valid = 1;
continue;
}
if (op > OP_MATCH_MAX) {
goto invalid;
}
goto invalid;
}
valid = 1;
continue;
}
goto invalid;
}
physdev = 1;
if (op < OP_MATCH_MAX) {
goto invalid;
} else {
goto invalid;
}
valid = 1;
continue;
}
valid = 1;
continue;
}
if (op > OP_MATCH_MAX) {
goto invalid;
}
valid = 1;
continue;
}
valid = 1;
valid = 1;
valid = 1;
} else {
/* figure it out if it is executable */
char file[UTIL_PATH_SIZE];
char *pos;
if (pos)
pos[0] = '\0';
if (pos)
pos[0] = '\0';
}
valid = 1;
} else {
valid = 1;
}
}
continue;
}
if (op > OP_MATCH_MAX) {
goto invalid;
}
} else {
}
valid = 1;
continue;
}
int flag = 0;
flag = 1;
valid = 1;
continue;
}
valid = 1;
continue;
}
valid = 1;
continue;
}
valid = 1;
continue;
}
if (op < OP_MATCH_MAX) {
} else {
if (value[0] == '\0')
int num = DEFAULT_FAKE_PARTITIONS_COUNT;
}
}
}
}
continue;
}
if (op < OP_MATCH_MAX)
else
valid = 1;
continue;
}
char *endptr;
if (endptr[0] == '\0') {
} else {
}
valid = 1;
continue;
}
char *endptr;
if (endptr[0] == '\0') {
} else {
}
valid = 1;
continue;
}
char *endptr;
if (endptr[0] == '\0')
else
valid = 1;
continue;
}
const char *pos;
}
}
}
}
}
}
int num = DEFAULT_FAKE_PARTITIONS_COUNT;
}
valid = 1;
continue;
}
}
if (physdev)
/* skip line if not any valid key was found */
if (!valid)
goto invalid;
/* add rule token */
goto invalid;
/* add tokens to list, sorted by type */
goto invalid;
return 0;
return -1;
}
{
FILE *f;
unsigned int filename_off;
unsigned int first_token;
char line[UTIL_LINE_SIZE];
int line_nr = 0;
unsigned int i;
if (f == NULL)
return -1;
char *key;
/* skip whitespace */
line_nr++;
key++;
/* comment */
if (key[0] == '#')
continue;
if (len < 3)
continue;
/* continue reading if backslash+newline is found */
break;
line_nr++;
}
continue;
}
}
fclose(f);
/* link GOTOs to LABEL rules in this file to be able to fast-forward */
unsigned int j;
continue;
continue;
continue;
}
}
}
return 0;
}
static int add_matching_files(struct udev *udev, struct udev_list_node *file_list, const char *dirname, const char *suffix)
{
char filename[UTIL_PATH_SIZE];
return -1;
}
while (1) {
break;
continue;
/* look for file matching with specified suffix */
const char *ext;
continue;
continue;
}
}
return 0;
}
{
struct udev_rules *rules;
struct udev_list_node file_list;
unsigned int prev_rule;
unsigned int i;
return NULL;
/* init token array and string buffer */
return NULL;
return NULL;
/* offset 0 is always '\0' */
/* custom rules location for testing */
} else {
struct udev_list_node sort_list;
}
/* read default rules */
/* sort all rules files by basename into list of files */
continue;
continue;
break;
}
break;
}
}
}
/* parse list of files */
else
}
/* link all TK_RULE tokens to be able to fast-forward to next TK_RULE */
prev_rule = 0;
prev_rule = i;
}
}
/* shrink allocated token and string buffer */
}
}
char *buf;
}
}
return rules;
}
{
return;
}
{
char *pos;
int match = 0;
val = "";
case GL_PLAIN:
break;
case GL_GLOB:
break;
case GL_SPLIT:
{
const char *split;
while (1) {
const char *next;
if (match)
break;
} else {
break;
}
}
break;
}
case GL_SPLIT_GLOB:
{
char value[UTIL_PATH_SIZE];
pos[0] = '\0';
}
if (match)
break;
}
break;
}
case GL_SOMETHING:
break;
case GL_FORMAT:
case GL_UNSET:
return -1;
}
return 0;
}
return 0;
}
return -1;
}
static int match_attr(struct udev_rules *rules, struct udev_device *dev, struct udev_event *event, struct token *cur)
{
char attr[UTIL_PATH_SIZE];
if (value[0] == '\0') {
const char *val;
}
if (value[0]=='\0')
return -1;
/* strip trailing whitespace of value, if not asked to match for it */
}
}
enum escape_type {
};
{
return -1;
/* loop through token list, match, run actions or forward to next rule */
unsigned int idx;
case TK_RULE:
/* current rule */
esc = ESCAPE_UNSET;
break;
case TK_M_ACTION:
goto nomatch;
break;
case TK_M_DEVPATH:
goto nomatch;
break;
case TK_M_KERNEL:
goto nomatch;
break;
case TK_M_DEVLINK:
{
struct udev_list_entry *list_entry;
int match = 0;
const char *devlink;
match = 1;
break;
}
}
if (!match)
goto nomatch;
break;
}
case TK_M_NAME:
goto nomatch;
break;
case TK_M_ENV:
{
struct udev_list_entry *list_entry;
const char *value;
value = "";
}
goto nomatch;
break;
}
case TK_M_SUBSYSTEM:
goto nomatch;
break;
case TK_M_DRIVER:
goto nomatch;
break;
case TK_M_WAITFOR:
{
char filename[UTIL_PATH_SIZE];
int found;
goto nomatch;
break;
}
case TK_M_ATTR:
goto nomatch;
break;
case TK_M_KERNELS:
case TK_M_SUBSYSTEMS:
case TK_M_DRIVERS:
case TK_M_ATTRS:
{
/* get whole sequence of parent matches */
next++;
/* loop over parents */
while (1) {
/* loop over sequence of parent match keys */
case TK_M_KERNELS:
goto try_parent;
break;
case TK_M_SUBSYSTEMS:
goto try_parent;
break;
case TK_M_DRIVERS:
goto try_parent;
break;
case TK_M_ATTRS:
goto try_parent;
break;
default:
goto nomatch;
}
}
/* all keys matched */
break;
goto nomatch;
}
/* move behind our sequence of parent match keys */
continue;
}
case TK_M_TEST:
{
char filename[UTIL_PATH_SIZE];
int match;
if (filename[0] != '/') {
char tmp[UTIL_PATH_SIZE];
}
}
goto nomatch;
goto nomatch;
break;
}
case TK_M_PROGRAM:
{
char program[UTIL_PATH_SIZE];
char **envp;
char result[UTIL_PATH_SIZE];
goto nomatch;
} else {
int count;
if (count > 0)
}
goto nomatch;
}
break;
}
case TK_M_IMPORT_FILE:
{
char import[UTIL_PATH_SIZE];
goto nomatch;
break;
}
case TK_M_IMPORT_PROG:
{
char import[UTIL_PATH_SIZE];
goto nomatch;
break;
}
case TK_M_IMPORT_PARENT:
{
char import[UTIL_PATH_SIZE];
goto nomatch;
break;
}
case TK_M_RESULT:
goto nomatch;
break;
case TK_A_IGNORE_DEVICE:
return 0;
break;
case TK_A_STRING_ESCAPE_NONE:
esc = ESCAPE_NONE;
break;
break;
case TK_A_NUM_FAKE_PART:
break;
break;
break;
case TK_A_DEVLINK_PRIO:
break;
case TK_A_OWNER:
{
char owner[UTIL_NAME_SIZE];
if (event->owner_final)
break;
break;
}
case TK_A_GROUP:
{
char group[UTIL_NAME_SIZE];
if (event->group_final)
break;
break;
}
case TK_A_MODE:
{
char mode[UTIL_NAME_SIZE];
char *endptr;
if (event->mode_final)
break;
if (endptr[0] != '\0') {
}
break;
}
case TK_A_OWNER_ID:
if (event->owner_final)
break;
break;
case TK_A_GROUP_ID:
if (event->group_final)
break;
break;
case TK_A_MODE_ID:
if (event->mode_final)
break;
break;
case TK_A_ENV:
{
if (value[0] != '\0') {
char temp_value[UTIL_NAME_SIZE];
struct udev_list_entry *entry;
/* store in db */
} else {
}
break;
}
case TK_A_NAME:
{
char name_str[UTIL_PATH_SIZE];
int count;
if (event->name_final)
break;
if (name[0] == '\0') {
break;
}
if (count > 0)
}
break;
}
case TK_A_DEVLINK:
{
char temp[UTIL_PATH_SIZE];
char filename[UTIL_PATH_SIZE];
int count = 0;
if (event->devlink_final)
break;
break;
/* allow multiple symlinks separated by spaces */
if (esc == ESCAPE_UNSET)
else if (esc == ESCAPE_REPLACE)
if (count > 0)
pos++;
while (next) {
next[0] = '\0';
next++;
}
if (pos[0] != '\0') {
}
}
break;
case TK_A_EVENT_TIMEOUT:
break;
case TK_A_IGNORE_REMOVE:
break;
case TK_A_ATTR:
{
char attr[UTIL_PATH_SIZE];
char value[UTIL_NAME_SIZE];
FILE *f;
}
if (f != NULL) {
fclose(f);
} else {
}
break;
}
case TK_A_RUN:
{
struct udev_list_entry *list_entry;
break;
}
case TK_A_GOTO:
continue;
case TK_A_LAST_RULE:
break;
case TK_M_PARENTS_MAX:
case TK_M_MAX:
case TK_END:
case TK_UNSET:
goto nomatch;
}
cur++;
continue;
/* fast-forward to next rule */
if (idx == 0)
break;
}
return 0;
}