[PATCH] more config file parsing robustness
udev kept on segfaulting when it was in use, and not having the time (and building it with DEBUG=true showing nothing), I have not tracked it until tonight. Seems like I made a type-o, and forgotten the ':' between one line's group and permission parameters. Attached patch should stop the segfault, and warn at that at least.
This commit is contained in:
parent
49d72e4348
commit
befd83cc4e
|
@ -464,6 +464,10 @@ static int namedev_init_permissions(void)
|
||||||
}
|
}
|
||||||
strncpy(dev.group, temp2, sizeof(dev.owner));
|
strncpy(dev.group, temp2, sizeof(dev.owner));
|
||||||
|
|
||||||
|
if (!temp) {
|
||||||
|
dbg("cannot parse line: %s", line);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
dev.mode = strtol(temp, NULL, 8);
|
dev.mode = strtol(temp, NULL, 8);
|
||||||
|
|
||||||
dbg_parse("name='%s', owner='%s', group='%s', mode=%#o",
|
dbg_parse("name='%s', owner='%s', group='%s', mode=%#o",
|
||||||
|
|
Loading…
Reference in New Issue