libexplain  1.4.D001
Functions
libexplain/buffer/errno/chown.c File Reference
#include <libexplain/ac/errno.h>
#include <libexplain/ac/sys/stat.h>
#include <libexplain/ac/unistd.h>
#include <libexplain/buffer/dac.h>
#include <libexplain/buffer/does_not_have_inode_modify_permission.h>
#include <libexplain/buffer/eacces.h>
#include <libexplain/buffer/ebadf.h>
#include <libexplain/buffer/efault.h>
#include <libexplain/buffer/eio.h>
#include <libexplain/buffer/eloop.h>
#include <libexplain/buffer/enametoolong.h>
#include <libexplain/buffer/enoent.h>
#include <libexplain/buffer/enomem.h>
#include <libexplain/buffer/enosys.h>
#include <libexplain/buffer/enotdir.h>
#include <libexplain/buffer/eperm.h>
#include <libexplain/buffer/erofs.h>
#include <libexplain/buffer/errno/chown.h>
#include <libexplain/buffer/errno/generic.h>
#include <libexplain/buffer/errno/path_resolution.h>
#include <libexplain/buffer/file_type.h>
#include <libexplain/buffer/gettext.h>
#include <libexplain/buffer/gid.h>
#include <libexplain/buffer/pointer.h>
#include <libexplain/buffer/uid.h>
#include <libexplain/capability.h>
#include <libexplain/explanation.h>
#include <libexplain/group_in_groups.h>
#include <libexplain/option.h>

Go to the source code of this file.

Functions

static void explain_buffer_errno_chown_system_call (explain_string_buffer_t *sb, int errnum, const char *pathname, int owner, int group)
static int explain_buffer_eperm_chown_st (explain_string_buffer_t *sb, const char *pathname, const struct stat *st, int chown_restricted, int owner, int group, const char *caption, const explain_final_t *final_component)
static void explain_buffer_eperm_chown_vague (explain_string_buffer_t *sb, int owner, int group)
static void explain_buffer_eperm_chown (explain_string_buffer_t *sb, const char *pathname, int owner, int group, const char *pathname_caption, explain_final_t *final_component)
static void explain_buffer_eperm_chown_fd (explain_string_buffer_t *sb, int fildes, int owner, int group, const char *fildes_caption)
void explain_buffer_errno_chown_explanation (explain_string_buffer_t *sb, int errnum, const char *syscall_name, const char *pathname, int owner, int group, const char *pathname_caption)
static void explain_buffer_einval_chown (explain_string_buffer_t *sb)
void explain_buffer_errno_chown_explanation_fc (explain_string_buffer_t *sb, int errnum, const char *syscall_name, const char *pathname, int owner, int group, const char *pathname_caption, explain_final_t *final_component)
void explain_buffer_errno_fchown_explanation (explain_string_buffer_t *sb, int errnum, const char *syscall_name, int fildes, int owner, int group, const char *fildes_caption)
void explain_buffer_errno_chown (explain_string_buffer_t *sb, int errnum, const char *pathname, int owner, int group)

Function Documentation

static void explain_buffer_einval_chown ( explain_string_buffer_t sb) [static]

Definition at line 479 of file chown.c.

static void explain_buffer_eperm_chown ( explain_string_buffer_t sb,
const char *  pathname,
int  owner,
int  group,
const char *  pathname_caption,
explain_final_t final_component 
) [static]

Definition at line 323 of file chown.c.

static void explain_buffer_eperm_chown_fd ( explain_string_buffer_t sb,
int  fildes,
int  owner,
int  group,
const char *  fildes_caption 
) [static]

Definition at line 397 of file chown.c.

static int explain_buffer_eperm_chown_st ( explain_string_buffer_t sb,
const char *  pathname,
const struct stat *  st,
int  chown_restricted,
int  owner,
int  group,
const char *  caption,
const explain_final_t final_component 
) [static]

Definition at line 69 of file chown.c.

static void explain_buffer_eperm_chown_vague ( explain_string_buffer_t sb,
int  owner,
int  group 
) [static]

Definition at line 261 of file chown.c.

void explain_buffer_errno_chown ( explain_string_buffer_t sb,
int  errnum,
const char *  pathname,
int  uid,
int  gid 
)

The explain_buffer_errno_chown function is used to obtain an explanation of an error returned by the chown(2) system call. The least the message will contain is the value of strerror(errnum), but usually it will do much better, and indicate the underlying cause in more detail.

Parameters:
sbThe string buffer to print the message into. If a safe buffer is specified, this function is thread safe.
errnumThe error value to be decoded, usually obtained from the errno global variable just before this function is called. This is necessary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno.
pathnameThe original pathname, exactly as passed to the chown(2) system call.
uidThe original owner, exactly as passed to the chown(2) system call.
gidThe original group, exactly as passed to the chown(2) system call.

Definition at line 634 of file chown.c.

void explain_buffer_errno_chown_explanation ( explain_string_buffer_t sb,
int  errnum,
const char *  syscall_name,
const char *  pathname,
int  owner,
int  group,
const char *  pathname_caption 
)

The explain_buffer_errno_fchown_explanation function factors out code common to both several hown systcall foms.

Parameters:
sbThe string buffer to print the message into.
errnumThe error value to be decoded.
syscall_nameThe name of the offending system call.
pathnameThe original fildes, exactly as passed to the fchown(2) system call.
ownerThe original owner, exactly as passed to the fchown(2) system call.
groupThe original group, exactly as passed to the fchown(2) system call.
pathname_captionThe name of the offending system call argument.

Definition at line 455 of file chown.c.

void explain_buffer_errno_chown_explanation_fc ( explain_string_buffer_t sb,
int  errnum,
const char *  syscall_name,
const char *  pathname,
int  uid,
int  gid,
const char *  pathname_caption,
struct explain_final_t final_component 
)

The explain_buffer_errno_chown_explanation_fc function factors out code common to both the explain_buffer_errno_chown_explanation and explain_buffer_errno_lchown_explanation functions.

Parameters:
sbThe string buffer to print the message into.
errnumThe error value to be decoded.
syscall_nameThe name of the offending system call.
pathnameThe original pathname, exactly as passed to the chown(2) system call.
uidThe original owner, exactly as passed to the chown(2) system call.
gidThe original group, exactly as passed to the chown(2) system call.
pathname_captionThe name of the offending syscall argument.
final_componentThe designed properties of the final component.

Definition at line 496 of file chown.c.

static void explain_buffer_errno_chown_system_call ( explain_string_buffer_t sb,
int  errnum,
const char *  pathname,
int  owner,
int  group 
) [static]

Definition at line 52 of file chown.c.

void explain_buffer_errno_fchown_explanation ( explain_string_buffer_t sb,
int  errnum,
const char *  syscall_name,
int  fildes,
int  uid,
int  gid,
const char *  fildes_caption 
)

The explain_buffer_errno_fchown_explanation function factors out code common to both it and the explain_buffer_errno_chown_explanation function.

Parameters:
sbThe string buffer to print the message into.
errnumThe error value to be decoded.
syscall_nameThe name of the offending system call.
fildesThe original fildes, exactly as passed to the fchown(2) system call.
uidThe original owner, exactly as passed to the fchown(2) system call.
gidThe original group, exactly as passed to the fchown(2) system call.
fildes_captionThe name of the offending syscall argument.

Definition at line 570 of file chown.c.