diff options
| author | Richard Guy Briggs <rgb@redhat.com> | 2014-03-26 07:26:47 -0400 |
|---|---|---|
| committer | Eric Paris <eparis@redhat.com> | 2014-09-23 16:37:53 -0400 |
| commit | 219ca39427bf6c46c4e1473493e33bc00635e99b (patch) | |
| tree | c619484ff5565d783d29ae867253e1e24bda588e /include/linux | |
| parent | e7df61f4d1ddb7fdd654dde6cd40f7cc398c3932 (diff) | |
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>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/audit.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index 1ae00891aff9..36dffeccebdb 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -66,12 +66,16 @@ struct audit_krule { | |||
| 66 | 66 | ||
| 67 | struct audit_field { | 67 | struct audit_field { |
| 68 | u32 type; | 68 | u32 type; |
| 69 | u32 val; | 69 | union { |
| 70 | kuid_t uid; | 70 | u32 val; |
| 71 | kgid_t gid; | 71 | kuid_t uid; |
| 72 | kgid_t gid; | ||
| 73 | struct { | ||
| 74 | char *lsm_str; | ||
| 75 | void *lsm_rule; | ||
| 76 | }; | ||
| 77 | }; | ||
| 72 | u32 op; | 78 | u32 op; |
| 73 | char *lsm_str; | ||
| 74 | void *lsm_rule; | ||
| 75 | }; | 79 | }; |
| 76 | 80 | ||
| 77 | extern int is_audit_feature_set(int which); | 81 | extern int is_audit_feature_set(int which); |
