summaryrefslogtreecommitdiff
path: root/src/fstab-generator
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-03-11 11:10:32 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-03-11 11:25:15 +0100
commitd6cef552dcb4764a89269ce9603eb21f348d911a (patch)
treece40e5a18e760bdcda7c9910bddab759fd0829b2 /src/fstab-generator
parentff0c31bc2722eed528eae6644a104e85ed97f2f1 (diff)
downloadsystemd-d6cef552dcb4764a89269ce9603eb21f348d911a.tar.gz
fstab-generator: get rid of fstab_extract_values()
This was a parallel implementation of option parsing that didn't support escaping of separators. Let's port this over to the common code. Fixes #18952.
Diffstat (limited to 'src/fstab-generator')
-rw-r--r--src/fstab-generator/fstab-generator.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index b454a5980d..8c1087a9a3 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -241,7 +241,7 @@ static int write_dependency(
assert(f);
assert(opts);
- r = fstab_extract_values(opts, filter, &names);
+ r = fstab_filter_options(opts, filter, NULL, NULL, &names, NULL);
if (r < 0)
return log_warning_errno(r, "Failed to parse options: %m");
if (r == 0)
@@ -274,17 +274,17 @@ static int write_dependency(
static int write_after(FILE *f, const char *opts) {
return write_dependency(f, opts,
- "x-systemd.after", "After=%1$s\n");
+ "x-systemd.after\0", "After=%1$s\n");
}
static int write_requires_after(FILE *f, const char *opts) {
return write_dependency(f, opts,
- "x-systemd.requires", "After=%1$s\nRequires=%1$s\n");
+ "x-systemd.requires\0", "After=%1$s\nRequires=%1$s\n");
}
static int write_before(FILE *f, const char *opts) {
return write_dependency(f, opts,
- "x-systemd.before", "Before=%1$s\n");
+ "x-systemd.before\0", "Before=%1$s\n");
}
static int write_requires_mounts_for(FILE *f, const char *opts) {
@@ -295,7 +295,7 @@ static int write_requires_mounts_for(FILE *f, const char *opts) {
assert(f);
assert(opts);
- r = fstab_extract_values(opts, "x-systemd.requires-mounts-for", &paths);
+ r = fstab_filter_options(opts, "x-systemd.requires-mounts-for\0", NULL, NULL, &paths, NULL);
if (r < 0)
return log_warning_errno(r, "Failed to parse options: %m");
if (r == 0)
@@ -376,11 +376,11 @@ static int add_mount(
mount_point_ignore(where))
return 0;
- r = fstab_extract_values(opts, "x-systemd.wanted-by", &wanted_by);
+ r = fstab_filter_options(opts, "x-systemd.wanted-by\0", NULL, NULL, &wanted_by, NULL);
if (r < 0)
return r;
- r = fstab_extract_values(opts, "x-systemd.required-by", &required_by);
+ r = fstab_filter_options(opts, "x-systemd.required-by\0", NULL, NULL, &required_by, NULL);
if (r < 0)
return r;