Commit bc04724a authored by Kinsbursky Stanislav's avatar Kinsbursky Stanislav Committed by Pavel Emelyanov

protobuf: use pb-vertical show function for creds

Signed-off-by: 's avatarStanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent da4d808a
...@@ -241,39 +241,9 @@ out: ...@@ -241,39 +241,9 @@ out:
pr_img_tail(CR_FD_ITIMERS); 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) void show_creds(int fd, struct cr_options *o)
{ {
CredsEntry *ce; pb_show_vertical(fd, creds_entry);
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);
} }
static int show_collect_pstree(int fd_pstree, struct list_head *collect) static int show_collect_pstree(int fd_pstree, struct list_head *collect)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment