From patchwork Thu Mar 20 20:12:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Mayhew X-Patchwork-Id: 3867791 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7D96ABF540 for ; Thu, 20 Mar 2014 20:12:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA790201ED for ; Thu, 20 Mar 2014 20:12:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F01FC201E7 for ; Thu, 20 Mar 2014 20:12:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758075AbaCTUMg (ORCPT ); Thu, 20 Mar 2014 16:12:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1359 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751671AbaCTUMg (ORCPT ); Thu, 20 Mar 2014 16:12:36 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2KKCZmU029963 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 20 Mar 2014 16:12:36 -0400 Received: from tonberry.usersys.redhat.com (dhcp145-38.rdu.redhat.com [10.13.145.38]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s2KKCZRB030479 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 20 Mar 2014 16:12:35 -0400 Received: from tonberry.usersys.redhat.com (localhost [127.0.0.1]) by tonberry.usersys.redhat.com (8.14.5/8.14.5) with ESMTP id s2KKCZVr064104 for ; Thu, 20 Mar 2014 16:12:35 -0400 Received: (from smayhew@localhost) by tonberry.usersys.redhat.com (8.14.5/8.14.5/Submit) id s2KKCYZM064102 for linux-nfs@vger.kernel.org; Thu, 20 Mar 2014 16:12:34 -0400 From: Scott Mayhew To: linux-nfs@vger.kernel.org Subject: [nfs-utils PATCH] mount: chk_mountpoint should only check for execute perms for unpriveleged users Date: Thu, 20 Mar 2014 16:12:34 -0400 Message-Id: <1395346354-64069-1-git-send-email-smayhew@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 Otherwise 'mount -o remount' fails on mounts that have root squashing enabled and world execute perms disabled. Signed-off-by: Scott Mayhew --- utils/mount/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/mount/utils.c b/utils/mount/utils.c index ede77a8..92662ed 100644 --- a/utils/mount/utils.c +++ b/utils/mount/utils.c @@ -130,7 +130,7 @@ int chk_mountpoint(const char *mount_point) mount_error(NULL, mount_point, ENOTDIR); return 1; } - if (access(mount_point, X_OK) < 0) { + if (getuid() != 0 && geteuid() != 0 && access(mount_point, X_OK) < 0) { mount_error(NULL, mount_point, errno); return 1; }