* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#if HAVE_APPARMOR || HAVE_SELINUX
-
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include "conf.h"
#include "log.h"
-#include "lsm/lsm.h"
+#include "lsm.h"
lxc_log_define(lxc_lsm, lxc);
}
return drv->process_label_set(label, conf, use_default, on_exec);
}
-
-#endif
#include <sys/types.h>
-#include "../utils.h"
+#include "utils.h"
#define LXC_LSMATTRLEN (5 + (LXC_NUMSTRLEN64) + 7 + 1)
bool use_default, bool on_exec);
};
-#if HAVE_APPARMOR || HAVE_SELINUX
extern void lsm_init(void);
extern int lsm_enabled(void);
extern const char *lsm_name(void);
extern int lsm_process_label_fd_get(pid_t pid, bool on_exec);
extern int lsm_process_label_set_at(int label_fd, const char *label,
bool on_exec);
-#else
-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;
-}
-
-static inline int lsm_process_label_fd_get(pid_t pid, bool on_exec)
-{
- return 0;
-}
-
-extern int lsm_process_label_set_at(int label_fd, const char *label,
- bool on_exec)
-{
- return 0;
-}
-#endif
-
-#endif
+#endif /* __LXC_LSM_H */