From patchwork Sat Jul 9 05:15:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jianhong.Yin" X-Patchwork-Id: 9222019 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 905DD60572 for ; Sat, 9 Jul 2016 05:15:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F955287E5 for ; Sat, 9 Jul 2016 05:15:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7110E287E0; Sat, 9 Jul 2016 05:15:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C9C0287E0 for ; Sat, 9 Jul 2016 05:15:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756515AbcGIFPk (ORCPT ); Sat, 9 Jul 2016 01:15:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57938 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750696AbcGIFPj (ORCPT ); Sat, 9 Jul 2016 01:15:39 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 145C9D7FD6; Sat, 9 Jul 2016 05:15:38 +0000 (UTC) Received: from dhcp-13-153.nay.redhat.com (dhcp-13-153.nay.redhat.com [10.66.13.153]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u695FZ2r016572; Sat, 9 Jul 2016 01:15:36 -0400 From: "Jianhong.Yin" To: linux-nfs@vger.kernel.org Cc: steved@redhat.com, "Jianhong.Yin" , Jianhong Yin Subject: [PATCH] exportfs: fix export point checking Date: Sat, 9 Jul 2016 13:15:33 +0800 Message-Id: <1468041333-30255-1-git-send-email-yin-jianhong@163.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sat, 09 Jul 2016 05:15:38 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP NFS does not support file and symbolic export, if the export point is regular file should give warning to user. Signed-off-by: Jianhong Yin --- utils/exportfs/exportfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c index 5db348b..a00b5ea 100644 --- a/utils/exportfs/exportfs.c +++ b/utils/exportfs/exportfs.c @@ -585,8 +585,8 @@ validate_export(nfs_export *exp) xlog(L_ERROR, "Failed to stat %s: %m", path); return; } - if (!S_ISDIR(stb.st_mode) && !S_ISREG(stb.st_mode)) { - xlog(L_ERROR, "%s is neither a directory nor a file. " + if (!S_ISDIR(stb.st_mode)) { + xlog(L_ERROR, "%s is not a directory. " "Remote access will fail", path); return; }