summaryrefslogtreecommitdiff
path: root/src/shared/util.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-01-09 16:58:29 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-01-11 23:41:41 -0500
commitd15d0333be6a1ca7fdd99a1881d967b6be8f387a (patch)
tree488ce214314613658c5eda3b0a94deec31353de7 /src/shared/util.h
parent1e39ff926f815d241721ed9486945cf599ef8c2f (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 'src/shared/util.h')
-rw-r--r--src/shared/util.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/shared/util.h b/src/shared/util.h
index 141a3feab6..b337249faa 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -1010,8 +1010,6 @@ const char *personality_to_string(unsigned long);
uint64_t physical_memory(void);
-char* mount_test_option(const char *haystack, const char *needle);
-
void hexdump(FILE *f, const void *p, size_t s);
union file_handle_union {