]> granicus.if.org Git - strace/commitdiff
prctl: add PR_CAP_AMBIENT parser
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 6 Dec 2015 15:33:53 +0000 (15:33 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 6 Dec 2015 15:33:53 +0000 (15:33 +0000)
* xlat/pr_cap_ambient.in: New file.
* prctl.c: Include "xlat/pr_cap_ambient.h".
(SYS_FUNC(prctl)): Handle PR_CAP_AMBIENT.

prctl.c
xlat/pr_cap_ambient.in [new file with mode: 0644]

diff --git a/prctl.c b/prctl.c
index 23c012251fc862e91fcbf316bd8f5a26a30b0396..fa16c5c17a3915c9cb7e4e29ee334735dfd63a2e 100644 (file)
--- a/prctl.c
+++ b/prctl.c
@@ -3,11 +3,12 @@
 #include <sys/prctl.h>
 
 #include "xlat/prctl_options.h"
-#include "xlat/pr_unalign_flags.h"
+#include "xlat/pr_cap_ambient.h"
 #include "xlat/pr_mce_kill.h"
 #include "xlat/pr_mce_kill_policy.h"
 #include "xlat/pr_set_mm.h"
 #include "xlat/pr_tsc.h"
+#include "xlat/pr_unalign_flags.h"
 
 #ifndef TASK_COMM_LEN
 # define TASK_COMM_LEN 16
@@ -142,6 +143,23 @@ SYS_FUNC(prctl)
                printxval(cap, tcp->u_arg[1], "CAP_???");
                return RVAL_DECODED;
 
+       case PR_CAP_AMBIENT:
+               tprints(", ");
+               printxval(pr_cap_ambient, tcp->u_arg[1], "PR_CAP_AMBIENT_???");
+               switch (tcp->u_arg[1]) {
+               case PR_CAP_AMBIENT_RAISE:
+               case PR_CAP_AMBIENT_LOWER:
+               case PR_CAP_AMBIENT_IS_SET:
+                       tprints(", ");
+                       printxval(cap, tcp->u_arg[2], "CAP_???");
+                       print_prctl_args(tcp, 3);
+                       break;
+               default:
+                       print_prctl_args(tcp, 2);
+                       break;
+               }
+               return RVAL_DECODED;
+
        case PR_MCE_KILL:
                tprints(", ");
                printxval(pr_mce_kill, tcp->u_arg[1], "PR_MCE_KILL_???");
diff --git a/xlat/pr_cap_ambient.in b/xlat/pr_cap_ambient.in
new file mode 100644 (file)
index 0000000..0f0d2f2
--- /dev/null
@@ -0,0 +1,4 @@
+PR_CAP_AMBIENT_IS_SET  1
+PR_CAP_AMBIENT_RAISE   2
+PR_CAP_AMBIENT_LOWER   3
+PR_CAP_AMBIENT_CLEAR_ALL       4