From patchwork Thu Apr 24 10:57:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 4049251 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E84AD9F1F4 for ; Thu, 24 Apr 2014 10:58:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26716202EC for ; Thu, 24 Apr 2014 10:58:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5E777202EA for ; Thu, 24 Apr 2014 10:58:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754394AbaDXK6H (ORCPT ); Thu, 24 Apr 2014 06:58:07 -0400 Received: from mail-pb0-f51.google.com ([209.85.160.51]:61554 "EHLO mail-pb0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753094AbaDXK6E (ORCPT ); Thu, 24 Apr 2014 06:58:04 -0400 Received: by mail-pb0-f51.google.com with SMTP id uo5so1831297pbc.10 for ; Thu, 24 Apr 2014 03:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=YNEdaMYEOO7DO1gpqG0E4XvYIVv5lFV0Du0iDz0P4a4=; b=fCflCSDPWCvdloecz3a7p4vGBfQiLQK6d937V6cHbs1i9HcwvhG4GC8xlx5d6LLKbh 61le4fTt1VtfjJ8G1qEtOXHZ6+7T/foCLjLLkQBVGqQYpO5i65X+ODxhULMUftf7LQFM 7LO/lLV+/BBoFxSUqn6ZeKAxn9Wag9SJK8fGebQOfii8H7UN3DsuiNp6A6NrOh9Ykosy YgPo76FKcctZIlCsrksHlOds3KcFMxk/FkvEDh+ppMyqQzKJSubBA14QvDPlwgwHnXYC EdL/YkWylwDBLle5/nNrCLNI5rCC2nmZRp4JsHOoy8FeDRybg/QQTvhWYbq0091rghrc 6f+Q== X-Received: by 10.68.125.164 with SMTP id mr4mr63702949pbb.27.1398337084388; Thu, 24 Apr 2014 03:58:04 -0700 (PDT) Received: from [192.168.0.102] ([110.190.116.5]) by mx.google.com with ESMTPSA id vf7sm8387803pbc.5.2014.04.24.03.57.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Apr 2014 03:58:03 -0700 (PDT) Message-ID: <5358EE2F.9070301@gmail.com> Date: Thu, 24 Apr 2014 18:57:51 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: "J. Bruce Fields" CC: linux-nfs@vger.kernel.org Subject: [PATCH 1/3] NFS4.0: Case for linking to bad source patch with zero-length Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Signed-off-by: Kinglong Mee --- nfs4.0/servertests/st_create.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nfs4.0/servertests/st_create.py b/nfs4.0/servertests/st_create.py index d2d6701..09c80cc 100644 --- a/nfs4.0/servertests/st_create.py +++ b/nfs4.0/servertests/st_create.py @@ -161,6 +161,19 @@ def testZeroLength(t, env): res = c.create_obj(c.homedir + ['']) check(res, NFS4ERR_INVAL, "CREATE with zero-length name") +def testZeroLengthForLNK(t, env): + """CREATE with zero length name should return NFS4ERR_INVAL + + FLAGS: create symlink all + CODE: CR9a + """ + c = env.c1 + ops = c.go_home() + objtype = createtype4(NF4LNK, **{'linkdata':''}) + ops += [c.create_op(objtype, t.code, getDefaultAttr(c))] + res = c.compound(ops) + check(res, NFS4ERR_INVAL, "CREATE with zero-length name for SYMLINK") + def testRegularFile(t, env): """CREATE should fail with NFS4ERR_BADTYPE for regular files