From: Eugene Syromyatnikov Date: Sun, 27 Nov 2016 00:35:02 +0000 (+0300) Subject: capability: fix omission of capability structure field names X-Git-Tag: v4.15~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=827b170b72dea630a79623982cef452e3055e6ce;p=strace capability: fix omission of capability structure field names * capability.c (print_cap_header, print_cap_data): Add field names to the output. * tests/caps.awk: Update test output. --- diff --git a/capability.c b/capability.c index 421649d5..5daefa6c 100644 --- a/capability.c +++ b/capability.c @@ -85,10 +85,10 @@ print_cap_header(struct tcb *tcp, unsigned long addr, cap_user_header_t h) return; } - tprints("{"); + tprints("{version="); printxval(cap_version, h->version, "_LINUX_CAPABILITY_VERSION_???"); - tprintf(", %d}", h->pid); + tprintf(", pid=%d}", h->pid); } static void @@ -124,11 +124,11 @@ print_cap_data(struct tcb *tcp, unsigned long addr, const cap_user_header_t h) if (umoven_or_printaddr(tcp, addr, len * sizeof(data[0]), data)) return; - tprints("{"); + tprints("{effective="); print_cap_bits(data[0].effective, len > 1 ? data[1].effective : 0); - tprints(", "); + tprints(", permitted="); print_cap_bits(data[0].permitted, len > 1 ? data[1].permitted : 0); - tprints(", "); + tprints(", inheritable="); print_cap_bits(data[0].inheritable, len > 1 ? data[1].inheritable : 0); tprints("}"); } diff --git a/tests/caps.awk b/tests/caps.awk index 61304829..c6e31efa 100644 --- a/tests/caps.awk +++ b/tests/caps.awk @@ -35,19 +35,19 @@ BEGIN { r_addr = "0x[[:xdigit:]]+" s[1] = "capget(NULL, NULL) = " s_efault r[2] = "^capget\\(" r_addr ", " r_addr "\\) = " r_efault - r[3] = "^capget\\(\\{_LINUX_CAPABILITY_VERSION_3, 0\\}, " r_addr "\\) = " r_efault - r[4] = "^capget\\(\\{_LINUX_CAPABILITY_VERSION_3, 0\\}, \\{" cap ", " cap ", " cap "\\}\\) = 0$" + r[3] = "^capget\\(\\{version=_LINUX_CAPABILITY_VERSION_3, pid=0\\}, " r_addr "\\) = " r_efault + r[4] = "^capget\\(\\{version=_LINUX_CAPABILITY_VERSION_3, pid=0\\}, \\{effective=" cap ", permitted=" cap ", inheritable=" cap "\\}\\) = 0$" - capset_v1_data = "{1<