~ubuntu-core-dev/apparmor/master

« back to all changes in this revision

Viewing changes to deprecated/kernel-patches/2.6.25/fsetattr-reintro-ATTR_FILE.diff

  • Committer: Jamie Strandboge
  • Date: 2011-02-24 18:04:26 UTC
  • mfrom: (1415.3.4 apparmor-ubuntu-trunk)
  • Revision ID: jamie@canonical.com-20110224180426-q39kzcgsktwx8ixj
Released 2.6.0-0ubuntu1 to natty

[ Steve Beattie ]
* New upstream 2.6.0 release (LP: #724193)
  - Patches taken upstream and dropped:
    + 0001-ubuntu-buildd.patch
    + 0003-add-libvirt-support-to-dnsmasq.patch
    + 0004-lp698194.patch
    + 0005-aa-disable.patch
  - debian/rules: remove library path settings for mod_apparmor and
    pam_apprmor builds; upstream handles this properly now.
  - debian/apparmor-utils.install: handle upstream SubDomain.pm =>
    AppArmor.pm renaming
* debian/lib/apparmor/functions: handle profile names with embedded
  spaces (LP: #655523)
* debian/rules, debian/control, debian/python-libapparmor: build
  a python-libapparmor package.
[ Jamie Strandboge ]
* debian/control: use Section: python for python-libapparmor

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: John Johansen <jjohansen@suse.de>
2
 
Subject: AppArmor: reintroduce ATTR_FILE
3
 
 
4
 
The fsetattr patch removed ATTR_FILE but AppArmor needs it to distinguish
5
 
file based writes.
6
 
 
7
 
Note: Now that LSMs must be static, it would be better to add a file
8
 
pointer argument to security_operations->inode_setattr() instead. Then
9
 
move the fs.h chunk to patches.apparmor/fsetattr-restore-ia_file. -jeffm
10
 
 
11
 
Signed-off-by: John Johansen <jjohansen@suse.de>
12
 
 
13
 
---
14
 
 fs/open.c          |    3 +++
15
 
 include/linux/fs.h |    1 +
16
 
 2 files changed, 4 insertions(+)
17
 
 
18
 
--- a/fs/open.c
19
 
+++ b/fs/open.c
20
 
@@ -207,6 +207,9 @@ int do_truncate(struct dentry *dentry, s
21
 
        newattrs.ia_size = length;
22
 
        newattrs.ia_valid = ATTR_SIZE | time_attrs;
23
 
 
24
 
+       if (filp)
25
 
+               newattrs.ia_valid |= ATTR_FILE;
26
 
+
27
 
        /* Remove suid/sgid on truncate too */
28
 
        newattrs.ia_valid |= should_remove_suid(dentry);
29
 
 
30
 
--- a/include/linux/fs.h
31
 
+++ b/include/linux/fs.h
32
 
@@ -331,6 +331,7 @@ typedef void (dio_iodone_t)(struct kiocb
33
 
 #define ATTR_ATTR_FLAG 1024
34
 
 #define ATTR_KILL_SUID 2048
35
 
 #define ATTR_KILL_SGID 4096
36
 
+#define ATTR_FILE      8192
37
 
 #define ATTR_KILL_PRIV 16384
38
 
 #define ATTR_OPEN      32768   /* Truncating from open(O_TRUNC) */
39