chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7959ff9
)
udev-rules: report rule parsing errors from get_key
author
Dave Reisner
<dreisner@archlinux.org>
Mon, 29 Jul 2013 22:18:43 +0000
(18:18 -0400)
committer
Dave Reisner
<dreisner@archlinux.org>
Tue, 30 Jul 2013 01:51:58 +0000
(21:51 -0400)
src/udev/udev-rules.c
patch
|
blob
|
history
diff --git
a/src/udev/udev-rules.c
b/src/udev/udev-rules.c
index 769b670b20a1e16b1d44306f517f2709509b0fe4..e4facd7bd2a435fd249d03b546f29fd43637a322 100644
(file)
--- a/
src/udev/udev-rules.c
+++ b/
src/udev/udev-rules.c
@@
-1066,8
+1066,15
@@
static int add_rule(struct udev_rules *rules, char *line,
char *value;
enum operation_type op;
char *value;
enum operation_type op;
- if (get_key(rules->udev, &linepos, &key, &op, &value) != 0)
+ if (get_key(rules->udev, &linepos, &key, &op, &value) != 0) {
+ /* If we aren't at the end of the line, this is a parsing error.
+ * Make a best effort to describe where the problem is. */
+ if (*linepos != '\n')
+ log_error("invalid key/value pair in file %s on line %u,"
+ "starting at character %lu\n",
+ filename, lineno, linepos - line + 1);
break;
break;
+ }
if (streq(key, "ACTION")) {
if (op > OP_MATCH_MAX) {
if (streq(key, "ACTION")) {
if (op > OP_MATCH_MAX) {