static void print_map_entry (const GROUP_MAP *map, bool long_list)
{
+ struct dom_sid_buf buf;
+
if (!long_list)
d_printf("%s (%s) -> %s\n", map->nt_name,
- sid_string_tos(&map->sid), gidtoname(map->gid));
+ dom_sid_str_buf(&map->sid, &buf),
+ gidtoname(map->gid));
else {
d_printf("%s\n", map->nt_name);
- d_printf(_("\tSID : %s\n"), sid_string_tos(&map->sid));
+ d_printf(_("\tSID : %s\n"),
+ dom_sid_str_buf(&map->sid, &buf));
d_printf(_("\tUnix gid : %u\n"), (unsigned int)map->gid);
d_printf(_("\tUnix group: %s\n"), gidtoname(map->gid));
d_printf(_("\tGroup type: %s\n"),
/* Default is domain group. */
map->sid_name_use = SID_NAME_DOM_GRP;
if (pdb_getgrgid(map, gid)) {
+ struct dom_sid_buf buf;
d_printf(_("Unix group %s already mapped to SID %s\n"),
- unixgrp, sid_string_tos(&map->sid));
+ unixgrp, dom_sid_str_buf(&map->sid, &buf));
TALLOC_FREE(map);
return -1;
}
if (!sid_check_is_in_our_sam(&maps[i]->sid) &&
!sid_check_is_in_builtin(&maps[i]->sid))
{
+ struct dom_sid_buf buf;
printf(_("Deleting mapping for NT Group %s, sid %s\n"),
maps[i]->nt_name,
- sid_string_tos(&maps[i]->sid));
+ dom_sid_str_buf(&maps[i]->sid, &buf));
pdb_delete_group_mapping_entry(maps[i]->sid);
}
}
}
for (i = 0; i < num; i++) {
- printf("%s\n", sid_string_tos(&(members[i])));
+ struct dom_sid_buf buf;
+ printf("%s\n", dom_sid_str_buf(&(members[i]), &buf));
}
TALLOC_FREE(members);
{
uint32_t *alias_rids;
size_t i, num_alias_rids;
+ struct dom_sid_buf buf;
alias_rids = NULL;
num_alias_rids = 0;
mem_ctx, domain_sid, member, 1,
&alias_rids, &num_alias_rids))) {
d_fprintf(stderr, _("Could not list memberships for sid %s\n"),
- sid_string_tos(member));
+ dom_sid_str_buf(member, &buf));
return false;
}
for (i = 0; i < num_alias_rids; i++) {
struct dom_sid alias;
sid_compose(&alias, domain_sid, alias_rids[i]);
- printf("%s\n", sid_string_tos(&alias));
+ printf("%s\n", dom_sid_str_buf(&alias, &buf));
}
return true;
{
const char *dom, *name;
struct dom_sid sid;
+ struct dom_sid_buf buf;
enum lsa_SidType type;
if (argc != 1) {
return -1;
}
- d_printf("%s %d (%s) %s\\%s\n", sid_string_tos(&sid),
+ d_printf("%s %d (%s) %s\\%s\n", dom_sid_str_buf(&sid, &buf),
type, sid_type_lookup(type), dom, name);
return 0;
}
{
const char *dom, *name;
struct dom_sid sid;
+ struct dom_sid_buf buf;
enum lsa_SidType type;
if (argc != 1) {
return -1;
}
- d_printf("%s %d (%s) %s\\%s\n", sid_string_tos(&sid),
+ d_printf("%s %d (%s) %s\\%s\n", dom_sid_str_buf(&sid, &buf),
type, sid_type_lookup(type), dom, name);
return 0;
}
d_printf("%s\n", token->name);
for (i=0; i<token->token.num_sids; i++) {
- d_printf(" %s\n", sid_string_tos(&token->token.sids[i]));
+ struct dom_sid_buf buf;
+ d_printf(" %s\n",
+ dom_sid_str_buf(&token->token.sids[i], &buf));
}
}
#include "lib/netapi/netapi_net.h"
#include "../libcli/smbreadline/smbreadline.h"
#include "libsmb/libsmb.h"
+#include "libcli/security/dom_sid.h"
static NTSTATUS rpc_sh_info(struct net_context *c,
TALLOC_CTX *mem_ctx, struct rpc_sh_ctx *ctx,
{
NTSTATUS status;
struct rpc_sh_ctx *ctx;
+ struct dom_sid_buf buf;
if (argc != 0 || c->display_usage) {
d_printf("%s\nnet rpc shell\n", _("Usage:"));
}
d_printf(_("Talking to domain %s (%s)\n"), ctx->domain_name,
- sid_string_tos(ctx->domain_sid));
+ dom_sid_str_buf(ctx->domain_sid, &buf));
this_ctx = ctx;
for (i=0; i<num_sids; i++) {
const char *dom, *name;
enum lsa_SidType type;
+ struct dom_sid_buf buf;
if (lookup_sid(talloc_tos(), &sids[i], &dom, &name,
&type)) {
d_printf("%s\\%s\n", dom, name);
}
else {
- d_printf("%s\n", sid_string_tos(&sids[i]));
+ d_printf("%s\n",
+ dom_sid_str_buf(&sids[i], &buf));
}
}
return 0;
NTSTATUS status;
GROUP_MAP *map;
struct group *grp;
+ struct dom_sid_buf buf;
if (argc != 1 || c->display_usage) {
d_fprintf(stderr, "%s\n%s",
}
d_printf(_("Mapped unix group %s to SID %s\n"), argv[0],
- sid_string_tos(&map->sid));
+ dom_sid_str_buf(&map->sid, &buf));
TALLOC_FREE(map);
return 0;
d_printf(_("Deleted %s\\%s from %s\\%s\n"),
memberdomain, membername, groupdomain, groupname);
} else {
+ struct dom_sid_buf buf;
d_printf(_("Deleted %s from %s\\%s\n"),
- sid_string_tos(&member), groupdomain, groupname);
+ dom_sid_str_buf(&member, &buf),
+ groupdomain,
+ groupname);
}
return 0;
if (lookup_sid(talloc_tos(), &members[i], &dom, &name, NULL)) {
d_printf(" %s\\%s\n", dom, name);
} else {
- d_printf(" %s\n", sid_string_tos(&members[i]));
+ struct dom_sid_buf buf;
+ d_printf(" %s\n",
+ dom_sid_str_buf(&members[i], &buf));
}
}
static int net_sam_show(struct net_context *c, int argc, const char **argv)
{
struct dom_sid sid;
+ struct dom_sid_buf buf;
enum lsa_SidType type;
const char *dom, *name;
}
d_printf(_("%s\\%s is a %s with SID %s\n"), dom, name,
- sid_type_lookup(type), sid_string_tos(&sid));
+ sid_type_lookup(type), dom_sid_str_buf(&sid, &buf));
return 0;
}
for (i = 0; i < num_aces; i++) {
struct dom_sid sid;
+ struct dom_sid_buf buf;
const char *pcolon = strchr_m(pacl, ':');
const char *name;
}
}
us_acl = talloc_asprintf_append(
- us_acl, "%s:%c,", sid_string_tos(&sid), pcolon[1]);
+ us_acl,
+ "%s:%c,",
+ dom_sid_str_buf(&sid, &buf),
+ pcolon[1]);
/* Move to the next ACL entry. */
if (pcolon[2] == ',') {