/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
*/
#include <mdb/mdb_modapi.h>
#include <sys/cred_impl.h>
#include "cred.h"
static void print_ksid(const ksid_t *);
/*
* dcmd ::cred - display a credential (cred_t)
*/
int
{
return (DCMD_USAGE);
if (!(flags & DCMD_ADDRSPEC)) {
return (DCMD_USAGE);
}
return (DCMD_ERR);
}
} else {
mdb_warn("error reading credgrp_t at %p",
return (DCMD_ERR);
}
}
if (opts & OPT_VERBOSE) {
mdb_printf("%<u>cr_grps:%</u>\n");
mdb_inc_indent(4);
mdb_printf("(null)\n");
} else {
(void) mdb_call_dcmd("credgrp",
}
mdb_dec_indent(4);
mdb_printf("%<u>cr_ksid:%</u>\n");
mdb_inc_indent(4);
mdb_printf("(null)\n");
} else {
(void) mdb_call_dcmd("credsid",
}
mdb_dec_indent(4);
return (DCMD_OK);
}
if (DCMD_HDRSPEC(flags))
mdb_printf("%<u>%?s %8s %8s %8s %8s% %8s%</u>\n",
"ADDR", "UID", "GID", "RUID", "RGID", "#GRP(+SIDS)");
return (DCMD_OK);
}
/*
* dcmd ::credgrp - display cred_t groups
*/
int
{
return (DCMD_USAGE);
if (!(flags & DCMD_ADDRSPEC)) {
return (DCMD_USAGE);
}
return (DCMD_ERR);
}
if (opts & OPT_VERBOSE) {
}
mdb_printf("crg_groups = [\n");
mdb_inc_indent(4);
break;
}
}
mdb_dec_indent(4);
mdb_printf("\n]\n");
return (rv);
}
/*
* dcmd ::credsid - display a credsid_t
*/
int
{
return (DCMD_USAGE);
if (!(flags & DCMD_ADDRSPEC)) {
return (DCMD_USAGE);
}
return (DCMD_ERR);
}
if (opts & OPT_VERBOSE)
mdb_printf("kr_sidx[USER] = ");
mdb_printf("kr_sidx[GROUP] = ");
mdb_printf("kr_sidx[OWNER] = ");
mdb_printf("*kr_sidlist = {\n");
mdb_inc_indent(4);
mdb_dec_indent(4);
mdb_printf("}\n");
}
return (rv);
}
/*
* dcmd ::ksidlist - display a ksidlist_t
*/
int
{
return (DCMD_USAGE);
if (!(flags & DCMD_ADDRSPEC)) {
return (DCMD_USAGE);
}
return (DCMD_ERR);
}
if (opts & OPT_VERBOSE) {
}
mdb_printf("ksl_sids = [\n");
mdb_inc_indent(4);
break;
}
print_ksid(&ks);
}
mdb_dec_indent(4);
mdb_printf("]\n");
return (rv);
}
static void
{
/* in case of errors */
if (sa != 0)
}