nfs-ganesha 1.4
Functions

fsal_local_op.c File Reference

#include "fsal.h"
#include "fsal_internal.h"
#include "fsal_convert.h"

Go to the source code of this file.

Functions

fsal_status_t HPSSFSAL_test_access (hpssfsal_op_context_t *p_context, fsal_accessflags_t access_type, fsal_attrib_list_t *object_attributes)
fsal_status_t HPSSFSAL_setattr_access (hpssfsal_op_context_t *p_context, fsal_attrib_list_t *pcandidate_attributes, fsal_attrib_list_t *pobject_attributes)
fsal_status_t HPSSFSAL_rename_access (hpssfsal_op_context_t *pcontext, fsal_attrib_list_t *pattrsrc, fsal_attrib_list_t *pattrdest)
fsal_status_t HPSSFSAL_create_access (hpssfsal_op_context_t *pcontext, fsal_attrib_list_t *pattr)
fsal_status_t HPSSFSAL_unlink_access (hpssfsal_op_context_t *pcontext, fsal_attrib_list_t *pattr)
fsal_status_t HPSSFSAL_link_access (hpssfsal_op_context_t *pcontext, fsal_attrib_list_t *pattr)
fsal_status_t HPSSFSAL_merge_attrs (fsal_attrib_list_t *pinit_attr, fsal_attrib_list_t *pnew_attr, fsal_attrib_list_t *presult_attr)

Function Documentation

fsal_status_t HPSSFSAL_create_access ( hpssfsal_op_context_t pcontext,
fsal_attrib_list_t pattr 
)

FSAL_create_access : test if a client identified by cred can create an object within a directory knowing its attributes

Parameters:
pcontext(in hpssfsal_cred_t *) user's context.
pattrsource directory attributes
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 338 of file FSAL_HPSS/fsal_local_op.c.

fsal_status_t HPSSFSAL_link_access ( hpssfsal_op_context_t pcontext,
fsal_attrib_list_t pattr 
)

FSAL_link_access : test if a client identified by cred can link to a directory knowing its attributes

Parameters:
pcontext(in hpssfsal_cred_t *) user's context.
pattrdestination directory attributes
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 394 of file FSAL_HPSS/fsal_local_op.c.

fsal_status_t HPSSFSAL_merge_attrs ( fsal_attrib_list_t pinit_attr,
fsal_attrib_list_t pnew_attr,
fsal_attrib_list_t presult_attr 
)

FSAL_merge_attrs: merge to attributes structure.

This functions merge the second attributes list into the first argument. Results in returned in the last argument.

Parameters:
pinit_attr[IN] attributes to be changed
pnew_attr[IN] attributes to be added
presult_attr[IN] resulting attributes
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_INVAL Invalid argument(s)

Definition at line 422 of file FSAL_HPSS/fsal_local_op.c.

fsal_status_t HPSSFSAL_rename_access ( hpssfsal_op_context_t pcontext,
fsal_attrib_list_t pattrsrc,
fsal_attrib_list_t pattrdest 
)

FSAL_rename_access : test if a client identified by cred can be renamed on the object knowing the parents attributes

Parameters:
pcontext(in hpssfsal_cred_t *) user's context.
pattrsrcsource directory attributes
pattrdestdestination directory attributes
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 306 of file FSAL_HPSS/fsal_local_op.c.

fsal_status_t HPSSFSAL_setattr_access ( hpssfsal_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:
cred(in hpssfsal_cred_t *) user's identifier.
candidate_attrbutesthe attributes we want to set on the object
parent_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 250 of file FSAL_HPSS/fsal_local_op.c.

fsal_status_t HPSSFSAL_test_access ( hpssfsal_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:
: test that needed attributes are in the structure
Todo:
: ACLs.

Definition at line 78 of file FSAL_HPSS/fsal_local_op.c.

fsal_status_t HPSSFSAL_unlink_access ( hpssfsal_op_context_t pcontext,
fsal_attrib_list_t pattr 
)

FSAL_unlink_access : test if a client identified by cred can unlink on a directory knowing its attributes

Parameters:
pcontext(in hpssfsal_cred_t *) user's context.
pattrsource directory attributes
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 366 of file FSAL_HPSS/fsal_local_op.c.