if (!sid_split_rid(&domsid, &rid)) {
return NULL;
}
- if (!sid_to_string(string_sid, &domsid)) {
+ if (!sid_to_fstring(string_sid, &domsid)) {
return NULL;
}
/* we split by domain and rid so we can do a subtree search
if (ldb_msg_add_string(msg, "objectClass", "groupMap") != LDB_SUCCESS ||
ldb_msg_add_string(msg, "sid",
- sid_to_string(string_sid, &map->sid)) != LDB_SUCCESS ||
+ sid_to_fstring(string_sid, &map->sid)) != LDB_SUCCESS ||
ldb_msg_add_fmt(msg, "gidNumber", "%u", (unsigned)map->gid) != LDB_SUCCESS ||
ldb_msg_add_fmt(msg, "sidNameUse", "%u", (unsigned)map->sid_name_use) != LDB_SUCCESS ||
ldb_msg_add_string(msg, "comment", map->comment) != LDB_SUCCESS ||
/* we do a subtree search on the domain */
if (domsid != NULL) {
- sid_to_string(name, domsid);
+ sid_to_fstring(name, domsid);
basedn = ldb_dn_string_compose(tmp_ctx, NULL, "domain=%s", name);
if (basedn == NULL) goto failed;
}
fstring string_sid;
NTSTATUS status = NT_STATUS_INTERNAL_DB_CORRUPTION;
- if (!sid_to_string(string_sid, member)) {
+ if (!sid_to_fstring(string_sid, member)) {
return NT_STATUS_INVALID_PARAMETER;
}
GROUP_MAP map;
if (!get_group_map_from_sid(*alias, &map)) {
- sid_to_string(string_sid, alias);
+ sid_to_fstring(string_sid, alias);
return NT_STATUS_NO_SUCH_ALIAS;
}
el.name = talloc_strdup(tmp_ctx, "member");
el.num_values = 1;
el.values = &val;
- sid_to_string(string_sid, member);
+ sid_to_fstring(string_sid, member);
val.data = (uint8_t *)string_sid;
val.length = strlen(string_sid);
int len;
bool ret;
- sid_to_string(string_sid, &map->sid);
+ sid_to_fstring(string_sid, &map->sid);
len = tdb_pack(NULL, sizeof(buf), "ddff",
map->gid, map->sid_name_use, map->nt_name, map->comment);
/* the key is the SID, retrieving is direct */
- sid_to_string(string_sid, &sid);
+ sid_to_fstring(string_sid, &sid);
if (asprintf(&key, "%s%s", GROUP_PREFIX, string_sid) < 0) {
return false;
}
/* the key is the SID, retrieving is direct */
- sid_to_string(string_sid, sid);
+ sid_to_fstring(string_sid, sid);
if (asprintf(&key, "%s%s", GROUP_PREFIX, string_sid) < 0) {
return false;
}
TALLOC_CTX *frame;
slprintf(key, sizeof(key), "%s%s", MEMBEROF_PREFIX,
- sid_to_string(tmp, member));
+ sid_to_fstring(tmp, member));
dbuf = tdb_fetch_bystring(tdb, key);
if (is_aliasmem(alias, member))
return NT_STATUS_MEMBER_IN_ALIAS;
- sid_to_string(string_sid, member);
+ sid_to_fstring(string_sid, member);
if (asprintf(&key, "%s%s", MEMBEROF_PREFIX, string_sid) < 0) {
return NT_STATUS_NO_MEMORY;
}
dbuf = tdb_fetch_bystring(tdb, key);
- sid_to_string(string_sid, alias);
+ sid_to_fstring(string_sid, alias);
if (dbuf.dptr != NULL) {
asprintf(&new_memberstring, "%s %s", (char *)(dbuf.dptr),
num -= 1;
- sid_to_string(sid_string, member);
+ sid_to_fstring(sid_string, member);
if (asprintf(&key, "%s%s", MEMBEROF_PREFIX, sid_string) < 0) {
TALLOC_FREE(sids);
return NT_STATUS_NO_MEMORY;
for (i=0; i<num; i++) {
char *s = member_string;
- sid_to_string(sid_string, &sids[i]);
+ sid_to_fstring(sid_string, &sids[i]);
asprintf(&member_string, "%s %s", s, sid_string);
SAFE_FREE(s);
printf(" (%d) flags: 0x%02x ", ace->type, ace->flags);
display_sec_ace_flags(ace->flags);
display_sec_access(&ace->access_mask);
- sid_to_string(sid_str, &ace->trustee);
+ sid_to_fstring(sid_str, &ace->trustee);
printf("\t\tSID: %s\n\n", sid_str);
if (sec_ace_object(ace->type)) {
}
if (sec->owner_sid) {
- sid_to_string(sid_str, sec->owner_sid);
+ sid_to_fstring(sid_str, sec->owner_sid);
printf("\tOwner SID:\t%s\n", sid_str);
}
if (sec->group_sid) {
- sid_to_string(sid_str, sec->group_sid);
+ sid_to_fstring(sid_str, sec->group_sid);
printf("\tGroup SID:\t%s\n", sid_str);
}
}
/* PRIV_<SID> (NULL terminated) as the key */
- fstr_sprintf(keystr, "%s%s", PRIVPREFIX, sid_to_string(tmp, sid));
+ fstr_sprintf(keystr, "%s%s", PRIVPREFIX, sid_to_fstring(tmp, sid));
data = tdb_fetch_bystring( tdb, keystr );
/* PRIV_<SID> (NULL terminated) as the key */
- fstr_sprintf(keystr, "%s%s", PRIVPREFIX, sid_to_string(tmp, sid));
+ fstr_sprintf(keystr, "%s%s", PRIVPREFIX, sid_to_fstring(tmp, sid));
/* no packing. static size structure, just write it out */
/* If we don't have an entry, then ask secrets.tdb for what it thinks.
It may choose to make it up */
- sid_to_string(sid_string, get_global_sam_sid());
+ sid_to_fstring(sid_string, get_global_sam_sid());
smbldap_set_mod(&mods, LDAP_MOD_ADD,
get_attr_key2string(dominfo_attr_list,
LDAP_ATTR_DOM_SID),
return NULL;
}
- sid_string = SMB_STRDUP( sid_to_string( tmp, &sid ) );
+ sid_string = SMB_STRDUP( sid_to_fstring( tmp, &sid ) );
if ( !sid_string ) {
DEBUG(0,("longvar_domainsid: failed to dup SID string!\n"));
Convert a SID to an ascii string.
*****************************************************************/
-char *sid_to_string(fstring sidstr_out, const DOM_SID *sid)
+char *sid_to_fstring(fstring sidstr_out, const DOM_SID *sid)
{
char *str = sid_string_talloc(talloc_tos(), sid);
fstrcpy(sidstr_out, str);
DOM_SID sid;
fstring tmp;
sid_parse(values[i]->bv_val, values[i]->bv_len, &sid);
- printf("%s: %s\n", field, sid_to_string(tmp, &sid));
+ printf("%s: %s\n", field, sid_to_fstring(tmp, &sid));
}
}
if (_sidtostring) {
_sidtostring(username_str,&qt->sid,_numeric);
} else {
- sid_to_string(username_str, &qt->sid);
+ sid_to_fstring(username_str, &qt->sid);
}
if (_verbose) {
struct rpc_pipe_client *pipe_hnd = find_lsa_pipe_hnd(ipc_cli);
TALLOC_CTX *ctx;
- sid_to_string(str, sid);
+ sid_to_fstring(str, sid);
if (numeric) {
return; /* no lookup desired */
/* Clear U/SID cache entry */
- fstr_sprintf(key_str, "U/%s", sid_to_string(sid_string, &sid));
+ fstr_sprintf(key_str, "U/%s", sid_to_fstring(sid_string, &sid));
DEBUG(10, ("netsamlogon_clear_cached_user: clearing %s\n", key_str));
/* Clear UG/SID cache entry */
- fstr_sprintf(key_str, "UG/%s", sid_to_string(sid_string, &sid));
+ fstr_sprintf(key_str, "UG/%s", sid_to_fstring(sid_string, &sid));
DEBUG(10, ("netsamlogon_clear_cached_user: clearing %s\n", key_str));
sid_append_rid( &user_sid, user->user_rid );
/* Prepare key as DOMAIN-SID/USER-RID string */
- slprintf(keystr, sizeof(keystr), "%s", sid_to_string(tmp, &user_sid));
+ slprintf(keystr, sizeof(keystr), "%s", sid_to_fstring(tmp, &user_sid));
DEBUG(10,("netsamlogon_cache_store: SID [%s]\n", keystr));
}
/* Prepare key as DOMAIN-SID/USER-RID string */
- slprintf(keystr, sizeof(keystr), "%s", sid_to_string(tmp, user_sid));
+ slprintf(keystr, sizeof(keystr), "%s", sid_to_fstring(tmp, user_sid));
DEBUG(10,("netsamlogon_cache_get: SID [%s]\n", keystr));
data = tdb_fetch_bystring( netsamlogon_tdb, keystr );
alt_key = alt_name ? trustdom_cache_key(alt_name) : NULL;
/* Generate string representation domain SID */
- sid_to_string(sid_string, sid);
+ sid_to_fstring(sid_string, sid);
/*
* try to put the names in the cache
ZERO_STRUCT(request);
ZERO_STRUCT(response);
- sid_to_string(request.data.sid, sid);
+ sid_to_fstring(request.data.sid, sid);
/* Make request */
ZERO_STRUCT(request);
ZERO_STRUCT(response);
- sid_to_string(request.data.sid, domain_sid);
+ sid_to_fstring(request.data.sid, domain_sid);
len = 0;
buflen = 0;
ZERO_STRUCT(request);
ZERO_STRUCT(response);
- sid_to_string(sid_str, sid);
+ sid_to_fstring(sid_str, sid);
fstrcpy(request.data.sid, sid_str);
/* Make request */
ZERO_STRUCT(request);
ZERO_STRUCT(response);
- sid_to_string(sid_str, sid);
+ sid_to_fstring(sid_str, sid);
fstrcpy(request.data.sid, sid_str);
/* Make request */
request.data.dual_idmapset.id = map->xid.id;
request.data.dual_idmapset.type = map->xid.type;
- sid_to_string(request.data.dual_idmapset.sid, map->sid);
+ sid_to_fstring(request.data.dual_idmapset.sid, map->sid);
result = winbindd_request_response(WINBINDD_SET_MAPPING, &request, &response);
sid_compose(&group_sid, get_global_sam_sid(), *rid);
- return add_initial_entry(grp->gr_gid, sid_to_string(tmp, &group_sid),
+ return add_initial_entry(grp->gr_gid, sid_to_fstring(tmp, &group_sid),
SID_NAME_DOM_GRP, name, NULL);
}
filter = talloc_asprintf(talloc_tos(), "(&(%s=%s)%s)",
get_userattr_key2string(ldap_state->schema_ver,
LDAP_ATTR_USER_SID),
- sid_to_string(sid_string, sid),
+ sid_to_fstring(sid_string, sid),
get_objclass_filter(ldap_state->schema_ver));
if (!filter) {
return LDAP_NO_MEMORY;
case SCHEMAVER_SAMBASAMACCOUNT:
smbldap_make_mod(ldap_state->smbldap_state->ldap_struct, existing, mods,
get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_USER_SID),
- sid_to_string(sid_string, user_sid));
+ sid_to_fstring(sid_string, user_sid));
break;
default:
case SCHEMAVER_SAMBASAMACCOUNT:
smbldap_make_mod(ldap_state->smbldap_state->ldap_struct, existing, mods,
get_userattr_key2string(ldap_state->schema_ver,
- LDAP_ATTR_PRIMARY_GROUP_SID), sid_to_string(sid_string, group_sid));
+ LDAP_ATTR_PRIMARY_GROUP_SID), sid_to_fstring(sid_string, group_sid));
break;
default:
if (asprintf(&filter, "(&(objectClass=%s)(%s=%s))",
LDAP_OBJ_GROUPMAP,
get_attr_key2string(groupmap_attr_list, LDAP_ATTR_GROUP_SID),
- sid_to_string(tmp, &sid)) < 0) {
+ sid_to_fstring(tmp, &sid)) < 0) {
return NT_STATUS_NO_MEMORY;
}
if (asprintf(&filter,
"(&(objectClass=%s)(sambaSid=%s)(sambaGroupType=%d))",
- LDAP_OBJ_GROUPMAP, sid_to_string(tmp, alias),
+ LDAP_OBJ_GROUPMAP, sid_to_fstring(tmp, alias),
type) < 0) {
return NT_STATUS_NO_MEMORY;
}
smbldap_set_mod(&mods, modop,
get_attr_key2string(groupmap_attr_list,
LDAP_ATTR_SID_LIST),
- sid_to_string(tmp, member));
+ sid_to_fstring(tmp, member));
rc = smbldap_modify(ldap_state->smbldap_state, dn, mods);
if (asprintf(&filter,
"(&(objectClass=%s)(sambaSid=%s)(sambaGroupType=%d))",
- LDAP_OBJ_GROUPMAP, sid_to_string(tmp, alias),
+ LDAP_OBJ_GROUPMAP, sid_to_fstring(tmp, alias),
type) < 0) {
return NT_STATUS_NO_MEMORY;
}
state->filter = talloc_asprintf(search->mem_ctx,
"(&(objectclass=sambaGroupMapping)"
"(sambaGroupType=%d)(sambaSID=%s*))",
- type, sid_to_string(tmp, sid));
+ type, sid_to_fstring(tmp, sid));
state->attrs = talloc_attrs(search->mem_ctx, "cn", "sambaSid",
"displayName", "description",
"sambaGroupType", NULL);
* SID. We (Jerry/VL) could not figure out which the
* hard cases are, so leave it with the SID. */
name->name = talloc_asprintf(p->mem_ctx, "%s",
- sid_to_string(tmp,
- sids[i]));
+ sid_to_fstring(tmp,
+ sids[i]));
if (name->name == NULL) {
return NT_STATUS_NO_MEMORY;
}
TALLOC_CTX *mem_ctx;
if (psid) {
- sid_to_string(sid_str, psid);
+ sid_to_fstring(sid_str, psid);
} else {
fstrcpy(sid_str,"(NULL)");
}
sid_copy(&info_sid, get_global_sam_sid());
sid_append_rid(&info_sid, q_u->rid_group);
- sid_to_string(sid_string, &info_sid);
+ sid_to_fstring(sid_string, &info_sid);
if ((info = get_samr_info_by_sid(&info_sid)) == NULL)
return NT_STATUS_NO_MEMORY;
for (i = 0; i < (argc - 1); i++) {
fstring sid_str;
- sid_to_string(sid_str, &sids[i]);
+ sid_to_fstring(sid_str, &sids[i]);
printf("%s %s (%s: %d)\n", argv[i + 1], sid_str,
sid_type_lookup(types[i]), types[i]);
}
for (i = 0; i < (argc - 2); i++) {
fstring sid_str;
- sid_to_string(sid_str, &sids[i]);
+ sid_to_fstring(sid_str, &sids[i]);
printf("%s %s (%s: %d)\n", argv[i + 2], sid_str,
sid_type_lookup(types[i]), types[i]);
}
for (i = 0; i < (argc - 1); i++) {
fstring sid_str;
- sid_to_string(sid_str, &sids[i]);
+ sid_to_fstring(sid_str, &sids[i]);
printf("%s %s\\%s (%d)\n", sid_str,
domains[i] ? domains[i] : "*unknown*",
names[i] ? names[i] : "*unknown*", types[i]);
for (i = 0; i < num_domains; i++) {
fstring sid_str;
- sid_to_string(sid_str, &domain_sids[i]);
+ sid_to_fstring(sid_str, &domain_sids[i]);
printf("%s %s\n", domain_names[i] ? domain_names[i] :
"*unknown*", sid_str);
}
for (i = 0; i < count; i++) {
fstring sid_str;
- sid_to_string(sid_str, &sids[i]);
+ sid_to_fstring(sid_str, &sids[i]);
printf("%s\n", sid_str);
}
for (j = 0; j < alias->num_members; j++) {
fstring sid_str;
- sid_to_string(sid_str, &alias->sids[j].sid);
+ sid_to_fstring(sid_str, &alias->sids[j].sid);
printf("%s\n", sid_str);
}
for (i = 0; i < num_members; i++) {
fstring sid_str;
- sid_to_string(sid_str, &alias_sids[i]);
+ sid_to_fstring(sid_str, &alias_sids[i]);
printf("\tsid:[%s]\n", sid_str);
}
result = rpccli_samr_lookup_domain(
cli, mem_ctx, &connect_pol, domain_name, &sid);
- sid_to_string(sid_string,&sid);
+ sid_to_fstring(sid_string,&sid);
if (NT_STATUS_IS_OK(result))
printf("SAMR_LOOKUP_DOMAIN: Domain Name: %s Domain SID: %s\n",
DEBUG(0, ("Can't fetch domain SID for name: %s\n", name));
return 1;
}
- sid_to_string(sid_str, &sid);
+ sid_to_fstring(sid_str, &sid);
d_printf("SID for domain %s is: %s\n", name, sid_str);
return 0;
}
d_fprintf(stderr, "Could not fetch local SID\n");
return 1;
}
- sid_to_string(sid_str, &domain_sid);
+ sid_to_fstring(sid_str, &domain_sid);
d_printf("SID for local machine %s is: %s\n", global_myname(), sid_str);
if (!secrets_fetch_domain_sid(opt_workgroup, &domain_sid)) {
return 1;
}
- sid_to_string(sid_str, &domain_sid);
+ sid_to_fstring(sid_str, &domain_sid);
d_printf("SID for domain %s is: %s\n", opt_workgroup, sid_str);
return 0;
if ( !string_sid[0] ) {
sid_copy(&sid, get_global_sam_sid());
sid_append_rid(&sid, rid);
- sid_to_string(string_sid, &sid);
+ sid_to_fstring(string_sid, &sid);
}
if (!ntcomment[0]) {
SAM_UNK_CTR ctr;
fstring sid_str;
- sid_to_string(sid_str, domain_sid);
+ sid_to_fstring(sid_str, domain_sid);
/* Get sam policy handle */
result = rpccli_samr_connect(pipe_hnd, mem_ctx, MAXIMUM_ALLOWED_ACCESS,
{
fstring sid_str;
- sid_to_string(sid_str, domain_sid);
+ sid_to_fstring(sid_str, domain_sid);
d_printf("Storing SID %s for Domain %s in secrets.tdb\n",
sid_str, domain_name);
int i;
fstring sid_str;
- sid_to_string(sid_str, domain_sid);
+ sid_to_fstring(sid_str, domain_sid);
result = rpccli_samr_open_group(pipe_hnd, mem_ctx, domain_pol,
MAXIMUM_ALLOWED_ACCESS,
for (i = 0; i < num_members; i++) {
fstring sid_str;
- sid_to_string(sid_str, &alias_sids[i]);
+ sid_to_fstring(sid_str, &alias_sids[i]);
if (opt_long_list_entries) {
printf("%s %s\\%s %d\n", sid_str,
const char **argv)
{
fstring str_sid;
- sid_to_string(str_sid, domain_sid);
+ sid_to_fstring(str_sid, domain_sid);
d_printf("%s\n", str_sid);
return NT_STATUS_OK;
}
int pad_len, col_len = 20;
/* convert sid into ascii string */
- sid_to_string(ascii_sid, dom_sid);
+ sid_to_fstring(ascii_sid, dom_sid);
/* calculate padding space for d_printf to look nicer */
pad_len = col_len - strlen(trusted_dom_name);
printing the raw SID if necessary */
result = sid_to_name( pipe_hnd, ctx, &sids[i], name );
if ( !NT_STATUS_IS_OK (result) )
- sid_to_string(name, &sids[i]);
+ sid_to_fstring(name, &sids[i]);
d_printf(" %s\n", name);
}
result = sid_to_name(pipe_hnd, ctx, &sids[i], name );
if ( !NT_STATUS_IS_OK (result) )
- sid_to_string(name, &sids[i]);
+ sid_to_fstring(name, &sids[i]);
d_printf("%s\n", name);
sid_copy(&user_sid, get_global_sam_sid());
sid_append_rid(&user_sid, delta->user_rid);
- DEBUG(3, ("Attempting to find SID %s for user %s in the passdb\n", sid_to_string(sid_string, &user_sid), account));
+ DEBUG(3, ("Attempting to find SID %s for user %s in the passdb\n",
+ sid_to_fstring(sid_string, &user_sid), account));
if (!pdb_getsampwsid(sam_account, &user_sid)) {
sam_account_from_delta(sam_account, delta);
DEBUG(3, ("Attempting to add user SID %s for user %s in the passdb\n",
- sid_to_string(sid_string, &user_sid), pdb_get_username(sam_account)));
+ sid_to_fstring(sid_string, &user_sid),
+ pdb_get_username(sam_account)));
if (!NT_STATUS_IS_OK(pdb_add_sam_account(sam_account))) {
DEBUG(1, ("SAM Account for %s failed to be added to the passdb!\n",
account));
} else {
sam_account_from_delta(sam_account, delta);
DEBUG(3, ("Attempting to update user SID %s for user %s in the passdb\n",
- sid_to_string(sid_string, &user_sid), pdb_get_username(sam_account)));
+ sid_to_fstring(sid_string, &user_sid),
+ pdb_get_username(sam_account)));
if (!NT_STATUS_IS_OK(pdb_update_sam_account(sam_account))) {
DEBUG(1, ("SAM Account for %s failed to be updated in the passdb!\n",
account));
/* add the group to the mapping table */
sid_copy(&group_sid, get_global_sam_sid());
sid_append_rid(&group_sid, rid);
- sid_to_string(sid_string, &group_sid);
+ sid_to_fstring(sid_string, &group_sid);
if (pdb_getgrsid(&map, group_sid)) {
if ( map.gid != -1 )
/* Find out whether the group is already mapped */
sid_copy(&alias_sid, &dom_sid);
sid_append_rid(&alias_sid, rid);
- sid_to_string(sid_string, &alias_sid);
+ sid_to_fstring(sid_string, &alias_sid);
if (pdb_getgrsid(&map, alias_sid)) {
grp = getgrgid(map.gid);
}
/* Get the sid */
- sid_to_string(sid, &dom_sid);
+ sid_to_fstring(sid, &dom_sid);
/* Get the ldap suffix */
suffix = lp_ldap_suffix();
"workgroup=%s\n\n in your smb.conf?\n",
domain_name,
get_global_sam_name(),
- sid_to_string(my_dom_sid_str,
- get_global_sam_sid()),
- domain_name, sid_to_string(rem_dom_sid_str,
- domain_sid),
+ sid_to_fstring(my_dom_sid_str,
+ get_global_sam_sid()),
+ domain_name, sid_to_fstring(rem_dom_sid_str,
+ domain_sid),
domain_name);
return NT_STATUS_UNSUCCESSFUL;
}
} else {
fstring sidstr;
- sid_to_string(sidstr, &psd->dacl->aces[num_aces].trustee);
+ sid_to_fstring(sidstr,
+ &psd->dacl->aces[num_aces].trustee);
acl_str = talloc_asprintf_append(acl_str,
"%s",
sidstr);
enum lsa_SidType type;
NTSTATUS status;
- sid_to_string(str, sid);
+ sid_to_fstring(str, sid);
if (numeric) {
return;
char **names = NULL;
enum lsa_SidType *types = NULL;
- sid_to_string(str, sid);
+ sid_to_fstring(str, sid);
if (_numeric) return;
fstring sidstr;
*sidkey = talloc_asprintf(ctx, "IDMAP/SID/%s",
- sid_to_string(sidstr, id->sid));
+ sid_to_fstring(sidstr, id->sid));
if ( ! *sidkey) {
DEBUG(1, ("failed to build sidkey, OOM?\n"));
return NT_STATUS_NO_MEMORY;
sid_copy(&sid, &domain->sid);
sid_append_rid(&sid, rid);
- sid_to_string(keystr, &sid);
+ sid_to_fstring(keystr, &sid);
key2 = string_term_tdb_data(keystr);
if (tdb_store(tdb, key2, data, TDB_INSERT) != 0) {
unsigned long rec_id = 0;
fstring tmp;
- if ((keystr = talloc_asprintf(ctx, "%s",
- sid_to_string(tmp, map->sid))) == NULL) {
+ if ((keystr = talloc_asprintf(
+ ctx, "%s", sid_to_fstring(tmp, map->sid))) == NULL) {
DEBUG(0, ("Out of memory!\n"));
ret = NT_STATUS_NO_MEMORY;
goto done;
}
if ((ksidstr = talloc_asprintf(
- ctx, "%s", sid_to_string(tmp, map->sid))) == NULL) {
+ ctx, "%s", sid_to_fstring(tmp, map->sid))) == NULL) {
DEBUG(0, ("Out of memory!\n"));
ret = NT_STATUS_NO_MEMORY;
goto done;
}
if ((ksidstr = talloc_asprintf(
- ctx, "%s", sid_to_string(tmp, map->sid))) == NULL) {
+ ctx, "%s", sid_to_fstring(tmp, map->sid))) == NULL) {
DEBUG(0, ("Out of memory!\n"));
ret = NT_STATUS_NO_MEMORY;
goto done;
ZERO_STRUCT(request);
request.cmd = WINBINDD_LOOKUPSID;
- sid_to_string(request.data.sid, &s->sid);
+ sid_to_fstring(request.data.sid, &s->sid);
do_async_domain(mem_ctx, root_domain, &request, lookupsid_recv2,
(void *)cont, s);
ZERO_STRUCT(request);
request.cmd = WINBINDD_LOOKUPSID;
- sid_to_string(request.data.sid, sid);
+ sid_to_fstring(request.data.sid, sid);
if ( (s = TALLOC_ZERO_P(mem_ctx, struct lookupsid_state)) == NULL ) {
DEBUG(0, ("winbindd_lookupsid_async: talloc failed\n"));
return WINBINDD_ERROR;
}
- sid_to_string(state->response.data.sid.sid, &sid);
+ sid_to_fstring(state->response.data.sid.sid, &sid);
state->response.data.sid.type = type;
return WINBINDD_OK;
for (i=0; i<num_sids; i++) {
fstring tmp;
sprintf_append(mem_ctx, result, len, &buflen,
- "%s\n", sid_to_string(tmp, &sids[i]));
+ "%s\n", sid_to_fstring(tmp, &sids[i]));
}
if ((num_sids != 0) && (*result == NULL)) {
ZERO_STRUCT(request);
request.cmd = WINBINDD_GETUSERDOMGROUPS;
- sid_to_string(request.data.sid, user_sid);
+ sid_to_fstring(request.data.sid, user_sid);
do_async_domain(mem_ctx, domain, &request, gettoken_recvdomgroups,
NULL, state);
struct winbindd_request request;
ZERO_STRUCT(request);
request.cmd = WINBINDD_DUAL_USERINFO;
- sid_to_string(request.data.sid, sid);
+ sid_to_fstring(request.data.sid, sid);
do_async_domain(mem_ctx, domain, &request, query_user_recv,
(void *)cont, private_data);
}
static void centry_put_sid(struct cache_entry *centry, const DOM_SID *sid)
{
fstring sid_string;
- centry_put_string(centry, sid_to_string(sid_string, sid));
+ centry_put_string(centry, sid_to_fstring(sid_string, sid));
}
centry_put_string(centry, name);
}
- centry_end(centry, "SN/%s", sid_to_string(sid_string, sid));
+ centry_end(centry, "SN/%s", sid_to_fstring(sid_string, sid));
DEBUG(10,("wcache_save_sid_to_name: %s -> %s (%s)\n", sid_string,
name, nt_errstr(status)));
centry_free(centry);
centry_put_uint32(centry, info->primary_gid);
centry_put_sid(centry, &info->user_sid);
centry_put_sid(centry, &info->group_sid);
- centry_end(centry, "U/%s", sid_to_string(sid_string, &info->user_sid));
+ centry_end(centry, "U/%s", sid_to_fstring(sid_string,
+ &info->user_sid));
DEBUG(10,("wcache_save_user: %s (acct_name %s)\n", sid_string, info->acct_name));
centry_free(centry);
}
return NT_STATUS_INVALID_SID;
}
- fstr_sprintf(key_str, "CRED/%s", sid_to_string(tmp, sid));
+ fstr_sprintf(key_str, "CRED/%s", sid_to_fstring(tmp, sid));
data = tdb_fetch(cache->tdb, string_tdb_data(key_str));
if (!data.dptr) {
fall back to an unsalted cred. */
centry = wcache_fetch(cache, domain, "CRED/%s",
- sid_to_string(tmp, sid));
+ sid_to_fstring(tmp, sid));
if (!centry) {
DEBUG(10,("wcache_get_creds: entry for [CRED/%s] not found\n",
sid_string_dbg(sid)));
if (*cached_nt_pass == NULL) {
fstring sidstr;
- sid_to_string(sidstr, sid);
+ sid_to_fstring(sidstr, sid);
/* Bad (old) cred cache. Delete and pretend we
don't have it. */
centry_put_hash16(centry, salted_hash);
centry_put_hash16(centry, cred_salt);
- centry_end(centry, "CRED/%s", sid_to_string(sid_string, sid));
+ centry_end(centry, "CRED/%s", sid_to_fstring(sid_string, sid));
DEBUG(10,("wcache_save_creds: %s\n", sid_string));
if (!cache->tdb)
goto do_query;
- centry = wcache_fetch(cache, domain, "SN/%s", sid_to_string(sid_string, sid));
+ centry = wcache_fetch(cache, domain, "SN/%s",
+ sid_to_fstring(sid_string, sid));
if (!centry)
goto do_query;
}
centry = wcache_fetch(cache, domain, "SN/%s",
- sid_to_string(tmp, &sid));
+ sid_to_fstring(tmp, &sid));
if (!centry) {
goto do_query;
}
goto do_query;
centry = wcache_fetch(cache, domain, "U/%s",
- sid_to_string(tmp, user_sid));
+ sid_to_fstring(tmp, user_sid));
/* If we have an access denied cache entry and a cached info3 in the
samlogon cache then do a query. This will force the rpc back end
if (!cache->tdb)
goto do_query;
- centry = wcache_fetch(cache, domain, "UG/%s", sid_to_string(sid_string, user_sid));
+ centry = wcache_fetch(cache, domain, "UG/%s",
+ sid_to_fstring(sid_string, user_sid));
/* If we have an access denied cache entry and a cached info3 in the
samlogon cache then do a query. This will force the rpc back end
centry_put_sid(centry, &(*user_gids)[i]);
}
- centry_end(centry, "UG/%s", sid_to_string(sid_string, user_sid));
+ centry_end(centry, "UG/%s", sid_to_fstring(sid_string, user_sid));
centry_free(centry);
skip_save:
for (i=0; i<num_sids; i++) {
fstring tmp;
sidlist = talloc_asprintf(mem_ctx, "%s/%s", sidlist,
- sid_to_string(tmp, &sids[i]));
+ sid_to_fstring(tmp, &sids[i]));
if (sidlist == NULL)
return NT_STATUS_NO_MEMORY;
}
if (!cache->tdb)
goto do_query;
- centry = wcache_fetch(cache, domain, "GM/%s", sid_to_string(sid_string, group_sid));
+ centry = wcache_fetch(cache, domain, "GM/%s",
+ sid_to_fstring(sid_string, group_sid));
if (!centry)
goto do_query;
centry_put_string(centry, (*names)[i]);
centry_put_uint32(centry, (*name_types)[i]);
}
- centry_end(centry, "GM/%s", sid_to_string(sid_string, group_sid));
+ centry_end(centry, "GM/%s", sid_to_fstring(sid_string, group_sid));
centry_free(centry);
skip_save:
return False;
}
- centry = wcache_fetch(cache, domain, "SN/%s", sid_to_string(tmp, sid));
+ centry = wcache_fetch(cache, domain, "SN/%s",
+ sid_to_fstring(tmp, sid));
if (centry == NULL) {
return False;
}
DEBUG(11,("we already have an entry, deleting that\n"));
- fstr_sprintf(key_str, "CRED/%s", sid_to_string(tmp, sid));
+ fstr_sprintf(key_str, "CRED/%s", sid_to_fstring(tmp, sid));
tdb_delete(cache->tdb, string_tdb_data(key_str));
len += tdb_pack( buffer+len, buflen-len, "fffddd",
domains[i].domain_name,
domains[i].dns_name,
- sid_to_string(tmp, &domains[i].sid),
+ sid_to_fstring(tmp, &domains[i].sid),
domains[i].trust_flags,
domains[i].trust_attribs,
domains[i].trust_type );
centry_put_string( centry, gecos );
centry_put_uint32( centry, gid );
- centry_end(centry, "NSS/PWINFO/%s", sid_to_string(tmp, user_sid) );
+ centry_end(centry, "NSS/PWINFO/%s", sid_to_fstring(tmp, user_sid) );
DEBUG(10,("wcache_save_user_pwinfo: %s\n", sid_string_dbg(user_sid) ));
goto do_query;
centry = wcache_fetch(cache, domain, "NSS/PWINFO/%s",
- sid_to_string(tmp, user_sid));
+ sid_to_fstring(tmp, user_sid));
if (!centry)
goto do_query;
/* work out the response size */
for (i = 0; i < num_sids; i++) {
fstring s;
- sid_to_string(s, &sids[i]);
+ sid_to_fstring(s, &sids[i]);
ret_size += strlen(s) + 1;
}
ofs = 0;
for (i = 0; i < num_sids; i++) {
fstring s;
- sid_to_string(s, &sids[i]);
+ sid_to_fstring(s, &sids[i]);
safe_strcpy(ret + ofs, s, ret_size - ofs - 1);
ofs += strlen(ret+ofs) + 1;
}
request.cmd = WINBINDD_DUAL_SET_MAPPING;
request.data.dual_idmapset.id = map->xid.id;
request.data.dual_idmapset.type = map->xid.type;
- sid_to_string(request.data.dual_idmapset.sid, map->sid);
+ sid_to_fstring(request.data.dual_idmapset.sid, map->sid);
do_async(mem_ctx, idmap_child(), &request, winbindd_set_mapping_recv,
(void *)cont, private_data);
struct winbindd_request request;
ZERO_STRUCT(request);
request.cmd = WINBINDD_DUAL_SID2UID;
- sid_to_string(request.data.dual_sid2id.sid, sid);
+ sid_to_fstring(request.data.dual_sid2id.sid, sid);
do_async(mem_ctx, idmap_child(), &request, winbindd_sid2uid_recv,
(void *)cont, private_data);
}
struct winbindd_request request;
ZERO_STRUCT(request);
request.cmd = WINBINDD_DUAL_SID2GID;
- sid_to_string(request.data.dual_sid2id.sid, sid);
+ sid_to_fstring(request.data.dual_sid2id.sid, sid);
DEBUG(7,("winbindd_sid2gid_async: Resolving %s to a gid\n",
request.data.dual_sid2id.sid));
result = idmap_uid_to_sid(&sid, state->request.data.uid);
if (NT_STATUS_IS_OK(result)) {
- sid_to_string(state->response.data.sid.sid, &sid);
+ sid_to_fstring(state->response.data.sid.sid, &sid);
state->response.data.sid.type = SID_NAME_USER;
return WINBINDD_OK;
}
result = idmap_gid_to_sid(&sid, state->request.data.gid);
if (NT_STATUS_IS_OK(result)) {
- sid_to_string(state->response.data.sid.sid, &sid);
+ sid_to_fstring(state->response.data.sid.sid, &sid);
DEBUG(10, ("[%5lu]: retrieved sid: %s\n",
(unsigned long)state->pid,
state->response.data.sid.sid));
domain->name);
fstrcpy(state->response.data.domain_info.alt_name,
domain->alt_name);
- sid_to_string(state->response.data.domain_info.sid, &domain->sid);
+ sid_to_fstring(state->response.data.domain_info.sid, &domain->sid);
state->response.data.domain_info.native_mode =
domain->native_mode;
domain->name);
fstrcpy(state->response.data.domain_info.alt_name,
domain->alt_name);
- sid_to_string(state->response.data.domain_info.sid, &domain->sid);
+ sid_to_fstring(state->response.data.domain_info.sid, &domain->sid);
state->response.data.domain_info.native_mode =
domain->native_mode;
state->response.data.auth.info3.user_rid = info3->user_rid;
state->response.data.auth.info3.group_rid = info3->group_rid;
- sid_to_string(str_sid, &(info3->dom_sid.sid));
+ sid_to_fstring(str_sid, &(info3->dom_sid.sid));
fstrcpy(state->response.data.auth.info3.dom_sid, str_sid);
state->response.data.auth.info3.num_groups = info3->num_groups;
sid_copy(&user_sid, &info3->dom_sid.sid);
sid_append_rid(&user_sid, info3->user_rid);
- sid_to_string(sidstr, &user_sid);
+ sid_to_fstring(sidstr, &user_sid);
afsname = talloc_string_sub(mem_ctx, afsname,
"%s", sidstr);
}
return;
}
- sid_to_string(state->response.data.sid.sid, sid);
+ sid_to_fstring(state->response.data.sid.sid, sid);
state->response.data.sid.type = type;
request_ok(state);
return;
fstrcpy(state->response.data.domain_info.name, domain->name);
fstrcpy(state->response.data.domain_info.alt_name, domain->alt_name);
- sid_to_string(state->response.data.domain_info.sid, &domain->sid);
+ sid_to_fstring(state->response.data.domain_info.sid, &domain->sid);
state->response.data.domain_info.native_mode
= domain->native_mode;