diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-01-09 16:58:29 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-01-11 23:41:41 -0500 |
commit | d15d0333be6a1ca7fdd99a1881d967b6be8f387a (patch) | |
tree | 488ce214314613658c5eda3b0a94deec31353de7 /CODING_STYLE | |
parent | 1e39ff926f815d241721ed9486945cf599ef8c2f (diff) |
Add new function to filter fstab options
This fixes parsing of options in shared/generator.c. Existing code
had some issues:
- it would treate whitespace and semicolons as seperators. fstab(5)
is pretty clear that only commas matter. And the syntax does
not allow for spaces to be inserted in the field in fstab.
Whitespace might be escaped, but then it should not seperate
options. Treat whitespace and semicolons as any other character.
- it assumed that x-systemd.device-timeout would always be followed
by "=". But this is not guaranteed, hasmntopt will return this
option even if there's no value. Uninitialized memory could be read.
- some error paths would log, and inconsistently, some would just
return an error code.
Filtering is split out to a separate function and tests are added.
Similar code paths in other places are adjusted to use the new function.
Diffstat (limited to 'CODING_STYLE')
0 files changed, 0 insertions, 0 deletions