mount.cifs: ignore x-* mount options
authorKarel Zak <kzak@redhat.com>
Thu, 7 Jan 2016 10:02:49 +0000 (11:02 +0100)
committerJeff Layton <jlayton@samba.org>
Thu, 7 Jan 2016 12:59:15 +0000 (07:59 -0500)
x-* prefix is used for userspace mount options and it's pretty
commonly used to extend fstab configuration in systemd world (e.g.
x-systemd.automount). These options is necessary to ignored.

The command mount(8) does not pass x-* mount options to mount.<type>
helpers, but in some use-cases it's possible that the cifs helper reads
mount options from fstab or users directly call mount.cifs and copy & past
mount options, etc.

This patch marks all options prefixed by "x-" as OPT_IGNORE to make
things more robust for end-users. We already uses the same concept for
_netdev.

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Jeff Layton <jlayton@samba.org>
mount.cifs.c

index 353509622e5602b699ad69f65d93eede7816c890..5c5734fa49ecb95eb282f8594357a7dcd4e817e8 100644 (file)
@@ -756,6 +756,8 @@ static int parse_opt_token(const char *token)
                return OPT_BKUPGID;
        if (strncmp(token, "nofail", 6) == 0)
                return OPT_NOFAIL;
+       if (strncmp(token, "x-", 2) == 0)
+               return OPT_IGNORE;
 
        return OPT_ERROR;
 }