rpm 5.3.12
Defines | Typedefs | Functions | Variables
rpmio/rpmsx.h File Reference
#include <rpmiotypes.h>
#include <rpmio.h>
Include dependency graph for rpmsx.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define rpmsxUnlink(_sx)   ((rpmsx)rpmioUnlinkPoolItem((rpmioItem)(_sx), __FUNCTION__, __FILE__, __LINE__))
#define rpmsxLink(_sx)   ((rpmsx)rpmioLinkPoolItem((rpmioItem)(_sx), __FUNCTION__, __FILE__, __LINE__))
#define rpmsxFree(_sx)   ((rpmsx)rpmioFreePoolItem((rpmioItem)(_sx), __FUNCTION__, __FILE__, __LINE__))

Typedefs

typedef struct rpmsx_s * rpmsx

Functions

rpmsx rpmsxUnlink (rpmsx sx)
 Unreference a SELinux wrapper instance.
rpmsx rpmsxLink (rpmsx sx)
 Reference a SELinux wrapper instance.
rpmsx rpmsxFree (rpmsx sx)
 Destroy a SELinux wrapper.
rpmsx rpmsxNew (const char *fn, unsigned int flags)
 Create and load a SELinux wrapper.
int rpmsxEnabled (rpmsx sx)
 Return SELinux enabled state.
const char * rpmsxMatch (rpmsx sx, const char *fn, mode_t mode)
 Return security context for a file.
const char * rpmsxGetfilecon (rpmsx sx, const char *fn)
 Get security context for a file.
const char * rpmsxLgetfilecon (rpmsx sx, const char *fn)
int rpmsxSetfilecon (rpmsx sx, const char *fn, mode_t mode, const char *scon)
 Set security context for a file.
int rpmsxLsetfilecon (rpmsx sx, const char *fn, mode_t mode, const char *scon)
int rpmsxExec (rpmsx sx, int verified, const char **argv)
 Execute a package scriptlet within SELinux context.

Variables

int _rpmsx_debug
rpmsx _rpmsxI

Detailed Description

Definition in file rpmsx.h.


Define Documentation

#define rpmsxFree (   _sx)    ((rpmsx)rpmioFreePoolItem((rpmioItem)(_sx), __FUNCTION__, __FILE__, __LINE__))

Definition at line 68 of file rpmsx.h.

#define rpmsxLink (   _sx)    ((rpmsx)rpmioLinkPoolItem((rpmioItem)(_sx), __FUNCTION__, __FILE__, __LINE__))

Definition at line 56 of file rpmsx.h.

#define rpmsxUnlink (   _sx)    ((rpmsx)rpmioUnlinkPoolItem((rpmioItem)(_sx), __FUNCTION__, __FILE__, __LINE__))

Definition at line 45 of file rpmsx.h.


Typedef Documentation

typedef struct rpmsx_s* rpmsx

Definition at line 11 of file rpmsx.h.


Function Documentation

int rpmsxEnabled ( rpmsx  sx)

Return SELinux enabled state.

Parameters:
sxSELinux wrapper (NULL uses active context)
Returns:
SELinux enabled state

Definition at line 134 of file rpmsx.c.

References _rpmsx_debug.

Referenced by rpmtsCreate().

int rpmsxExec ( rpmsx  sx,
int  verified,
const char **  argv 
)

Execute a package scriptlet within SELinux context.

Parameters:
sxSELinux wrapper
verifiedScriptlet came from signature verified header? (unused)
argvscriptlet helper
Returns:
0 on success

Definition at line 275 of file rpmsx.c.

References _rpmsx_debug, environ, and rpmsxI().

Referenced by runScript().

rpmsx rpmsxFree ( rpmsx  sx)

Destroy a SELinux wrapper.

Parameters:
sxSELinux wrapper
Returns:
NULL on last dereference

Referenced by _rpmtsRun(), genCpioListAndHeader(), rpmioClean(), and rpmtsFinish().

const char* rpmsxGetfilecon ( rpmsx  sx,
const char *  fn 
)

Get security context for a file.

Parameters:
sxSELinux wrapper (NULL uses active context)
fnfile path
Returns:
file security context (NULL on error/disabled)

Definition at line 171 of file rpmsx.c.

References _rpmsx_debug, and rpmsxI().

const char* rpmsxLgetfilecon ( rpmsx  sx,
const char *  fn 
)

Definition at line 223 of file rpmsx.c.

References _rpmsx_debug, and rpmsxI().

rpmsx rpmsxLink ( rpmsx  sx)

Reference a SELinux wrapper instance.

Parameters:
sxSELinux wrapper
Returns:
new SELinux wrapper reference

Referenced by rpmsxNew().

int rpmsxLsetfilecon ( rpmsx  sx,
const char *  fn,
mode_t  mode,
const char *  scon 
)

Definition at line 248 of file rpmsx.c.

References _rpmsx_debug, rpmsxI(), and rpmsxMatch().

Referenced by iosmStage().

const char* rpmsxMatch ( rpmsx  sx,
const char *  fn,
mode_t  mode 
)

Return security context for a file.

Parameters:
sxSELinux wrapper (NULL uses active context)
fnfile path
modefile mode
Returns:
file security context

Definition at line 151 of file rpmsx.c.

References _rpmsx_debug, rpmsxI(), and xstrdup().

Referenced by fsmMapFContext(), fsmMkdirs(), genCpioListAndHeader(), iosmMapFContext(), iosmMkdirs(), rpmsxLsetfilecon(), and rpmsxSetfilecon().

rpmsx rpmsxNew ( const char *  fn,
unsigned int  flags 
)

Create and load a SELinux wrapper.

Parameters:
fnSELinux file (NULL uses selinux_file_context_path()).
flagsSELinux set_matchpathcon_flags() flags
Returns:
new SELinux wrapper

Definition at line 97 of file rpmsx.c.

References _free(), rpmGetPath(), rpmsxGetPool(), and rpmsxLink().

Referenced by genCpioListAndHeader(), rpmsxI(), and rpmtsSetup().

int rpmsxSetfilecon ( rpmsx  sx,
const char *  fn,
mode_t  mode,
const char *  scon 
)

Set security context for a file.

Parameters:
sxSELinux wrapper (NULL uses active context)
fnfile path
modefile mode
sconfile security context (NULL calls matchpathcon())
Returns:
0 on success

Definition at line 196 of file rpmsx.c.

References _rpmsx_debug, rpmsxI(), and rpmsxMatch().

rpmsx rpmsxUnlink ( rpmsx  sx)

Unreference a SELinux wrapper instance.

Parameters:
sxSELinux wrapper
Returns:
NULL on last dereference

Variable Documentation

Definition at line 64 of file rpmsx.c.

Referenced by rpmioClean(), and rpmsxI().