Add an apparmor_profile sudo setting
Define a new sudo setting, `apparmor_profile`, that can be used to pass in an AppArmor profile that should be used to confine commands. If apparmor_profile is specified, sudo will execute the command using the new `apparmor_execve` function, which confines the command under the provided profile before exec'ing it.
This commit is contained in:
@@ -103,6 +103,7 @@
|
||||
#define ARG_CWD 24
|
||||
#define ARG_ASKPASS 25
|
||||
#define ARG_INTERCEPT_SETID 26
|
||||
#define ARG_APPARMOR_PROFILE 27
|
||||
|
||||
/*
|
||||
* Flags for tgetpass()
|
||||
@@ -198,6 +199,7 @@ struct command_details {
|
||||
const char *chroot;
|
||||
const char *selinux_role;
|
||||
const char *selinux_type;
|
||||
const char *apparmor_profile;
|
||||
const char *utmp_user;
|
||||
const char *tty;
|
||||
char **argv;
|
||||
@@ -285,6 +287,10 @@ int selinux_setexeccon(void);
|
||||
void selinux_execve(int fd, const char *path, char *const argv[],
|
||||
char *envp[], int flags);
|
||||
|
||||
/* apparmor.c */
|
||||
int apparmor_is_enabled(void);
|
||||
int apparmor_prepare(const char* new_profile);
|
||||
|
||||
/* solaris.c */
|
||||
void set_project(struct passwd *);
|
||||
int os_init_solaris(int argc, char *argv[], char *envp[]);
|
||||
|
Reference in New Issue
Block a user