X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev_rules_parse.c;h=111fead9ad19a1c0579c137b84ae20df500df747;hb=c7c00276f6f26ff7f38e99d887137bc1f172a978;hp=d527bf4bad4a51c8ee397d697124d6a0042217a7;hpb=38895e573c6f17014393dc35a9e53d5f016172c3;p=elogind.git diff --git a/udev_rules_parse.c b/udev_rules_parse.c index d527bf4ba..111fead9a 100644 --- a/udev_rules_parse.c +++ b/udev_rules_parse.c @@ -1,8 +1,6 @@ /* - * udev_rules_parse.c - * * Copyright (C) 2003,2004 Greg Kroah-Hartman - * Copyright (C) 2003-2005 Kay Sievers + * Copyright (C) 2003-2006 Kay Sievers * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -15,7 +13,7 @@ * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ @@ -219,7 +217,7 @@ static int add_rule_key_pair(struct udev_rule *rule, struct key_pairs *pairs, size_t key_len = strnlen(key, PATH_SIZE); if (pairs->count >= PAIRS_MAX) { - err("skip, too many keys in a single rule"); + err("skip, too many keys of the same type in a single rule"); return -1; } @@ -321,12 +319,7 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena continue; } - if (strncasecmp(key, "ATTR", sizeof("ATTR")-1) == 0) { - if (operation != KEY_OP_MATCH && - operation != KEY_OP_NOMATCH) { - err("invalid ATTR operation"); - goto invalid; - } + if (strncasecmp(key, "ATTR{", sizeof("ATTR{")-1) == 0) { attr = get_key_attribute(key + sizeof("ATTR")-1); if (attr == NULL) { err("error parsing ATTR attribute"); @@ -350,7 +343,7 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena continue; } - if (strcasecmp(key, "SUBSYTEMS") == 0 || + if (strcasecmp(key, "SUBSYSTEMS") == 0 || strcasecmp(key, "BUS") == 0) { if (operation != KEY_OP_MATCH && operation != KEY_OP_NOMATCH) { @@ -373,13 +366,8 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena continue; } - if (strncasecmp(key, "ATTRS", sizeof("ATTRS")-1) == 0 || - strncasecmp(key, "SYSFS", sizeof("SYSFS")-1) == 0) { - if (operation != KEY_OP_MATCH && - operation != KEY_OP_NOMATCH) { - err("invalid ATTRSS operation"); - goto invalid; - } + if (strncasecmp(key, "ATTRS{", sizeof("ATTRS{")-1) == 0 || + strncasecmp(key, "SYSFS{", sizeof("SYSFS{")-1) == 0) { attr = get_key_attribute(key + sizeof("ATTRS")-1); if (attr == NULL) { err("error parsing ATTRS attribute"); @@ -391,7 +379,7 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena continue; } - if (strncasecmp(key, "ENV", sizeof("ENV")-1) == 0) { + if (strncasecmp(key, "ENV{", sizeof("ENV{")-1) == 0) { attr = get_key_attribute(key + sizeof("ENV")-1); if (attr == NULL) { err("error parsing ENV attribute");