Skip to content

Commit

Permalink
AppArmor: fix task_setrlimit prototype
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Slaby authored and James Morris committed Aug 16, 2010
1 parent da5cabf commit 7cb4dc9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions security/apparmor/lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7cb4dc9

Please sign in to comment.