1 From 6cc74075797edb6f698cb7f312bb1c3d8cc6cb28 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jose.bollo@iot.bzh>
3 Date: Thu, 12 Oct 2017 17:17:56 +0200
4 Subject: [PATCH] Switch Smack label earlier
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Switching label after removing capability isn't
12 Change-Id: Ib7dac8f071f36119520ed3205d743c1e3df3cd5e
13 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
15 src/core/execute.c | 14 +++++++-------
16 1 file changed, 7 insertions(+), 7 deletions(-)
18 diff --git a/src/core/execute.c b/src/core/execute.c
19 index d72e5bf08..0abffd569 100644
20 --- a/src/core/execute.c
21 +++ b/src/core/execute.c
22 @@ -2707,6 +2707,13 @@ static int exec_child(
26 + r = setup_smack(context, command);
28 + *exit_status = EXIT_SMACK_PROCESS_LABEL;
29 + *error_message = strdup("Failed to set SMACK process label");
33 if (!cap_test_all(context->capability_bounding_set)) {
34 r = capability_bounding_set_drop(context->capability_bounding_set, false);
36 @@ -2775,13 +2782,6 @@ static int exec_child(
40 - r = setup_smack(context, command);
42 - *exit_status = EXIT_SMACK_PROCESS_LABEL;
43 - *error_message = strdup("Failed to set SMACK process label");
48 if (context->apparmor_profile && mac_apparmor_use()) {
49 r = aa_change_onexec(context->apparmor_profile);