From 54fa33d3d1efc2e1775e104a454db8cfb742b414 Mon Sep 17 00:00:00 2001 From: Leonardo Tonetto Date: Sun, 6 May 2012 20:20:59 +0200 Subject: [PATCH] [pyNFS] Return code of OPEN for special files From the NFSv4 current draft (draft-ietf-nfsv4-rfc3530bis-17): If the component provided to OPEN resolves to something other than a regular file, an error will be returned to the client. If it is a directory, NFS4ERR_ISDIR is returned; otherwise, NFS4ERR_SYMLINK is returned. Note that NFS4ERR_SYMLINK is returned for both symlinks and for special files of other types; NFS4ERR_INVAL would be inappropriate, since the arguments provided by the client were correct, and the client cannot necessarily know at the time it sent the OPEN that the component would resolve to a non-regular file. Thus, this patch fixes 4 pyNFS tests that are failing. Signed-off-by: Leonardo Tonetto --- src/Protocols/NFS/nfs4_op_open.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Protocols/NFS/nfs4_op_open.c b/src/Protocols/NFS/nfs4_op_open.c index 667d1d6379..7822304d79 100644 --- a/src/Protocols/NFS/nfs4_op_open.c +++ b/src/Protocols/NFS/nfs4_op_open.c @@ -779,15 +779,9 @@ int nfs4_op_open(struct nfs_argop4 *op, compound_data_t *data, res_OPEN4.status = NFS4ERR_ISDIR; goto out; } - else if(pentry_newfile->type == SYMBOLIC_LINK) - { - res_OPEN4.status = NFS4ERR_SYMLINK; - goto out; - } else { - res_OPEN4.status = NFS4ERR_INVAL; - cause2 = " (not REGULAR_FILE)"; + res_OPEN4.status = NFS4ERR_SYMLINK; goto out; } }