lsm: non-functional changes

parent 95220ee6
......@@ -172,7 +172,7 @@ static bool aa_needs_transition(char *curlabel)
* Notes: This relies on /proc being available.
*/
static int apparmor_process_label_set(const char *inlabel, struct lxc_conf *conf,
int use_default, int on_exec)
bool use_default, bool on_exec)
{
const char *label = inlabel ? inlabel : conf->lsm_aa_profile;
char *curlabel;
......
......@@ -86,7 +86,7 @@ char *lsm_process_label_get(pid_t pid)
}
int lsm_process_label_set(const char *label, struct lxc_conf *conf,
int use_default, int on_exec)
bool use_default, bool on_exec)
{
if (!drv) {
ERROR("LSM driver not inited");
......
......@@ -28,29 +28,52 @@ struct lxc_conf;
#include <sys/types.h>
#include "../utils.h"
#define LXC_LSMATTRLEN (5 + (LXC_NUMSTRLEN64) + 7 + 1)
struct lsm_drv {
const char *name;
int (*enabled)(void);
int (*enabled)(void);
char *(*process_label_get)(pid_t pid);
int (*process_label_set)(const char *label, struct lxc_conf *conf,
int use_default, int on_exec);
int (*process_label_set)(const char *label, struct lxc_conf *conf,
bool use_default, bool on_exec);
};
#if HAVE_APPARMOR || HAVE_SELINUX
void lsm_init(void);
int lsm_enabled(void);
const char *lsm_name(void);
char *lsm_process_label_get(pid_t pid);
int lsm_process_label_set(const char *label, struct lxc_conf *conf,
int use_default, int on_exec);
extern void lsm_init(void);
extern int lsm_enabled(void);
extern const char *lsm_name(void);
extern char *lsm_process_label_get(pid_t pid);
extern int lsm_process_label_set(const char *label, struct lxc_conf *conf,
bool use_default, bool on_exec);
#else
static inline void lsm_init(void) { }
static inline int lsm_enabled(void) { return 0; }
static inline const char *lsm_name(void) { return "none"; }
static inline char *lsm_process_label_get(pid_t pid) { return NULL; }
static inline int lsm_process_label_set(const char *label,
struct lxc_conf *conf, int use_default, int on_exec) { return 0; }
static inline void lsm_init(void)
{
return;
}
static inline int lsm_enabled(void) {
return 0;
}
static inline const char *lsm_name(void)
{
return "none";
}
static inline char *lsm_process_label_get(pid_t pid)
{
return NULL;
}
static inline int lsm_process_label_set(const char *label,
struct lxc_conf *conf, bool use_default,
bool on_exec)
{
return 0;
}
#endif
#endif
......@@ -30,7 +30,7 @@ static char *nop_process_label_get(pid_t pid)
}
static int nop_process_label_set(const char *label, struct lxc_conf *conf,
int use_default, int on_exec)
bool use_default, bool on_exec)
{
return 0;
}
......
......@@ -72,7 +72,7 @@ static char *selinux_process_label_get(pid_t pid)
* Notes: This relies on /proc being available.
*/
static int selinux_process_label_set(const char *inlabel, struct lxc_conf *conf,
int use_default, int on_exec)
bool use_default, bool on_exec)
{
const char *label = inlabel ? inlabel : conf->lsm_se_context;
if (!label) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment