From patchwork Sat Aug 27 16:21:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 1104602 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7RGIvHT021333 for ; Sat, 27 Aug 2011 16:21:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750974Ab1H0QVi (ORCPT ); Sat, 27 Aug 2011 12:21:38 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:58947 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750964Ab1H0QVh (ORCPT ); Sat, 27 Aug 2011 12:21:37 -0400 Received: by bke11 with SMTP id 11so3210552bke.19 for ; Sat, 27 Aug 2011 09:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer; bh=t9eMGxgmdRy9rjGWoh+mRNKqo+RJq7SKKkKejpySTM0=; b=gMj8VLWz4V4sKTjbHMnAPfylXQRHUXcYhs+8DuYLbAloSPG18mvpUDRs4rjpr/ALgz wPyyFyzeSooU80EXmTUGxGKtJuJHX2A/Ii/TU0+VI73phkRuDubjvQzGsFrRBXULawGT dIth7A2xPssgTOLRMfjkHXjBw5nP8yUTjq79M= Received: by 10.204.148.67 with SMTP id o3mr1156776bkv.258.1314462096456; Sat, 27 Aug 2011 09:21:36 -0700 (PDT) Received: from localhost.localdomain ([85.26.233.164]) by mx.google.com with ESMTPS id y8sm741812bks.54.2011.08.27.09.21.34 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 27 Aug 2011 09:21:35 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH] mount.cifs: fix the conflict between rwpidforward and rw mount options Date: Sat, 27 Aug 2011 20:21:17 +0400 Message-Id: <1314462077-6196-1-git-send-email-piastry@etersoft.ru> X-Mailer: git-send-email 1.7.1 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 27 Aug 2011 16:21:38 +0000 (UTC) Both these options are started with "rw" - that's why the first one isn't switched on even if it is specified. Fix this by adding a length check for "rw" option check. Signed-off-by: Pavel Shilovsky --- mount.cifs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/mount.cifs.c b/mount.cifs.c index aa4581f..1e3d534 100644 --- a/mount.cifs.c +++ b/mount.cifs.c @@ -837,7 +837,7 @@ static int parse_opt_token(const char *token) return OPT_GUEST; if (strncmp(token, "ro", 2) == 0) return OPT_RO; - if (strncmp(token, "rw", 2) == 0) + if (strncmp(token, "rw", 2) == 0 && strlen(token) == 2) return OPT_RW; if (strncmp(token, "remount", 7) == 0) return OPT_REMOUNT;