From 422b3e890de18be3aa6da437017759e6b76b3c8e Mon Sep 17 00:00:00 2001 From: Rafal Krypa Date: Tue, 7 Jan 2014 16:25:32 +0100 Subject: [PATCH] libsmack: use 16 bits for smack access codes instead of sizeof(int) * 2 There are 6 access bits to be stored in the access field. Special value -1 is used to distinguish set rules from change rules. Shrinking the filed to 8 bits still leaves space for one more future access bit. Signed-off-by: Rafal Krypa --- libsmack/libsmack.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libsmack/libsmack.c b/libsmack/libsmack.c index 82a2b67..0e6eaea 100644 --- a/libsmack/libsmack.c +++ b/libsmack/libsmack.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -70,10 +71,10 @@ struct label_dict { }; struct smack_rule { + int8_t allow_code; + int8_t deny_code; int subject_id; int object_id; - int allow_code; - int deny_code; struct smack_rule *next; }; -- 2.7.4