chiark / gitweb /
mount: add new SloppyOptions= setting for mount units, mapping to mount(8)'s "-s...
authorLennart Poettering <lennart@poettering.net>
Sun, 15 Jun 2014 23:02:27 +0000 (01:02 +0200)
committerLennart Poettering <lennart@poettering.net>
Sun, 15 Jun 2014 23:02:27 +0000 (01:02 +0200)
man/systemd.mount.xml
src/core/dbus-mount.c
src/core/load-fragment-gperf.gperf.m4
src/core/mount.c
src/core/mount.h

index 657cf11..2fbad37 100644 (file)
                         </varlistentry>
 
                         <varlistentry>
+                                <term><varname>SloppyOptions=</varname></term>
+
+                                <listitem><para>Takes a boolean
+                                argument. If true parsing of the
+                                options specified in
+                                <varname>Options=</varname> is
+                                relaxed, and unknown mount options are
+                                tolerated. This corresponds with
+                                <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
+                                <parameter>-s</parameter>
+                                switch. Defaults to
+                                off.</para></listitem>
+                        </varlistentry>
+
+                        <varlistentry>
                                 <term><varname>DirectoryMode=</varname></term>
                                 <listitem><para>Directories of mount
                                 points (and any parent directories)
index e27019d..53fe4ed 100644 (file)
@@ -117,6 +117,7 @@ const sd_bus_vtable bus_mount_vtable[] = {
         SD_BUS_PROPERTY("TimeoutUSec", "t", bus_property_get_usec, offsetof(Mount, timeout_usec), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("ControlPID", "u", bus_property_get_pid, offsetof(Mount, control_pid), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
         SD_BUS_PROPERTY("DirectoryMode", "u", bus_property_get_mode, offsetof(Mount, directory_mode), SD_BUS_VTABLE_PROPERTY_CONST),
+        SD_BUS_PROPERTY("SloppyOptions", "b", bus_property_get_bool, offsetof(Mount, sloppy_options), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(Mount, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
         BUS_EXEC_COMMAND_VTABLE("ExecMount", offsetof(Mount, exec_command[MOUNT_EXEC_MOUNT]), SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION),
         BUS_EXEC_COMMAND_VTABLE("ExecUnmount", offsetof(Mount, exec_command[MOUNT_EXEC_UNMOUNT]), SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION),
index d97c5c6..3471ccb 100644 (file)
@@ -274,6 +274,7 @@ Mount.Options,                   config_parse_string,                0,
 Mount.Type,                      config_parse_string,                0,                             offsetof(Mount, parameters_fragment.fstype)
 Mount.TimeoutSec,                config_parse_sec,                   0,                             offsetof(Mount, timeout_usec)
 Mount.DirectoryMode,             config_parse_mode,                  0,                             offsetof(Mount, directory_mode)
+Mount.SloppyOptions,             config_parse_bool,                  0,                             offsetof(Mount, sloppy_options)
 EXEC_CONTEXT_CONFIG_ITEMS(Mount)m4_dnl
 CGROUP_CONTEXT_CONFIG_ITEMS(Mount)m4_dnl
 KILL_CONTEXT_CONFIG_ITEMS(Mount)m4_dnl
index ca21ec7..aea2ab1 100644 (file)
@@ -935,7 +935,7 @@ static void mount_enter_mounting(Mount *m) {
                 r = exec_command_set(
                                 m->control_command,
                                 "/bin/mount",
-                                "-n",
+                                m->sloppy_options ? "-ns" : "-n",
                                 m->parameters_fragment.what,
                                 m->where,
                                 "-t", m->parameters_fragment.fstype ? m->parameters_fragment.fstype : "auto",
@@ -983,7 +983,7 @@ static void mount_enter_remounting(Mount *m) {
                 r = exec_command_set(
                                 m->control_command,
                                 "/bin/mount",
-                                "-n",
+                                m->sloppy_options ? "-ns" : "-n",
                                 m->parameters_fragment.what,
                                 m->where,
                                 "-t", m->parameters_fragment.fstype ? m->parameters_fragment.fstype : "auto",
index a53423c..2dcb663 100644 (file)
@@ -88,6 +88,8 @@ struct Mount {
         bool just_mounted:1;
         bool just_changed:1;
 
+        bool sloppy_options;
+
         MountResult result;
         MountResult reload_result;