FreeBSD kernel kern code
vfs_acl.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
#include <sys/capsicum.h>
#include <sys/fcntl.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/vnode.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/namei.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/proc.h>
#include <sys/sysent.h>
#include <sys/acl.h>
#include <security/audit/audit.h>
#include <security/mac/mac_framework.h>
Include dependency graph for vfs_acl.c:

Go to the source code of this file.

Functions

 __FBSDID ("$FreeBSD$")
 
 CTASSERT (ACL_MAX_ENTRIES >=OLDACL_MAX_ENTRIES)
 
 MALLOC_DEFINE (M_ACL, "acl", "Access Control Lists")
 
static int kern___acl_aclcheck_path (struct thread *td, const char *path, acl_type_t type, struct acl *aclp, int follow)
 
static int kern___acl_delete_path (struct thread *td, const char *path, acl_type_t type, int follow)
 
static int kern___acl_get_path (struct thread *td, const char *path, acl_type_t type, struct acl *aclp, int follow)
 
static int kern___acl_set_path (struct thread *td, const char *path, acl_type_t type, const struct acl *aclp, int follow)
 
static int vacl_set_acl (struct thread *td, struct vnode *vp, acl_type_t type, const struct acl *aclp)
 
static int vacl_get_acl (struct thread *td, struct vnode *vp, acl_type_t type, struct acl *aclp)
 
static int vacl_aclcheck (struct thread *td, struct vnode *vp, acl_type_t type, const struct acl *aclp)
 
int acl_copy_oldacl_into_acl (const struct oldacl *source, struct acl *dest)
 
int acl_copy_acl_into_oldacl (const struct acl *source, struct oldacl *dest)
 
static int acl_copyin (const void *user_acl, struct acl *kernel_acl, acl_type_t type)
 
static int acl_copyout (const struct acl *kernel_acl, void *user_acl, acl_type_t type)
 
static int acl_type_unold (int type)
 
static int vacl_delete (struct thread *td, struct vnode *vp, acl_type_t type)
 
int sys___acl_get_file (struct thread *td, struct __acl_get_file_args *uap)
 
int sys___acl_get_link (struct thread *td, struct __acl_get_link_args *uap)
 
int sys___acl_set_file (struct thread *td, struct __acl_set_file_args *uap)
 
int sys___acl_set_link (struct thread *td, struct __acl_set_link_args *uap)
 
int sys___acl_get_fd (struct thread *td, struct __acl_get_fd_args *uap)
 
int sys___acl_set_fd (struct thread *td, struct __acl_set_fd_args *uap)
 
int sys___acl_delete_file (struct thread *td, struct __acl_delete_file_args *uap)
 
int sys___acl_delete_link (struct thread *td, struct __acl_delete_link_args *uap)
 
int sys___acl_delete_fd (struct thread *td, struct __acl_delete_fd_args *uap)
 
int sys___acl_aclcheck_file (struct thread *td, struct __acl_aclcheck_file_args *uap)
 
int sys___acl_aclcheck_link (struct thread *td, struct __acl_aclcheck_link_args *uap)
 
int sys___acl_aclcheck_fd (struct thread *td, struct __acl_aclcheck_fd_args *uap)
 
struct acl * acl_alloc (int flags)
 
void acl_free (struct acl *aclp)
 

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ acl_alloc()

struct acl * acl_alloc ( int  flags)

Definition at line 581 of file vfs_acl.c.

References flags, and malloc().

Referenced by acl_nfs4_is_trivial(), vacl_aclcheck(), vacl_get_acl(), and vacl_set_acl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ acl_copy_acl_into_oldacl()

int acl_copy_acl_into_oldacl ( const struct acl *  source,
struct oldacl *  dest 
)

Definition at line 108 of file vfs_acl.c.

Referenced by acl_copyout().

Here is the caller graph for this function:

◆ acl_copy_oldacl_into_acl()

int acl_copy_oldacl_into_acl ( const struct oldacl *  source,
struct acl *  dest 
)

