All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karel Zak <kzak-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Jeffrey Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Karel Zak <kzak-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH] mount.cifs: ignore x-* mount options
Date: Thu,  7 Jan 2016 11:02:49 +0100	[thread overview]
Message-ID: <1452160969-16970-1-git-send-email-kzak@redhat.com> (raw)

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-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 mount.cifs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mount.cifs.c b/mount.cifs.c
index 3535096..5c5734f 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -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;
 }
-- 
2.4.3

             reply	other threads:[~2016-01-07 10:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07 10:02 Karel Zak [this message]
     [not found] ` <1452160969-16970-1-git-send-email-kzak-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-01-07 13:00   ` [PATCH] mount.cifs: ignore x-* mount options Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452160969-16970-1-git-send-email-kzak@redhat.com \
    --to=kzak-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.