From bc04724a2c1f5bb27195bbe1e971be5cd63cb5ad Mon Sep 17 00:00:00 2001 From: Kinsbursky Stanislav Date: Wed, 25 Jul 2012 18:30:09 +0400 Subject: [PATCH] protobuf: use pb-vertical show function for creds Signed-off-by: Stanislav Kinsbursky Signed-off-by: Pavel Emelyanov --- cr-show.c | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/cr-show.c b/cr-show.c index 298ab6d41..60562c55b 100644 --- a/cr-show.c +++ b/cr-show.c @@ -241,39 +241,9 @@ out: pr_img_tail(CR_FD_ITIMERS); } -static void show_cap(char *name, int nr, uint32_t *v) -{ - int i; - - pr_msg("%s: ", name); - for (i = nr - 1; i >= 0; i--) - pr_msg("0x%08x", v[i]); - pr_msg("\n"); -} - void show_creds(int fd, struct cr_options *o) { - CredsEntry *ce; - - pr_img_head(CR_FD_CREDS); - if (pb_read(fd, &ce, creds_entry) < 0) - goto out; - - pr_msg("uid %u euid %u suid %u fsuid %u\n", - ce->uid, ce->euid, ce->suid, ce->fsuid); - pr_msg("gid %u egid %u sgid %u fsgid %u\n", - ce->gid, ce->egid, ce->sgid, ce->fsgid); - - show_cap("Inh", ce->n_cap_inh, ce->cap_inh); - show_cap("Eff", ce->n_cap_eff, ce->cap_eff); - show_cap("Prm", ce->n_cap_prm, ce->cap_prm); - show_cap("Bnd", ce->n_cap_bnd, ce->cap_bnd); - - pr_msg("secbits: %#x\n", ce->secbits); - - creds_entry__free_unpacked(ce, NULL); -out: - pr_img_tail(CR_FD_CREDS); + pb_show_vertical(fd, creds_entry); } static int show_collect_pstree(int fd_pstree, struct list_head *collect)