Blame SOURCES/0005-mount.cifs-ignore-x-mount-options.patch

f2a5d6
From cf3af6ab831129e7f8e50eb00d9a4120e297cf7a Mon Sep 17 00:00:00 2001
f2a5d6
From: Karel Zak <kzak@redhat.com>
f2a5d6
Date: Thu, 7 Jan 2016 11:02:49 +0100
f2a5d6
Subject: [PATCH 5/5] mount.cifs: ignore x-* mount options
f2a5d6
f2a5d6
x-* prefix is used for userspace mount options and it's pretty
f2a5d6
commonly used to extend fstab configuration in systemd world (e.g.
f2a5d6
x-systemd.automount). These options is necessary to ignored.
f2a5d6
f2a5d6
The command mount(8) does not pass x-* mount options to mount.<type>
f2a5d6
helpers, but in some use-cases it's possible that the cifs helper reads
f2a5d6
mount options from fstab or users directly call mount.cifs and copy & past
f2a5d6
mount options, etc.
f2a5d6
f2a5d6
This patch marks all options prefixed by "x-" as OPT_IGNORE to make
f2a5d6
things more robust for end-users. We already uses the same concept for
f2a5d6
_netdev.
f2a5d6
f2a5d6
Signed-off-by: Karel Zak <kzak@redhat.com>
f2a5d6
Signed-off-by: Jeff Layton <jlayton@samba.org>
f2a5d6
(cherry picked from commit be5046ae3fabca17f19672f7b4019efb6a869298)
f2a5d6
Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
f2a5d6
---
f2a5d6
 mount.cifs.c | 2 ++
f2a5d6
 1 file changed, 2 insertions(+)
f2a5d6
f2a5d6
diff --git a/mount.cifs.c b/mount.cifs.c
f2a5d6
index 3535096..5c5734f 100644
f2a5d6
--- a/mount.cifs.c
f2a5d6
+++ b/mount.cifs.c
f2a5d6
@@ -756,6 +756,8 @@ static int parse_opt_token(const char *token)
f2a5d6
 		return OPT_BKUPGID;
f2a5d6
 	if (strncmp(token, "nofail", 6) == 0)
f2a5d6
 		return OPT_NOFAIL;
f2a5d6
+	if (strncmp(token, "x-", 2) == 0)
f2a5d6
+		return OPT_IGNORE;
f2a5d6
 
f2a5d6
 	return OPT_ERROR;
f2a5d6
 }
f2a5d6
-- 
f2a5d6
2.5.5
f2a5d6