rpm  5.4.15
rpmsx.h
Go to the documentation of this file.
1 #ifndef H_RPMSX
2 #define H_RPMSX
3 
8 #include <rpmiotypes.h>
9 #include <rpmio.h>
10 
11 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmsx_s * rpmsx;
12 
13 /*@unchecked@*/
14 extern int _rpmsx_debug;
15 
16 /*@unchecked@*/
17 extern rpmsx _rpmsxI;
18 
19 #if defined(_RPMSX_INTERNAL)
20 
22 struct rpmsx_s {
23  struct rpmioItem_s _item;
24  const char * fn;
25  unsigned int flags;
26 #if defined(__LCLINT__)
27 /*@refs@*/
28  int nrefs;
29 #endif
30 };
31 #endif /* _RPMSX_INTERNAL */
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
42 /*@unused@*/ /*@null@*/
43 rpmsx rpmsxUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmsx sx)
44  /*@modifies sx @*/;
45 #define rpmsxUnlink(_sx) \
46  ((rpmsx)rpmioUnlinkPoolItem((rpmioItem)(_sx), __FUNCTION__, __FILE__, __LINE__))
47 
53 /*@unused@*/ /*@newref@*/ /*@null@*/
54 rpmsx rpmsxLink (/*@null@*/ rpmsx sx)
55  /*@modifies sx @*/;
56 #define rpmsxLink(_sx) \
57  ((rpmsx)rpmioLinkPoolItem((rpmioItem)(_sx), __FUNCTION__, __FILE__, __LINE__))
58 
64 /*@null@*/
65 rpmsx rpmsxFree(/*@killref@*/ /*@null@*/rpmsx sx)
66  /*@globals fileSystem @*/
67  /*@modifies sx, fileSystem @*/;
68 #define rpmsxFree(_sx) \
69  ((rpmsx)rpmioFreePoolItem((rpmioItem)(_sx), __FUNCTION__, __FILE__, __LINE__))
70 
77 /*@newref@*/ /*@null@*/
78 rpmsx rpmsxNew(/*@null@*/ const char * fn, unsigned int flags)
79  /*@globals fileSystem, internalState @*/
80  /*@modifies fileSystem, internalState @*/;
81 
87 int rpmsxEnabled(/*@null@*/ rpmsx sx)
88  /*@globals fileSystem, internalState @*/
89  /*@modifies fileSystem, internalState @*/;
90 
98 /*@only@*/
99 const char * rpmsxMatch(/*@null@*/ rpmsx sx, const char * fn, mode_t mode)
100  /*@globals fileSystem, internalState @*/
101  /*@modifies sx, fileSystem, internalState @*/;
102 
109 /*@null@*/
110 const char * rpmsxGetfilecon(/*@null@*/ rpmsx sx, const char *fn)
111  /*@globals fileSystem, internalState @*/
112  /*@modifies fileSystem, internalState @*/;
113 /*@null@*/
114 const char * rpmsxLgetfilecon(/*@null@*/ rpmsx sx, const char *fn)
115  /*@globals fileSystem, internalState @*/
116  /*@modifies fileSystem, internalState @*/;
117 
126 int rpmsxSetfilecon(/*@null@*/ rpmsx sx, const char *fn, mode_t mode,
127  /*@null@*/ const char * scon)
128  /*@globals fileSystem, internalState @*/
129  /*@modifies sx, fileSystem, internalState @*/;
130 int rpmsxLsetfilecon(/*@null@*/ rpmsx sx, const char *fn, mode_t mode,
131  /*@null@*/ const char * scon)
132  /*@globals fileSystem, internalState @*/
133  /*@modifies sx, fileSystem, internalState @*/;
134 
142 int rpmsxExec(rpmsx sx, int verified, const char ** argv)
143  /*@globals fileSystem, internalState @*/
144  /*@modifies fileSystem, internalState @*/;
145 
146 #ifdef __cplusplus
147 }
148 #endif
149 
150 #endif /* H_RPMSX */
int rpmsxEnabled(rpmsx sx)
Return SELinux enabled state.
Definition: rpmsx.c:134
#define rpmsxLink(_sx)
Definition: rpmsx.h:56
int _rpmsx_debug
Definition: rpmsx.c:61
int rpmsxExec(rpmsx sx, int verified, const char **argv)
Execute a package scriptlet within SELinux context.
Definition: rpmsx.c:275
const char * rpmsxMatch(rpmsx sx, const char *fn, mode_t mode)
Return security context for a file.
Definition: rpmsx.c:151
const char * mode
Definition: mongo.h:440
#define rpmsxFree(_sx)
Definition: rpmsx.h:68
int rpmsxSetfilecon(rpmsx sx, const char *fn, mode_t mode, const char *scon)
Set security context for a file.
Definition: rpmsx.c:196
struct rpmsx_s * rpmsx
Definition: rpmsx.h:11
const char const bson int mongo_write_concern int flags
Definition: mongo.h:485
int rpmsxLsetfilecon(rpmsx sx, const char *fn, mode_t mode, const char *scon)
Definition: rpmsx.c:248
const char * rpmsxLgetfilecon(rpmsx sx, const char *fn)
Definition: rpmsx.c:223
#define rpmsxUnlink(_sx)
Definition: rpmsx.h:45
rpmsx rpmsxNew(const char *fn, unsigned int flags)
Create and load a SELinux wrapper.
Definition: rpmsx.c:97
const char * rpmsxGetfilecon(rpmsx sx, const char *fn)
Get security context for a file.
Definition: rpmsx.c:171
rpmsx _rpmsxI
Definition: rpmsx.c:64