FreeBSD kernel kern code
subr_acl_nfs4.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mount.h>
#include <sys/priv.h>
#include <sys/vnode.h>
#include <sys/errno.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/acl.h>
Include dependency graph for subr_acl_nfs4.c:

Go to the source code of this file.

Functions

 __FBSDID ("$BSDSUniX$")
 
static void acl_nfs4_trivial_from_mode (struct acl *aclp, mode_t mode)
 
 SYSCTL_INT (_vfs, OID_AUTO, acl_nfs4_old_semantics, CTLFLAG_RW,&acl_nfs4_old_semantics, 0,"Use pre-PSARC/2010/029 NFSv4 ACL semantics")
 
static int _access_mask_from_accmode (accmode_t accmode)
 
static int _acl_denies (const struct acl *aclp, int access_mask, struct ucred *cred, int file_uid, int file_gid, int *denied_explicitly)
 
int vaccess_acl_nfs4 (enum vtype type, uid_t file_uid, gid_t file_gid, struct acl *aclp, accmode_t accmode, struct ucred *cred, int *privused)
 
static int _acl_entry_matches (struct acl_entry *entry, acl_tag_t tag, acl_perm_t perm, acl_entry_type_t entry_type)
 
static struct acl_entry * _acl_append (struct acl *aclp, acl_tag_t tag, acl_perm_t perm, acl_entry_type_t entry_type)
 
static struct acl_entry * _acl_duplicate_entry (struct acl *aclp, int entry_index)
 
static void acl_nfs4_sync_acl_from_mode_draft (struct acl *aclp, mode_t mode, int file_owner_id)
 
void acl_nfs4_sync_acl_from_mode (struct acl *aclp, mode_t mode, int file_owner_id)
 
void acl_nfs4_sync_mode_from_acl (mode_t *_mode, const struct acl *aclp)
 
static void acl_nfs4_compute_inherited_acl_draft (const struct acl *parent_aclp, struct acl *child_aclp, mode_t mode, int file_owner_id, int is_directory)
 
static void acl_nfs4_inherit_entries (const struct acl *parent_aclp, struct acl *child_aclp, mode_t mode, int file_owner_id, int is_directory)
 
static void acl_nfs4_compute_inherited_acl_psarc (const struct acl *parent_aclp, struct acl *aclp, mode_t mode, int file_owner_id, int is_directory)
 
void acl_nfs4_compute_inherited_acl (const struct acl *parent_aclp, struct acl *child_aclp, mode_t mode, int file_owner_id, int is_directory)
 
static int _acls_are_equal (const struct acl *a, const struct acl *b)
 
int acl_nfs4_is_trivial (const struct acl *aclp, int file_owner_id)
 
int acl_nfs4_check (const struct acl *aclp, int is_directory)
 

Variables

static int acl_nfs4_old_semantics = 0
 
struct {
   accmode_t   accmode
 
