mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
protobuf: use pb-vertical show function for creds
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
da4d808af8
commit
bc04724a2c
1 changed files with 1 additions and 31 deletions
32
cr-show.c
32
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue