#include <regex.h>
Go to the source code of this file.
Defines | |
#define | rpmsxUnlink(_sx, _msg) XrpmsxUnlink(_sx, _msg, __FILE__, __LINE__) |
#define | rpmsxLink(_sx, _msg) XrpmsxLink(_sx, _msg, __FILE__, __LINE__) |
Typedefs | |
typedef rpmsx_s * | rpmsx |
typedef rpmsxp_s * | rpmsxp |
typedef rpmsxs_s * | rpmsxs |
Functions | |
rpmsx | rpmsxUnlink (rpmsx sx, const char *msg) |
Unreference a security context patterns instance. | |
rpmsx | XrpmsxUnlink (rpmsx sx, const char *msg, const char *fn, unsigned ln) |
rpmsx | rpmsxLink (rpmsx sx, const char *msg) |
Reference a security context patterns instance. | |
rpmsx | XrpmsxLink (rpmsx sx, const char *msg, const char *fn, unsigned ln) |
rpmsx | rpmsxFree (rpmsx sx) |
Destroy a security context patterns. | |
int | rpmsxParse (rpmsx sx, const char *fn) |
Parse selinux file security context patterns. | |
rpmsx | rpmsxNew (const char *fn) |
Create and load security context patterns. | |
int | rpmsxCount (const rpmsx sx) |
Return security context patterns count. | |
int | rpmsxIx (const rpmsx sx) |
Return security context patterns index. | |
int | rpmsxSetIx (rpmsx sx, int ix) |
Set security context patterns index. | |
const char * | rpmsxPattern (const rpmsx sx) |
Return current pattern. | |
const char * | rpmsxType (const rpmsx sx) |
Return current type. | |
const char * | rpmsxContext (const rpmsx sx) |
Return current context. | |
regex_t * | rpmsxRE (const rpmsx sx) |
Return current regex. | |
mode_t | rpmsxFMode (const rpmsx sx) |
Return current file mode. | |
int | rpmsxFStem (const rpmsx sx) |
Return current file stem. | |
int | rpmsxNext (rpmsx sx) |
Return next security context patterns iterator index. | |
rpmsx | rpmsxInit (rpmsx sx, int reverse) |
Initialize security context patterns iterator. | |
const char * | rpmsxFContext (rpmsx sx, const char *fn, mode_t fmode) |
Find file security context from path and type. | |
Variables | |
int | _rpmsx_debug |
int | _rpmsx_nopromote |
Definition in file rpmsx.h.
#define rpmsxLink | ( | _sx, | |||
_msg | ) | XrpmsxLink(_sx, _msg, __FILE__, __LINE__) |
Definition at line 116 of file rpmsx.h.
Referenced by rpmsxNew(), rpmtsREContext(), and rpmtsSetREContext().
#define rpmsxUnlink | ( | _sx, | |||
_msg | ) | XrpmsxUnlink(_sx, _msg, __FILE__, __LINE__) |
const char* rpmsxContext | ( | const rpmsx | sx | ) |
Return current context.
sx | security context patterns |
Definition at line 578 of file rpmsx.c.
Referenced by rpmsxFContext().
int rpmsxCount | ( | const rpmsx | sx | ) |
const char* rpmsxFContext | ( | rpmsx | sx, | |
const char * | fn, | |||
mode_t | fmode | |||
) |
Find file security context from path and type.
sx | security context patterns | |
fn | file path | |
fmode | file mode |
Definition at line 658 of file rpmsx.c.
References rpmsxContext(), rpmsxFind(), rpmsxFMode(), rpmsxFStem(), rpmsxInit(), rpmsxNext(), rpmsxPattern(), and rpmsxRE().
mode_t rpmsxFMode | ( | const rpmsx | sx | ) |
Return current file mode.
sx | security context patterns |
Definition at line 596 of file rpmsx.c.
Referenced by rpmsxFContext().
Destroy a security context patterns.
sx | security context patterns |
Definition at line 226 of file rpmsx.c.
References _free(), _rpmsx_debug, and rpmsxUnlink.
Referenced by rpmsxNew(), rpmtsFree(), and rpmtsSetREContext().
int rpmsxFStem | ( | const rpmsx | sx | ) |
Return current file stem.
sx | security context patterns |
Definition at line 605 of file rpmsx.c.
Referenced by rpmsxFContext().
Initialize security context patterns iterator.
sx | security context patterns | |
reverse | iterate in reverse order? |
Definition at line 646 of file rpmsx.c.
Referenced by rpmsxFContext().
int rpmsxIx | ( | const rpmsx | sx | ) |
Reference a security context patterns instance.
sx | security context patterns | |
msg |
rpmsx rpmsxNew | ( | const char * | fn | ) |
Create and load security context patterns.
fn | security context patterns file name |
Definition at line 518 of file rpmsx.c.
References rpmsxFree(), rpmsxLink, rpmsxParse(), and xcalloc().
int rpmsxNext | ( | rpmsx | sx | ) |
Return next security context patterns iterator index.
sx | security context patterns |
Definition at line 614 of file rpmsx.c.
References _rpmsx_debug.
Referenced by rpmsxFContext().
int rpmsxParse | ( | rpmsx | sx, | |
const char * | fn | |||
) |
Parse selinux file security context patterns.
sx | security context patterns | |
fn | file name to parse |
Definition at line 319 of file rpmsx.c.
References _, _free(), errno, inc_err, items, rpmGetPath(), rpmsxAdd(), rpmsxpCheckNoDupes(), rpmsxpHasMetaChars(), rpmsxSort(), S_IFSOCK, security_check_context, xcalloc(), and xmalloc().
Referenced by rpmsxNew().
const char* rpmsxPattern | ( | const rpmsx | sx | ) |
Return current pattern.
sx | security context patterns |
Definition at line 560 of file rpmsx.c.
Referenced by rpmsxFContext().
regex_t* rpmsxRE | ( | const rpmsx | sx | ) |
Return current regex.
sx | security context patterns |
Definition at line 587 of file rpmsx.c.
Referenced by rpmsxFContext().
int rpmsxSetIx | ( | rpmsx | sx, | |
int | ix | |||
) |
const char* rpmsxType | ( | const rpmsx | sx | ) |
Unreference a security context patterns instance.
sx | security context patterns | |
msg |
Definition at line 213 of file rpmsx.c.
References _rpmsx_debug.
Definition at line 202 of file rpmsx.c.
References _rpmsx_debug.
int _rpmsx_debug |
int _rpmsx_nopromote |