|
Zbigniew Jędrzejewski-Szmek |
db38be |
From 5482192e5774f52f2af0665a3b58539295e9c0a4 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
From: Michael Scherer <misc@zarb.org>
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
Date: Sat, 11 Oct 2014 04:13:43 -0400
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
Subject: [PATCH] Report aa_change_onexec error code
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
Since aa_change_onexec return the error code in errno, and return
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
-1, the current code do not give any useful information when
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
something fail. This make apparmor easier to debug, as seen on
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760526
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
---
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
src/core/execute.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
diff --git a/src/core/execute.c b/src/core/execute.c
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
index 8b9bb27137..b165b33af0 100644
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
--- a/src/core/execute.c
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+++ b/src/core/execute.c
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
@@ -1698,7 +1698,7 @@ static int exec_child(ExecCommand *command,
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
err = aa_change_onexec(context->apparmor_profile);
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
if (err < 0 && !context->apparmor_profile_ignore) {
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
*error = EXIT_APPARMOR_PROFILE;
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
- return err;
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
+ return -errno;
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
}
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
}
|
|
Zbigniew Jędrzejewski-Szmek |
db38be |
#endif
|