add back in MAY_APPEND filtering that was accidentally removed in r475 with dir rename fix

This commit is contained in:
John Johansen 2007-03-25 07:08:36 +00:00
parent 0d2e46088b
commit f5a8698fdf

View file

@ -883,6 +883,9 @@ int aa_perm(struct aaprofile *active, struct dentry *dentry,
if (!active)
goto out;
/* AppArmor does not use append so mask it off */
mask &= ~MAY_APPEND;
if (!leaf && dentry->d_inode && S_ISDIR(dentry->d_inode->i_mode)) {
mask &= ~(AA_MAY_EXEC | AA_MAY_WRITE);
}
@ -945,6 +948,9 @@ int aa_perm_dentry(struct aaprofile *active, struct dentry *dentry, int mask)
if (!active)
goto out;
/* AppArmor does not use append so mask it off */
mask &= ~MAY_APPEND;
/* perm dentry is always called as a leaf so no mask filtering is
* done like in aa_perm */