diff options
author | Daniel Mack <github@zonque.org> | 2015-06-05 09:41:27 +0200 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-06-05 09:41:27 +0200 |
commit | 3a3701f03360f9a292dcab31fda1f6e0e0629c64 (patch) | |
tree | de559bfb3cf4910b333b76848272cb9a3f007fc1 /src | |
parent | a4d9a304f926614f41783e0b5239c99c807da09d (diff) | |
parent | fa05e97257fc54b05e4c272dfc19cea46511b823 (diff) |
Merge pull request #63 from arvidjaar/issue/50
fstab-generator: cescape device name in root-fsck service
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/generator.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/shared/generator.c b/src/shared/generator.c index 807569a1b8..e58bbea77c 100644 --- a/src/shared/generator.c +++ b/src/shared/generator.c @@ -34,9 +34,14 @@ static int write_fsck_sysroot_service(const char *dir, const char *what) { const char *unit; _cleanup_free_ char *device = NULL; + _cleanup_free_ char *escaped; _cleanup_fclose_ FILE *f = NULL; int r; + escaped = cescape(what); + if (!escaped) + return log_oom(); + unit = strjoina(dir, "/systemd-fsck-root.service"); log_debug("Creating %s", unit); @@ -61,11 +66,12 @@ static int write_fsck_sysroot_service(const char *dir, const char *what) { "[Service]\n" "Type=oneshot\n" "RemainAfterExit=yes\n" - "ExecStart=" SYSTEMD_FSCK_PATH " %2$s\n" + "ExecStart=" SYSTEMD_FSCK_PATH " %4$s\n" "TimeoutSec=0\n", program_invocation_short_name, what, - device); + device, + escaped); r = fflush_and_check(f); if (r < 0) |