[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] id: fix: check return value of smack_new_label_from_path() < 0
From: |
Jarkko Sakkinen |
Subject: |
[PATCH] id: fix: check return value of smack_new_label_from_path() < 0 |
Date: |
Mon, 3 Jun 2013 20:15:20 +0300 |
Check that smack_new_label_from_path() < 0 and not just non-zero.
There was slight change to libsmack such that positive values are
reserved for returning length of the label.
---
src/id.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/id.c b/src/id.c
index 937b723..c91dbcd 100644
--- a/src/id.c
+++ b/src/id.c
@@ -210,7 +210,8 @@ main (int argc, char **argv)
if (selinux_enabled && getcon (&context) && just_context)
error (EXIT_FAILURE, 0, _("can't get process context"));
#ifdef HAVE_SMACK
- else if (smack_enabled && smack_new_label_from_self ((char **) &context))
+ else if (smack_enabled
+ && smack_new_label_from_self ((char **) &context) < 0)
error (EXIT_FAILURE, 0, _("can't get process context"));
#endif
}
--
1.8.1.2
- [PATCH] id: fix: check return value of smack_new_label_from_path() < 0,
Jarkko Sakkinen <=