summaryrefslogtreecommitdiff
path: root/testing/util-linux/libmount-use-mount.-type-s-for-NFS-only.patch
blob: 9041ab7426c482afb032f870ec32f99f9bbf9a5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 9bf9690114b7432144caf815e149e35640bc3ad0 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Mon, 27 Feb 2012 16:43:12 +0100
Subject: [PATCH] libmount: use mount.<type> -s for NFS only

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 |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
index 8cbc25b..a0c5951 100644
--- a/libmount/src/context_mount.c
+++ b/libmount/src/context_mount.c
@@ -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 */
-- 
1.7.9.2