Skip to content

Commit e76d733

Browse files
canonical-rlee287jrjohansen
authored andcommitted
apparmor: move the "conflicting profile attachments" infostr to a const declaration
Instead of having a literal, making this a constant will allow for (hacky) detection of conflicting profile attachments from inspection of the info pointer. This is used in the next patch to augment the information provided through domain.c:x_to_label for ix/ux fallback. Signed-off-by: Ryan Lee <ryan.lee@canonical.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
1 parent 89a3561 commit e76d733

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

security/apparmor/domain.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include "include/policy.h"
2929
#include "include/policy_ns.h"
3030

31+
static const char * const CONFLICTING_ATTACH_STR = "conflicting profile attachments";
32+
3133
/**
3234
* may_change_ptraced_domain - check if can change profile on ptraced task
3335
* @to_cred: cred of task changing domain
@@ -485,7 +487,7 @@ static struct aa_label *find_attach(const struct linux_binprm *bprm,
485487

486488
if (!candidate || conflict) {
487489
if (conflict)
488-
*info = "conflicting profile attachments";
490+
*info = CONFLICTING_ATTACH_STR;
489491
rcu_read_unlock();
490492
return NULL;
491493
}

0 commit comments

Comments
 (0)