nfs-ganesha 1.4
Functions

fsal_local_op.c File Reference

#include <string.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
#include "nfs4.h"
#include "fsal_internal.h"
#include "fsal_convert.h"
#include "fsal_common.h"
#include "nfs_proto_functions.h"
#include "fsal_nfsv4_macros.h"

Go to the source code of this file.

Functions

fsal_status_t PROXYFSAL_test_access (fsal_op_context_t *p_context, fsal_accessflags_t access_type, fsal_attrib_list_t *object_attributes)
fsal_status_t PROXYFSAL_setattr_access (fsal_op_context_t *p_context, fsal_attrib_list_t *pcandidate_attributes, fsal_attrib_list_t *pobject_attributes)

Function Documentation

fsal_status_t PROXYFSAL_setattr_access ( fsal_op_context_t p_context,
fsal_attrib_list_t pcandidate_attributes,
fsal_attrib_list_t pobject_attributes 
)

FSAL_test_setattr_access : test if a client identified by cred can access setattr on the object knowing its attributes and parent's attributes. The following fields of the object_attributes structures MUST be filled : acls (if supported), mode, owner, group. This doesn't make any call to the filesystem, as a result, this doesn't ensure that the file exists, nor that the permissions given as parameters are the actual file permissions : this must be ensured by the cache_inode layer, using FSAL_getattrs, for example.

Parameters:
p_contextuser's context.
pcandidate_attrbutesthe attributes we want to set on the object
pobject_attributes(in fsal_attrib_list_t *) the cached attributes for the object.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_ACCESS (Permission denied)
  • ERR_FSAL_FAULT (null pointer parameter)
  • ERR_FSAL_INVAL (missing attributes : mode, group, user,...)
  • ERR_FSAL_SERVERFAULT (unexpected error)

Definition at line 219 of file FSAL_PROXY/fsal_local_op.c.

fsal_status_t PROXYFSAL_test_access ( fsal_op_context_t p_context,
fsal_accessflags_t  access_type,
fsal_attrib_list_t object_attributes 
)

FSAL_test_access : Tests whether the user identified by the p_context structure can access the object as indicated by the access_type parameter. This function tests access rights using cached attributes given as parameter (no calls to filesystem). Thus, it cannot test FSAL_F_OK flag, and asking such a flag will result in a ERR_FSAL_INVAL error.

Parameters:
p_context(input): Authentication context for the operation (user,...).
access_type(input): Indicates the permissions to test. This is an inclusive OR of the permissions to be checked for the user identified by cred. Permissions constants are :

  • FSAL_R_OK : test for read permission
  • FSAL_W_OK : test for write permission
  • FSAL_X_OK : test for exec permission
  • FSAL_F_OK : test for file existence
object_attributes(mandatory input): The cached attributes for the object to test rights on. The following attributes MUST be filled : owner, group, mode, ACLs.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error, permission granted)
  • ERR_FSAL_ACCESS (object permissions doesn't fit asked access type)
  • ERR_FSAL_INVAL (FSAL_test_access is not able to test such a permission)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Another error code if an error occured.

Todo:
: ACLs.

Definition at line 95 of file FSAL_PROXY/fsal_local_op.c.