mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 18:17:09 +00:00
Merge parser: drop dead code in mount.cc
perms = 0, therefore perms & something is always false. Fixes: coverity#320937 and coverity#320937 Also remove nop code from mnt_rule::post_parse_profile(Profile &prof) as discussed in this MR. MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1759 Approved-by: John Johansen <john@jjmx.net> Merged-by: John Johansen <john@jjmx.net>
This commit is contained in:
commit
ae70dc38f8
@ -1166,21 +1166,7 @@ fail:
|
|||||||
void mnt_rule::post_parse_profile(Profile &prof)
|
void mnt_rule::post_parse_profile(Profile &prof)
|
||||||
{
|
{
|
||||||
if (trans) {
|
if (trans) {
|
||||||
perm32_t perms = 0;
|
/* TODO: pivot_root profile transition */
|
||||||
int n = add_entry_to_x_table(&prof, trans);
|
|
||||||
if (!n) {
|
|
||||||
PERROR("Profile %s has too many specified profile transitions.\n", prof.name);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (perms & AA_USER_EXEC)
|
|
||||||
perms |= SHIFT_PERMS(n << 10, AA_USER_SHIFT);
|
|
||||||
if (perms & AA_OTHER_EXEC)
|
|
||||||
perms |= SHIFT_PERMS(n << 10, AA_OTHER_SHIFT);
|
|
||||||
perms = ((perms & ~AA_ALL_EXEC_MODIFIERS) |
|
|
||||||
(perms & AA_ALL_EXEC_MODIFIERS));
|
|
||||||
|
|
||||||
trans = NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user