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