From patchwork Sat May 17 02:18:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 4195841 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 86FBFBEEAB for ; Sat, 17 May 2014 02:18:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A4E9D203E3 for ; Sat, 17 May 2014 02:18:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 955BD203DB for ; Sat, 17 May 2014 02:18:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751775AbaEQCSq (ORCPT ); Fri, 16 May 2014 22:18:46 -0400 Received: from mail-oa0-f45.google.com ([209.85.219.45]:38811 "EHLO mail-oa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751455AbaEQCSp (ORCPT ); Fri, 16 May 2014 22:18:45 -0400 Received: by mail-oa0-f45.google.com with SMTP id l6so3927164oag.18 for ; Fri, 16 May 2014 19:18:45 -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=aEDtQ8D6Ik+IxZLL7FJp3/QuwBQc0AcDiDhvPa1REbQ=; b=lRKTyj727Ate/gWJCGVfP6f7MxyMcwf0qkD/Gqz+sYrkmluugRyOr+XQhcdqDJpaGu 7HZywkJJAGC6qmm/QX4tlwzeR5VI/9lTQIpGQ1gSN9CljsaQZzmgMHLXFcKvFIrfiu1r UwnJoL7b0cUk/QI+gBQ4hajvypeDs3XrZENbT5lP+98L0gSi10zQkmeu2CQNDi6a36Er wHvMqOFdT+X0R9BHHaN4CDzlUkHeEt17moN5SRVvNt+WCD336EfhcyC5ruN21ntb1Q6z f6HbUJZbdo4jidHLcZY4IbbAy0pXRr+uuABDj6Qfhx6tgjvev/v14DxWr3iLtJ7mO5Bt 5V4g== X-Received: by 10.60.33.199 with SMTP id t7mr7365586oei.73.1400293125434; Fri, 16 May 2014 19:18:45 -0700 (PDT) Received: from [192.168.31.158] ([118.117.115.173]) by mx.google.com with ESMTPSA id js4sm10720959oeb.3.2014.05.16.19.18.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 May 2014 19:18:44 -0700 (PDT) Message-ID: <5376C6F8.4090904@gmail.com> Date: Sat, 17 May 2014 10:18:32 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "J. Bruce Fields" CC: linux-nfs@vger.kernel.org, kinglongmee@gmail.com Subject: [PATCH 1/3 v2] NFS4.0: Case for linking to bad source path 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 Same as v1. 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