diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-07-16 13:56:57 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-07-16 18:38:03 +0200 |
commit | b6a80b83bc1c5d7f019b6c15025dda9a423d1fc7 (patch) | |
tree | ddca47fd38ffdb7f0c36061dc351a1d7fca9de63 /src/udev/udev-rules.c | |
parent | update TODO (diff) | |
download | systemd-b6a80b83bc1c5d7f019b6c15025dda9a423d1fc7.tar.xz systemd-b6a80b83bc1c5d7f019b6c15025dda9a423d1fc7.zip |
udev: accept IMPORT{}= without any fuss
Udev logs are full of messages about wrong operator type:
...
Reading rules file: /usr/lib/udev/rules.d/60-persistent-storage.rules
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:54 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:57 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:60 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:63 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:66 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:67 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:93 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:107 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:110 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:113 IMPORT key takes '==' or '!=' operator, assuming '=='.
Reading rules file: /usr/lib/udev/rules.d/60-persistent-v4l.rules
/usr/lib/udev/rules.d/60-persistent-v4l.rules:7 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-v4l.rules:9 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-v4l.rules:16 IMPORT key takes '==' or '!=' operator, assuming '=='.
...
The warning was downgraded in f0beb6f816035e438d684cc52ae76fc4a44fc197, but I
think it should be removed altogether. IMPORT{program}="asdf" seems like an
obvious way to write this, and people don't expect to have to write "==".
So let's just allow any operator.
Diffstat (limited to 'src/udev/udev-rules.c')
-rw-r--r-- | src/udev/udev-rules.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index 2d4eb3d341..c9c01fcc59 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -755,10 +755,8 @@ static int parse_token(UdevRules *rules, const char *key, char *attr, UdevRuleOp check_value_format_and_warn(rules, key, value, true); if (op == OP_REMOVE) return log_token_invalid_op(rules, key); - if (!is_match) { - log_token_debug(rules, "%s key takes '==' or '!=' operator, assuming '=='.", key); + if (!is_match) op = OP_MATCH; - } r = rule_line_add_token(rule_line, TK_M_PROGRAM, op, value, NULL); } else if (streq(key, "IMPORT")) { @@ -767,10 +765,8 @@ static int parse_token(UdevRules *rules, const char *key, char *attr, UdevRuleOp check_value_format_and_warn(rules, key, value, true); if (op == OP_REMOVE) return log_token_invalid_op(rules, key); - if (!is_match) { - log_token_debug(rules, "%s key takes '==' or '!=' operator, assuming '=='.", key); + if (!is_match) op = OP_MATCH; - } if (streq(attr, "file")) r = rule_line_add_token(rule_line, TK_M_IMPORT_FILE, op, value, NULL); |