audit: use union for audit_field values since they are mutually exclusive

Since only one of val, uid, gid and lsm* are used at any given time, combine
them to reduce the size of the struct audit_field.

Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
This commit is contained in:
Richard Guy Briggs 2014-03-26 07:26:47 -04:00 committed by Eric Paris
parent e7df61f4d1
commit 219ca39427
2 changed files with 29 additions and 14 deletions

View file

@ -66,12 +66,16 @@ struct audit_krule {
struct audit_field {
u32 type;
u32 val;
kuid_t uid;
kgid_t gid;
union {
u32 val;
kuid_t uid;
kgid_t gid;
struct {
char *lsm_str;
void *lsm_rule;
};
};
u32 op;
char *lsm_str;
void *lsm_rule;
};
extern int is_audit_feature_set(int which);