Definition at line 86 of file vfs_acl.c.

Referenced by acl_copyin().

Here is the caller graph for this function:

◆ acl_copyin()

static int acl_copyin ( const void *  user_acl,
struct acl *  kernel_acl,
acl_type_t  type 
)
static

Definition at line 141 of file vfs_acl.c.

References acl_copy_oldacl_into_acl(), and type.

Referenced by vacl_aclcheck(), and vacl_set_acl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ acl_copyout()

static int acl_copyout ( const struct acl *  kernel_acl,
void *  user_acl,
acl_type_t  type 
)
static

Definition at line 165 of file vfs_acl.c.

References acl_copy_acl_into_oldacl(), and type.

Referenced by vacl_get_acl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ acl_free()

void acl_free ( struct acl *  aclp)

Definition at line 595 of file vfs_acl.c.

References free().

Referenced by acl_nfs4_is_trivial(), vacl_aclcheck(), vacl_get_acl(), and vacl_set_acl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ acl_type_unold()

static int acl_type_unold ( int  type)
static

Definition at line 202 of file vfs_acl.c.

References type.

Referenced by vacl_aclcheck(), vacl_delete(), vacl_get_acl(), and vacl_set_acl().

Here is the caller graph for this function:

◆ CTASSERT()

CTASSERT ( ACL_MAX_ENTRIES >=  OLDACL_MAX_ENTRIES)

◆ kern___acl_aclcheck_path()

static int kern___acl_aclcheck_path ( struct thread *  td,
const char *  path,
acl_type_t  type,
struct acl *  aclp,
int  follow 
)
static

Definition at line 545 of file vfs_acl.c.

References namei(), NDFREE(), path, type, and vacl_aclcheck().

Referenced by sys___acl_aclcheck_file(), and sys___acl_aclcheck_link().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern___acl_delete_path()

static int kern___acl_delete_path ( struct thread *  td,
const char *  path,
acl_type_t  type,
int  follow 
)
static

Definition at line 488 of file vfs_acl.c.

References namei(), NDFREE(), path, type, and vacl_delete().

Referenced by sys___acl_delete_file(), and sys___acl_delete_link().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern___acl_get_path()

static int kern___acl_get_path ( struct thread *  td,
const char *  path,
acl_type_t  type,
struct acl *  aclp,
int  follow 
)
static

Definition at line 374 of file vfs_acl.c.

References namei(), NDFREE(), path, type, and vacl_get_acl().

Referenced by sys___acl_get_file(), and sys___acl_get_link().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern___acl_set_path()

static int kern___acl_set_path ( struct thread *  td,
const char *  path,
acl_type_t  type,
const struct acl *  aclp,
int  follow 
)
static

Definition at line 412 of file vfs_acl.c.

References namei(), NDFREE(), path, type, and vacl_set_acl().

Referenced by sys___acl_set_file(), and sys___acl_set_link().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MALLOC_DEFINE()

MALLOC_DEFINE ( M_ACL  ,
"acl"  ,
"Access Control Lists"   
)

◆ sys___acl_aclcheck_fd()

int sys___acl_aclcheck_fd ( struct thread *  td,
struct __acl_aclcheck_fd_args *  uap 
)

Definition at line 564 of file vfs_acl.c.

References getvnode(), and vacl_aclcheck().

Here is the call graph for this function:

◆ sys___acl_aclcheck_file()

int sys___acl_aclcheck_file ( struct thread *  td,
struct __acl_aclcheck_file_args *  uap 
)

Definition at line 527 of file vfs_acl.c.

References kern___acl_aclcheck_path().

Here is the call graph for this function:

◆ sys___acl_aclcheck_link()

int sys___acl_aclcheck_link ( struct thread *  td,
struct __acl_aclcheck_link_args *  uap 
)

Definition at line 538 of file vfs_acl.c.

References kern___acl_aclcheck_path().

Here is the call graph for this function:

