From a7263263aaa4547b0ac7238eebfbe168f24cc298 Mon Sep 17 00:00:00 2001 From: Rafal Krypa Date: Mon, 2 Dec 2013 16:03:28 +0100 Subject: [PATCH] libsmack: fix smack_cipso_apply() failing with more than one rule Fixing regression in f47b9c90 that causes smack_cipso_apply() to fail due to a typo. Signed-off-by: Rafal Krypa --- libsmack/libsmack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsmack/libsmack.c b/libsmack/libsmack.c index 28218ac..843c7e5 100644 --- a/libsmack/libsmack.c +++ b/libsmack/libsmack.c @@ -390,7 +390,7 @@ int smack_cipso_apply(struct smack_cipso *cipso) int fd; int i; char path[PATH_MAX]; - int offset=0; + int offset; if (!smackfs_mnt) return -1; @@ -403,7 +403,7 @@ int smack_cipso_apply(struct smack_cipso *cipso) memset(buf,0,CIPSO_MAX_SIZE); for (m = cipso->first; m != NULL; m = m->next) { snprintf(buf, SMACK_LABEL_LEN + 1, "%s", m->label); - offset += strlen(buf) + 1; + offset = strlen(buf) + 1; sprintf(&buf[offset], CIPSO_NUM_LEN_STR, m->level); offset += NUM_LEN; -- 2.7.4