libexplain  1.4.D001
Data Structures | Typedefs | Functions
libexplain/have_permission.h File Reference
#include <libexplain/string_buffer.h>

Go to the source code of this file.

Data Structures

struct  explain_have_identity_t

Typedefs

typedef struct
explain_have_identity_t 
explain_have_identity_t

Functions

void explain_have_identity_init (explain_have_identity_t *id)
int explain_have_read_permission (const struct stat *st, const explain_have_identity_t *hip)
int explain_explain_read_permission (explain_string_buffer_t *sb, const struct stat *st, const explain_have_identity_t *hip)
int explain_have_write_permission (const struct stat *st, const explain_have_identity_t *hip)
int explain_explain_write_permission (explain_string_buffer_t *sb, const struct stat *st, const explain_have_identity_t *hip)
int explain_have_execute_permission (const struct stat *st, const explain_have_identity_t *hip)
int explain_explain_execute_permission (explain_string_buffer_t *sb, const struct stat *st, const explain_have_identity_t *hip)
int explain_have_search_permission (const struct stat *st, const explain_have_identity_t *hip)
int explain_explain_search_permission (explain_string_buffer_t *sb, const struct stat *st, const explain_have_identity_t *hip)
int explain_have_inode_permission (const struct stat *st, const explain_have_identity_t *hip)
const char * explain_have_identity_kind_of_uid (const explain_have_identity_t *hip)
const char * explain_have_identity_kind_of_gid (const explain_have_identity_t *hip)

Typedef Documentation

Definition at line 27 of file have_permission.h.


Function Documentation

int explain_explain_execute_permission ( explain_string_buffer_t sb,
const struct stat *  st,
const explain_have_identity_t hip 
)

The explain_explain_execute_permission function may be used to explain why the current process (does not) have execute permissions on an inode.

Parameters:
sbThe string buffer to print into.
stThe stat structure containing information about the file.
hipThe user/process identity to check against.
Returns:
int; nonzero(true) if have permission, zero (false) if not.

Definition at line 374 of file have_permission.c.

int explain_explain_read_permission ( explain_string_buffer_t sb,
const struct stat *  st,
const explain_have_identity_t hip 
)

The explain_explain_read_permission function may be used to explain why the current process (does not) have read permissions on an inode.

Parameters:
sbThe string buffer to print into.
stThe stat structure containing information about the file.
hipThe user/process identity to check against.
Returns:
int; nonzero(true) if have permission, zero (false) if not.

Definition at line 315 of file have_permission.c.

int explain_explain_search_permission ( explain_string_buffer_t sb,
const struct stat *  st,
const explain_have_identity_t hip 
)

The explain_explain_search_permission function may be used to explain why the current process (does not) have search permissions on an inode.

Parameters:
sbThe string buffer to print into.
stThe stat structure containing information about the file.
hipThe user/process identity to check against.
Returns:
int; nonzero(true) if have permission, zero (false) if not.

Definition at line 410 of file have_permission.c.

int explain_explain_write_permission ( explain_string_buffer_t sb,
const struct stat *  st,
const explain_have_identity_t hip 
)

The explain_explain_write_permission function may be used to explain why the current process (does not) have write permissions on an inode.

Parameters:
sbThe string buffer to print into.
stThe stat structure containing information about the file.
hipThe user/process identity to check against.
Returns:
int; nonzero(true) if have permission, zero (false) if not.

Definition at line 340 of file have_permission.c.

int explain_have_execute_permission ( const struct stat *  st,
const explain_have_identity_t hip 
)

The explain_have_execute_permission function may be used to test whether or not the current process has execute permissions on an inode.

Parameters:
ststat structure containing information about the file.
hipThe user/process identity to check against.
Returns:
int; nonzero(true) if have permission, zero (false) if not.

Definition at line 355 of file have_permission.c.

The explain_have_identity_init function may be used to initialise an ID to the process effective ID.

Parameters:
idThe identity to be initialised.

Definition at line 465 of file have_permission.c.

The explain_have_identity_kind_of_gid is used to obtain a string describing the kind of GID in the identity.

Parameters:
hipThe identity of interest
Returns:
One of "real GID" or "effective GID", suitably translated.

Definition at line 451 of file have_permission.c.

The explain_have_identity_kind_of_uid is used to obtain a string describing the kind of UID in the identity.

Parameters:
hipThe identity of interest
Returns:
One of "real UID" or "effective UID", suitably translated.

Definition at line 437 of file have_permission.c.

int explain_have_inode_permission ( const struct stat *  st,
const explain_have_identity_t hip 
)

The explain_have_inode_permission function may be used to test whether or not the current process has inode changing permissions (utimes, chmod, etc) to an inode.

Parameters:
ststat structure containing information about the file.
hipThe user/process identity to check against.
Returns:
int; nonzero(true) if have permission, zero (false) if not.

Definition at line 427 of file have_permission.c.

int explain_have_read_permission ( const struct stat *  st,
const explain_have_identity_t hip 
)

The explain_have_read_permission function may be used to test whether or not the current process has read permissions on an inode.

Parameters:
ststat structure containing information about the file.
hipThe user/process identity to check against.
Returns:
int; nonzero(true) if have permission, zero (false) if not.

Definition at line 305 of file have_permission.c.

int explain_have_search_permission ( const struct stat *  st,
const explain_have_identity_t hip 
)

The explain_have_search_permission function may be used to test whether or not the current process has search permissions on an inode.

Parameters:
ststat structure containing information about the file.
hipThe user/process identity to check against.
Returns:
int; nonzero(true) if have permission, zero (false) if not.

Definition at line 398 of file have_permission.c.

int explain_have_write_permission ( const struct stat *  st,
const explain_have_identity_t hip 
)

The explain_have_write_permission function may be used to test whether or not the current process has write permissions on an inode.

Parameters:
ststat structure containing information about the file.
hipThe user/process identity to check against.
Returns:
int; nonzero(true) if have permission, zero (false) if not.

Definition at line 330 of file have_permission.c.