]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
AppArmor: fix task_setrlimit prototype
authorJiri Slaby <jslaby@suse.cz>
Wed, 11 Aug 2010 09:28:02 +0000 (11:28 +0200)
committerJames Morris <jmorris@namei.org>
Mon, 16 Aug 2010 22:06:09 +0000 (08:06 +1000)
After rlimits tree was merged we get the following errors:
security/apparmor/lsm.c:663:2: warning: initialization from incompatible pointer type

It is because AppArmor was merged in the meantime, but uses the old
prototype. So fix it by adding struct task_struct as a first parameter
of apparmor_task_setrlimit.

NOTE that this is ONLY a compilation warning fix (and crashes caused
by that). It needs proper handling in AppArmor depending on who is the
'task'.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: James Morris <jmorris@namei.org>
security/apparmor/lsm.c

index d5666d3cc21b5a4e240e20924c63cd610236bef7..f73e2c2042185fff2d079dbdb3f4b8b828371e72 100644 (file)
@@ -607,8 +607,8 @@ static int apparmor_setprocattr(struct task_struct *task, char *name,
        return error;
 }
 
-static int apparmor_task_setrlimit(unsigned int resource,
-                                  struct rlimit *new_rlim)
+static int apparmor_task_setrlimit(struct task_struct *task,
+               unsigned int resource, struct rlimit *new_rlim)
 {
        struct aa_profile *profile = aa_current_profile();
        int error = 0;