From: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
To: bfields@fieldses.org
Cc: linux-nfs@vger.kernel.org, Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Subject: [PATCH] setattr: test how v4.0 server handles setting of zero length principals
Date: Mon, 9 Jan 2017 16:15:56 +0100 [thread overview]
Message-ID: <20170109151556.7522-1-tigran.mkrtchyan@desy.de> (raw)
my interpretation of rfc3530 expects NFS4ERR_INVAL is owner and
owner_group are empty strings.
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
---
nfs4.0/servertests/st_setattr.py | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/nfs4.0/servertests/st_setattr.py b/nfs4.0/servertests/st_setattr.py
index b6a398b..b192ece 100644
--- a/nfs4.0/servertests/st_setattr.py
+++ b/nfs4.0/servertests/st_setattr.py
@@ -701,3 +701,34 @@ def testChangeGranularity(t, env):
chattr4 = res.resarray[7].obj_attributes
if chattr1 == chattr2 or chattr2 == chattr3 or chattr3 == chattr4:
t.fail("consecutive SETATTR(mode)'s don't all change change attribute")
+
+def testEmptyPrincipal(t, env):
+ """Setting owner with zero length principal must fail
+
+ FLAGS: setattr all
+ DEPEND: MKFILE
+ CODE: SATT16
+ """
+ c = env.c1
+ path = c.homedir + [t.code]
+ res = c.create_obj(path, NF4SOCK)
+ check(res)
+ ops = c.use_obj(path) + [c.setattr({FATTR4_OWNER: ''})]
+ res = c.compound(ops)
+ check(res, NFS4ERR_INVAL, "Setting empty owner")
+
+
+def testEmptyGroupPrincipal(t, env):
+ """Setting owner group with zero length principal must fail
+
+ FLAGS: setattr all
+ DEPEND: MKFILE
+ CODE: SATT17
+ """
+ c = env.c1
+ path = c.homedir + [t.code]
+ res = c.create_obj(path, NF4SOCK)
+ check(res)
+ ops = c.use_obj(path) + [c.setattr({FATTR4_OWNER_GROUP: ''})]
+ res = c.compound(ops)
+ check(res, NFS4ERR_INVAL, "Setting empty owner_group")
--
2.9.3
next reply other threads:[~2017-01-09 15:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-09 15:15 Tigran Mkrtchyan [this message]
2017-01-13 17:03 ` [PATCH] setattr: test how v4.0 server handles setting of zero length principals J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170109151556.7522-1-tigran.mkrtchyan@desy.de \
--to=tigran.mkrtchyan@desy.de \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).