Skip to content

Commit

Permalink
[pyNFS] Return code of OPEN for special files
Browse files Browse the repository at this point in the history
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 <tonetto@linux.vnet.ibm.com>
  • Loading branch information
Leonardo Tonetto committed May 6, 2012
1 parent ad32b03 commit 54fa33d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/Protocols/NFS/nfs4_op_open.c
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 54fa33d

Please sign in to comment.