/* Copyright (c) 2017-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "module-dir.h"
#include "randgen.h"
#include "mail-user.h"
#include "mail-storage-private.h"
#include "mail-storage-hooks.h"
#include <sys/apparmor.h>
/* hooks into user creation and deinit, will try to use
hats provided by apparmor_hat, apparmor_hat1... etc */
struct apparmor_mail_user {
unsigned long token;
};
void apparmor_plugin_init(struct module*);
void apparmor_plugin_deinit(void);
{
if (!user->mail_debug)
return;
i_debug("aa_getcon() failed: %m");
} else {
i_debug("apparmor: Current context=%s, mode=%s",
}
}
{
i_fatal("aa_change_hat(NULL) failed: %m");
}
{
/* see if we can find any hats */
const char *hat =
return;
for(unsigned int i = 2;; i++) {
}
/* we got hat(s) to try */
/* generate a magic token */
/* try change hat */
i_fatal("aa_change_hatv(%s) failed: %m",
}
}
};
{
}
void apparmor_plugin_deinit(void)
{
}