]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.31/patches.apparmor/fsetattr-reintro-ATTR_FILE.diff
Add a patch to fix Intel E100 wake-on-lan problems.
[ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.apparmor / fsetattr-reintro-ATTR_FILE.diff
CommitLineData
6a930a95
BS
1From: John Johansen <jjohansen@suse.de>
2Subject: AppArmor: reintroduce ATTR_FILE
3
4The fsetattr patch removed ATTR_FILE but AppArmor needs it to distinguish
5file based writes.
6
7Note: Now that LSMs must be static, it would be better to add a file
8pointer argument to security_operations->inode_setattr() instead. Then
9move the fs.h chunk to patches.apparmor/fsetattr-restore-ia_file. -jeffm
10
11Signed-off-by: John Johansen <jjohansen@suse.de>
12
13---
14 fs/open.c | 3 +++
15 1 file changed, 3 insertions(+)
16
17--- a/fs/open.c
18+++ b/fs/open.c
19@@ -208,6 +208,9 @@ int do_truncate(struct dentry *dentry, s
20 newattrs.ia_size = length;
21 newattrs.ia_valid = ATTR_SIZE | time_attrs;
22
23+ if (filp)
24+ newattrs.ia_valid |= ATTR_FILE;
25+
26 /* Remove suid/sgid on truncate too */
27 newattrs.ia_valid |= should_remove_suid(dentry);
28