From: Kay Sievers Date: Fri, 4 May 2012 00:26:08 +0000 (+0200) Subject: udev: fix the ENV{} blacklist logic X-Git-Tag: v183~155 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=395ea97815f0ca2352caeccf3027d026dd9e58a7;p=systemd udev: fix the ENV{} blacklist logic --- diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index a800ccdc..e73b1561 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -1349,11 +1349,12 @@ static int add_rule(struct udev_rules *rules, char *line, }; unsigned int i; - for (i = 0; i < ELEMENTSOF(blacklist); i++) - if (streq(attr, blacklist[i])) { - log_error("invalid ENV attribute, '%s' can not be set %s:%u\n", attr, filename, lineno); + for (i = 0; i < ELEMENTSOF(blacklist); i++) { + if (!streq(attr, blacklist[i])) continue; - } + log_error("invalid ENV attribute, '%s' can not be set %s:%u\n", attr, filename, lineno); + goto invalid; + } if (rule_add_key(&rule_tmp, TK_A_ENV, op, value, attr) != 0) goto invalid; }