   int   mask
 
accmode2mask []
 

Function Documentation

__FBSDID ( "$BSDSUniX$"  )
static int _access_mask_from_accmode ( accmode_t  accmode)
static

Definition at line 85 of file subr_acl_nfs4.c.

References accmode2mask.

Referenced by vaccess_acl_nfs4().

Here is the caller graph for this function:

static struct acl_entry* _acl_append ( struct acl *  aclp,
acl_tag_t  tag,
acl_perm_t  perm,
acl_entry_type_t  entry_type 
)
static

Definition at line 327 of file subr_acl_nfs4.c.

Referenced by acl_nfs4_compute_inherited_acl_psarc(), and acl_nfs4_sync_acl_from_mode_draft().

Here is the caller graph for this function:

static int _acl_denies ( const struct acl *  aclp,
int  access_mask,
struct ucred *  cred,
int  file_uid,
int  file_gid,
int *  denied_explicitly 
)
static

Definition at line 108 of file subr_acl_nfs4.c.

References groupmember().

Referenced by vaccess_acl_nfs4().

Here is the call graph for this function:

Here is the caller graph for this function:

static struct acl_entry* _acl_duplicate_entry ( struct acl *  aclp,
int  entry_index 
)
static

Definition at line 348 of file subr_acl_nfs4.c.

Referenced by acl_nfs4_compute_inherited_acl_draft(), and acl_nfs4_sync_acl_from_mode_draft().

Here is the caller graph for this function:

static int _acl_entry_matches ( struct acl_entry *  entry,
acl_tag_t  tag,
acl_perm_t  perm,
acl_entry_type_t  entry_type 
)
static

Definition at line 305 of file subr_acl_nfs4.c.

Referenced by acl_nfs4_sync_acl_from_mode_draft().

Here is the caller graph for this function:

static int _acls_are_equal ( const struct acl *  a,
const struct acl *  b 
)
static

Definition at line 1237 of file subr_acl_nfs4.c.

Referenced by acl_nfs4_is_trivial().

Here is the caller graph for this function:

int acl_nfs4_check ( const struct acl *  aclp,
int  is_directory 
)

Definition at line 1307 of file subr_acl_nfs4.c.

void acl_nfs4_compute_inherited_acl ( const struct acl *  parent_aclp,
struct acl *  child_aclp,
mode_t  mode,
int  file_owner_id,
int  is_directory 
)

Definition at line 1190 of file subr_acl_nfs4.c.

References acl_nfs4_compute_inherited_acl_draft(), acl_nfs4_compute_inherited_acl_psarc(), and acl_nfs4_old_semantics.

Here is the call graph for this function:

static void acl_nfs4_compute_inherited_acl_draft ( const struct acl *  parent_aclp,
struct acl *  child_aclp,
mode_t  mode,
int  file_owner_id,
int  is_directory 
)
static

Definition at line 849 of file subr_acl_nfs4.c.

References _acl_duplicate_entry(), and acl_nfs4_sync_acl_from_mode().

Referenced by acl_nfs4_compute_inherited_acl().

Here is the call graph for this function:

Here is the caller graph for this function:

static void acl_nfs4_compute_inherited_acl_psarc ( const struct acl *  parent_aclp,
struct acl *  aclp,
mode_t  mode,
int  file_owner_id,
int  is_directory 
)
static

Definition at line 1131 of file subr_acl_nfs4.c.

References _acl_append(), and acl_nfs4_inherit_entries().

Referenced by acl_nfs4_compute_inherited_acl(), and acl_nfs4_trivial_from_mode().

Here is the call graph for this function:

Here is the caller graph for this function:

static void acl_nfs4_inherit_entries ( const struct acl *  parent_aclp,
struct acl *  child_aclp,
mode_t  mode,
int  file_owner_id,
int  is_directory 
)
static

Definition at line 1012 of file subr_acl_nfs4.c.

Referenced by acl_nfs4_compute_inherited_acl_psarc().

Here is the caller graph for this function:

int acl_nfs4_is_trivial ( const struct acl *  aclp,
int  file_owner_id 
)

Definition at line 1265 of file subr_acl_nfs4.c.

References _acls_are_equal(), acl_alloc(), acl_free(), acl_nfs4_sync_acl_from_mode_draft(), acl_nfs4_sync_mode_from_acl(), and acl_nfs4_trivial_from_mode().

Here is the call graph for this function:

void acl_nfs4_sync_acl_from_mode ( struct acl *  aclp,
mode_t  mode,
int  file_owner_id 
)

Definition at line 710 of file subr_acl_nfs4.c.

References acl_nfs4_old_semantics, acl_nfs4_sync_acl_from_mode_draft(), and acl_nfs4_trivial_from_mode().

Referenced by acl_nfs4_compute_inherited_acl_draft().

Here is the call graph for this function:

Here is the caller graph for this function:

static void acl_nfs4_sync_acl_from_mode_draft ( struct acl *  aclp,
mode_t  mode,
int  file_owner_id 
)
static

Definition at line 364 of file subr_acl_nfs4.c.

References _acl_append(), _acl_duplicate_entry(), and _acl_entry_matches().

Referenced by acl_nfs4_is_trivial(), and acl_nfs4_sync_acl_from_mode().

Here is the call graph for this function:

Here is the caller graph for this function:

void acl_nfs4_sync_mode_from_acl ( mode_t *  _mode,
const struct acl *  aclp 
)

Definition at line 722 of file subr_acl_nfs4.c.

References mode.

Referenced by acl_nfs4_is_trivial(), and vaccess_acl_nfs4().

Here is the caller graph for this function:

static void acl_nfs4_trivial_from_mode ( struct acl *  aclp,
mode_t  mode 
)
static

Definition at line 1211 of file subr_acl_nfs4.c.

References acl_nfs4_compute_inherited_acl_psarc().

Referenced by acl_nfs4_is_trivial(), and acl_nfs4_sync_acl_from_mode().

Here is the call graph for this function:

Here is the caller graph for this function:

SYSCTL_INT ( _vfs  ,
OID_AUTO  ,
acl_nfs4_old_semantics  ,
CTLFLAG_RW  ,
acl_nfs4_old_semantics,
,
"Use pre-PSARC/2010/029 NFSv4 ACL semantics"   
)
int vaccess_acl_nfs4 ( enum vtype  type,
uid_t  file_uid,
gid_t  file_gid,
struct acl *  aclp,
accmode_t  accmode,
struct ucred *  cred,
int *  privused 
)

Definition at line 170 of file subr_acl_nfs4.c.

References _access_mask_from_accmode(), _acl_denies(), accmode, acl_nfs4_sync_mode_from_acl(), and priv_check_cred().

Here is the call graph for this function:

Variable Documentation

struct { ... } accmode2mask[]
Initial value:
= {{VREAD, ACL_READ_DATA},
{VWRITE, ACL_WRITE_DATA},
{VAPPEND, ACL_APPEND_DATA},
{VEXEC, ACL_EXECUTE},
{VREAD_NAMED_ATTRS, ACL_READ_NAMED_ATTRS},
{VWRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS},
{VDELETE_CHILD, ACL_DELETE_CHILD},
{VREAD_ATTRIBUTES, ACL_READ_ATTRIBUTES},
{VWRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
{VDELETE, ACL_DELETE},
{VREAD_ACL, ACL_READ_ACL},
{VWRITE_ACL, ACL_WRITE_ACL},
{VWRITE_OWNER, ACL_WRITE_OWNER},
{VSYNCHRONIZE, ACL_SYNCHRONIZE},
{0, 0}}

Referenced by _access_mask_from_accmode().

int acl_nfs4_old_semantics = 0
static

Definition at line 60 of file subr_acl_nfs4.c.

Referenced by acl_nfs4_compute_inherited_acl(), and acl_nfs4_sync_acl_from_mode().