mount: make checks on perpetual mount units more lax
authorLennart Poettering <lennart@poettering.net>
Fri, 17 Jan 2020 14:09:01 +0000 (15:09 +0100)
committerMichael Biebl <biebl@debian.org>
Sat, 25 Jan 2020 17:53:23 +0000 (17:53 +0000)
We don#t really care where perpetual mounts are mounted from, since they
have to exist since before we run anyway.

(cherry picked from commit 0879fbd6fedc2f813aebcb1a4eba005a99525bde)

Gbp-Pq: Name mount-make-checks-on-perpetual-mount-units-more-lax.patch

src/core/mount.c

index dfed691c43fe34e98e4cc3df4e27bc6010c82210..89018935a90a61bbcadfafcda2ce0c2b23445e50 100644 (file)
@@ -537,10 +537,9 @@ static int mount_verify(Mount *m) {
         }
 
         p = get_mount_parameters_fragment(m);
-        if (p && !p->what) {
-                log_unit_error(UNIT(m), "What= setting is missing. Refusing.");
-                return -ENOEXEC;
-        }
+        if (p && !p->what && !UNIT(m)->perpetual)
+                return log_unit_error_errno(UNIT(m), SYNTHETIC_ERRNO(ENOEXEC),
+                                            "What= setting is missing. Refusing.");
 
         if (m->exec_context.pam_name && m->kill_context.kill_mode != KILL_CONTROL_GROUP) {
                 log_unit_error(UNIT(m), "Unit has PAM enabled. Kill mode must be set to control-group'. Refusing.");