From 5dfc54615a1eacea18106383c964425cebd67c30 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 23 Oct 2014 18:34:58 +0200 Subject: smack: rework SMACK label fixing code to follow more closely the semantics of the matching selinux code --- src/shared/label.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/shared/label.c') diff --git a/src/shared/label.c b/src/shared/label.c index eae6614969..38992be153 100644 --- a/src/shared/label.c +++ b/src/shared/label.c @@ -23,19 +23,15 @@ #include "util.h" int label_fix(const char *path, bool ignore_enoent, bool ignore_erofs) { - int r = 0; + int r, q; - if (mac_selinux_use()) { - r = mac_selinux_fix(path, ignore_enoent, ignore_erofs); - if (r < 0) - return r; - } + r = mac_selinux_fix(path, ignore_enoent, ignore_erofs); + q = mac_smack_fix(path, ignore_enoent, ignore_erofs); - if (mac_smack_use()) { - r = mac_smack_fix(path); - if (r < 0) - return r; - } + if (r < 0) + return r; + if (q < 0) + return q; - return r; + return 0; } -- cgit v1.2.3-54-g00ecf