◆ sys___acl_delete_fd()

int sys___acl_delete_fd ( struct thread *  td,
struct __acl_delete_fd_args *  uap 
)

Definition at line 507 of file vfs_acl.c.

References getvnode(), and vacl_delete().

Here is the call graph for this function:

◆ sys___acl_delete_file()

int sys___acl_delete_file ( struct thread *  td,
struct __acl_delete_file_args *  uap 
)

Definition at line 471 of file vfs_acl.c.

References kern___acl_delete_path().

Here is the call graph for this function:

◆ sys___acl_delete_link()

int sys___acl_delete_link ( struct thread *  td,
struct __acl_delete_link_args *  uap 
)

Definition at line 481 of file vfs_acl.c.

References kern___acl_delete_path().

Here is the call graph for this function:

◆ sys___acl_get_fd()

int sys___acl_get_fd ( struct thread *  td,
struct __acl_get_fd_args *  uap 
)

Definition at line 431 of file vfs_acl.c.

References getvnode(), and vacl_get_acl().

Here is the call graph for this function:

◆ sys___acl_get_file()

int sys___acl_get_file ( struct thread *  td,
struct __acl_get_file_args *  uap 
)

Definition at line 355 of file vfs_acl.c.

References kern___acl_get_path().

Here is the call graph for this function:

◆ sys___acl_get_link()

int sys___acl_get_link ( struct thread *  td,
struct __acl_get_link_args *  uap 
)

Definition at line 366 of file vfs_acl.c.

References kern___acl_get_path().

Here is the call graph for this function:

◆ sys___acl_set_fd()

int sys___acl_set_fd ( struct thread *  td,
struct __acl_set_fd_args *  uap 
)

Definition at line 451 of file vfs_acl.c.

References getvnode(), and vacl_set_acl().

Here is the call graph for this function:

◆ sys___acl_set_file()

int sys___acl_set_file ( struct thread *  td,
struct __acl_set_file_args *  uap 
)

Definition at line 393 of file vfs_acl.c.

References kern___acl_set_path().

Here is the call graph for this function:

◆ sys___acl_set_link()

int sys___acl_set_link ( struct thread *  td,
struct __acl_set_link_args *  uap 
)

Definition at line 404 of file vfs_acl.c.

References kern___acl_set_path().

Here is the call graph for this function:

◆ vacl_aclcheck()

static int vacl_aclcheck ( struct thread *  td,
struct vnode *  vp,
acl_type_t  type,
const struct acl *  aclp 
)
static

Definition at line 329 of file vfs_acl.c.

References acl_alloc(), acl_copyin(), acl_free(), acl_type_unold(), and type.

Referenced by kern___acl_aclcheck_path(), and sys___acl_aclcheck_fd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vacl_delete()

static int vacl_delete ( struct thread *  td,
struct vnode *  vp,
acl_type_t  type 
)
static

Definition at line 298 of file vfs_acl.c.

References acl_type_unold(), type, vn_finished_write(), and vn_start_write().

Referenced by kern___acl_delete_path(), and sys___acl_delete_fd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vacl_get_acl()

static int vacl_get_acl ( struct thread *  td,
struct vnode *  vp,
acl_type_t  type,
struct acl *  aclp 
)
static

Definition at line 266 of file vfs_acl.c.

References acl_alloc(), acl_copyout(), acl_free(), acl_type_unold(), and type.

Referenced by kern___acl_get_path(), and sys___acl_get_fd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vacl_set_acl()

static int vacl_set_acl ( struct thread *  td,
struct vnode *  vp,
acl_type_t  type,
const struct acl *  aclp 
)
static

Definition at line 228 of file vfs_acl.c.

References acl_alloc(), acl_copyin(), acl_free(), acl_type_unold(), type, vn_finished_write(), and vn_start_write().

Referenced by kern___acl_set_path(), and sys___acl_set_fd().

Here is the call graph for this function:
Here is the caller graph for this function: