]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: use mount.<type> -s for NFS only
authorKarel Zak <kzak@redhat.com>
Mon, 27 Feb 2012 15:43:12 +0000 (16:43 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 27 Feb 2012 15:44:38 +0000 (16:44 +0100)
Unfortunately, it seems that for example mount.cifs don't care about
the API, so we need exception like the original mount(8).

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context_mount.c

index 8cbc25b2790570393b2bc4ebd2b9e9fcfbf875d3..a0c5951c1e8bedd3f158711c8db9d127249c2751 100644 (file)
@@ -369,7 +369,12 @@ static int exec_helper(struct libmnt_context *cxt)
                args[i++] = mnt_fs_get_srcpath(cxt->fs);/* 2 */
                args[i++] = mnt_fs_get_target(cxt->fs); /* 3 */
 
-               if (mnt_context_is_sloppy(cxt))
+               /*
+                * TODO: remove the exception for "nfs", -s is documented
+                *       for years should be usable everywhere.
+                */
+               if (mnt_context_is_sloppy(cxt) &&
+                   type && startswith(type, "nfs"))
                        args[i++] = "-s";               /* 4 */
                if (mnt_context_is_fake(cxt))
                        args[i++] = "-f";               /* 5 */