2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 06:16:03 +00:00

remove buffer and buffer2 from struct aa_audit

This commit is contained in:
John Johansen
2007-06-05 17:58:16 +00:00
parent 3f3c5ce968
commit 171dab27dc

View File

@@ -0,0 +1,69 @@
---
security/apparmor/apparmor.h | 2 --
security/apparmor/main.c | 17 ++++++++---------
2 files changed, 8 insertions(+), 11 deletions(-)
--- a/security/apparmor/apparmor.h
+++ b/security/apparmor/apparmor.h
@@ -154,9 +154,7 @@ struct aa_audit {
gfp_t gfp_mask;
const char *info;
const char *name;
- char *buffer;
const char *name2;
- char *buffer2;
int requested_mask, denied_mask;
struct iattr *iattr;
pid_t task, parent;
--- a/security/apparmor/main.c
+++ b/security/apparmor/main.c
@@ -177,9 +177,9 @@ static int aa_perm_dentry(struct aa_prof
struct vfsmount *mnt, struct aa_audit *sa, int check)
{
int error;
+ char *buffer = NULL;
- sa->buffer = NULL;
- sa->name = aa_get_name(dentry, mnt, &sa->buffer, check);
+ sa->name = aa_get_name(dentry, mnt, &buffer, check);
if (IS_ERR(sa->name)) {
/*
@@ -199,7 +199,7 @@ static int aa_perm_dentry(struct aa_prof
sa->error_code = 0;
error = aa_audit(profile, sa);
- aa_put_name_buffer(sa->buffer);
+ aa_put_name_buffer(buffer);
return error;
}
@@ -635,14 +635,13 @@ int aa_link(struct aa_profile *profile,
{
int error, check = 0;
struct aa_audit sa;
+ char *buffer = NULL, *buffer2 = NULL;
memset(&sa, 0, sizeof(sa));
sa.operation = "inode_link";
sa.gfp_mask = GFP_KERNEL;
- sa.buffer = NULL;
- sa.name = aa_get_name(link, link_mnt, &sa.buffer, check);
- sa.buffer2 = NULL;
- sa.name2 = aa_get_name(target, target_mnt, &sa.buffer2, check);
+ sa.name = aa_get_name(link, link_mnt, &buffer, check);
+ sa.name2 = aa_get_name(target, target_mnt, &buffer2, check);
if (IS_ERR(sa.name)) {
sa.error_code = PTR_ERR(sa.name);
@@ -662,8 +661,8 @@ int aa_link(struct aa_profile *profile,
error = aa_audit(profile, &sa);
- aa_put_name_buffer(sa.buffer);
- aa_put_name_buffer(sa.buffer2);
+ aa_put_name_buffer(buffer);
+ aa_put_name_buffer(buffer2);
return error;
}