Skip to contentSkip to conversation

NFS4.0: Case for linking to bad source path with zero-length

PATCH New Kinglong Mee 1 participant 1 message May 17, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 NFS4.0: Case for linking to bad source path with zero-length

Same as v1.

---
 nfs4.0/servertests/st_create.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)
nfs4.0/servertests/st_create.py +13 -0
index d2d6701..09c80cc 100644
@@ -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
 
Signature · 1 line
1.9.0