X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmount.c;h=612d15077b8c49525ee0a82a3191f128a3c0dfe3;hb=76c37ab6d205c95e8f43ffbc19553b936330195a;hp=a551235f139973eb0e56afbc7e4ce8a235380752;hpb=d15d0333be6a1ca7fdd99a1881d967b6be8f387a;p=elogind.git diff --git a/src/core/mount.c b/src/core/mount.c index a551235f1..612d15077 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -917,6 +917,13 @@ static void mount_enter_mounting(Mount *m) { goto fail; if (m->from_fragment) { + _cleanup_free_ char *opts = NULL; + + r = fstab_filter_options(m->parameters_fragment.options, + "nofail\0" "noauto\0" "auto\0", NULL, NULL, &opts); + if (r < 0) + goto fail; + r = exec_command_set(m->control_command, "/bin/mount", m->parameters_fragment.what, m->where, NULL); if (r >= 0 && UNIT(m)->manager->running_as == SYSTEMD_SYSTEM) @@ -925,8 +932,8 @@ static void mount_enter_mounting(Mount *m) { r = exec_command_append(m->control_command, "-s", NULL); if (r >= 0 && m->parameters_fragment.fstype) r = exec_command_append(m->control_command, "-t", m->parameters_fragment.fstype, NULL); - if (r >= 0 && m->parameters_fragment.options) - r = exec_command_append(m->control_command, "-o", m->parameters_fragment.options, NULL); + if (r >= 0 && !isempty(opts)) + r = exec_command_append(m->control_command, "-o", opts, NULL); } else r = -ENOENT;