From patchwork Thu Jan 7 10:02:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karel Zak X-Patchwork-Id: 7975441 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2415E9F1CC for ; Thu, 7 Jan 2016 10:03:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5D35720138 for ; Thu, 7 Jan 2016 10:03:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 76E72200EC for ; Thu, 7 Jan 2016 10:03:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752797AbcAGKDL (ORCPT ); Thu, 7 Jan 2016 05:03:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35627 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752627AbcAGKDJ (ORCPT ); Thu, 7 Jan 2016 05:03:09 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id B0F1319CB95; Thu, 7 Jan 2016 10:03:09 +0000 (UTC) Received: from ws (ovpn-204-36.brq.redhat.com [10.40.204.36]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u07A38w2020627; Thu, 7 Jan 2016 05:03:09 -0500 From: Karel Zak To: Jeffrey Layton Cc: linux-cifs@vger.kernel.org, Karel Zak Subject: [PATCH] mount.cifs: ignore x-* mount options Date: Thu, 7 Jan 2016 11:02:49 +0100 Message-Id: <1452160969-16970-1-git-send-email-kzak@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. 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 --- 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; }