From patchwork Thu Jul 14 05:35:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jianhong.Yin" X-Patchwork-Id: 9229003 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 09A9260574 for ; Thu, 14 Jul 2016 05:36:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED3DB27B16 for ; Thu, 14 Jul 2016 05:36:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF04E2808C; Thu, 14 Jul 2016 05:36:09 +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 99D8227B16 for ; Thu, 14 Jul 2016 05:36:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751453AbcGNFgI (ORCPT ); Thu, 14 Jul 2016 01:36:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48086 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751208AbcGNFgH (ORCPT ); Thu, 14 Jul 2016 01:36:07 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (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 D2A91D4028; Thu, 14 Jul 2016 05:36:05 +0000 (UTC) Received: from dhcp12-106.nay.redhat.com (dhcp-12-106.nay.redhat.com [10.66.12.106]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6E5a3MU024233; Thu, 14 Jul 2016 01:36:04 -0400 From: "Jianhong.Yin" To: linux-nfs@vger.kernel.org Cc: steved@redhat.com, "Jianhong.Yin" Subject: [PATCH] exportfs: fix export point checking Date: Thu, 14 Jul 2016 13:35:59 +0800 Message-Id: <1468474559-24168-1-git-send-email-yin-jianhong@163.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 14 Jul 2016 05:36:05 +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 regular file export and mount, use S_ISLNK instead S_ISREG --- 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..74baa08 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) && !S_ISLNK(stb.st_mode)) { + xlog(L_ERROR, "%s is neither a directory nor a symlink. " "Remote access will fail", path); return; }