summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2007-12-15 22:47:30 +0100
committerVolker Lendecke <vl@samba.org>2007-12-15 22:47:30 +0100
commit2e07c2ade89f4ff281c61f74cb88e09990cf5f46 (patch)
treea1fb43117e5b3966c8113d47c37a1bdf1e8ee30b
parent79cd97cc3f496f781d809c1ab619afa2cc07293d (diff)
downloadsamba-2e07c2ade89f4ff281c61f74cb88e09990cf5f46.tar.gz
samba-2e07c2ade89f4ff281c61f74cb88e09990cf5f46.tar.bz2
samba-2e07c2ade89f4ff281c61f74cb88e09990cf5f46.zip
s/sid_to_string/sid_to_fstring/
least surprise for callers (This used to be commit eb523ba77697346a365589101aac379febecd546)
-rw-r--r--source3/groupdb/mapping_ldb.c12
-rw-r--r--source3/groupdb/mapping_tdb.c16
-rw-r--r--source3/lib/display_sec.c6
-rw-r--r--source3/lib/privileges.c4
-rw-r--r--source3/lib/smbldap_util.c2
-rw-r--r--source3/lib/substitute.c2
-rw-r--r--source3/lib/util_sid.c2
-rw-r--r--source3/libads/ldap.c2
-rw-r--r--source3/libsmb/cliquota.c2
-rw-r--r--source3/libsmb/libsmbclient.c2
-rw-r--r--source3/libsmb/samlogon_cache.c8
-rw-r--r--source3/libsmb/trustdom_cache.c2
-rw-r--r--source3/nsswitch/wb_client.c10
-rw-r--r--source3/passdb/pdb_interface.c2
-rw-r--r--source3/passdb/pdb_ldap.c16
-rw-r--r--source3/rpc_server/srv_lsa_nt.c4
-rw-r--r--source3/rpc_server/srv_samr_nt.c4
-rw-r--r--source3/rpcclient/cmd_lsarpc.c10
-rw-r--r--source3/rpcclient/cmd_netlogon.c2
-rw-r--r--source3/rpcclient/cmd_samr.c4
-rw-r--r--source3/utils/net.c6
-rw-r--r--source3/utils/net_groupmap.c2
-rw-r--r--source3/utils/net_rpc.c12
-rw-r--r--source3/utils/net_rpc_rights.c4
-rw-r--r--source3/utils/net_rpc_samsync.c23
-rw-r--r--source3/utils/net_usershare.c3
-rw-r--r--source3/utils/smbcacls.c2
-rw-r--r--source3/utils/smbcquotas.c2
-rw-r--r--source3/winbindd/idmap_cache.c2
-rw-r--r--source3/winbindd/idmap_tdb.c10
-rw-r--r--source3/winbindd/winbindd_async.c12
-rw-r--r--source3/winbindd/winbindd_cache.c45
-rw-r--r--source3/winbindd/winbindd_group.c4
-rw-r--r--source3/winbindd/winbindd_idmap.c10
-rw-r--r--source3/winbindd/winbindd_misc.c4
-rw-r--r--source3/winbindd/winbindd_pam.c4
-rw-r--r--source3/winbindd/winbindd_sid.c2
-rw-r--r--source3/winbindd/winbindd_util.c2
38 files changed, 135 insertions, 126 deletions
diff --git a/source3/groupdb/mapping_ldb.c b/source3/groupdb/mapping_ldb.c
index 205111e5ac..ea46777598 100644
--- a/source3/groupdb/mapping_ldb.c
+++ b/source3/groupdb/mapping_ldb.c
@@ -119,7 +119,7 @@ static struct ldb_dn *mapping_dn(TALLOC_CTX *mem_ctx, const DOM_SID *sid)
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
@@ -149,7 +149,7 @@ static bool add_mapping_entry(GROUP_MAP *map, int flag)
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 ||
@@ -327,7 +327,7 @@ static bool enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_
/* 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;
}
@@ -376,7 +376,7 @@ static NTSTATUS one_alias_membership(const DOM_SID *member,
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;
}
@@ -427,7 +427,7 @@ static NTSTATUS modify_aliasmem(const DOM_SID *alias, const DOM_SID *member,
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;
}
@@ -452,7 +452,7 @@ static NTSTATUS modify_aliasmem(const DOM_SID *alias, const DOM_SID *member,
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);
diff --git a/source3/groupdb/mapping_tdb.c b/source3/groupdb/mapping_tdb.c
index ad8ed0d34d..cf9f9058af 100644
--- a/source3/groupdb/mapping_tdb.c
+++ b/source3/groupdb/mapping_tdb.c
@@ -97,7 +97,7 @@ static bool add_mapping_entry(GROUP_MAP *map, int flag)
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);
@@ -139,7 +139,7 @@ static bool get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map)
/* 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;
}
@@ -271,7 +271,7 @@ static bool group_map_remove(const DOM_SID *sid)
/* 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;
}
@@ -397,7 +397,7 @@ static NTSTATUS one_alias_membership(const DOM_SID *member,
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);
@@ -480,14 +480,14 @@ static NTSTATUS add_aliasmem(const DOM_SID *alias, const DOM_SID *member)
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),
@@ -624,7 +624,7 @@ static NTSTATUS del_aliasmem(const DOM_SID *alias, const DOM_SID *member)
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;
@@ -649,7 +649,7 @@ static NTSTATUS del_aliasmem(const DOM_SID *alias, const DOM_SID *member)
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);
diff --git a/source3/lib/display_sec.c b/source3/lib/display_sec.c
index caa13a6a5e..f6a6bb6465 100644
--- a/source3/lib/display_sec.c
+++ b/source3/lib/display_sec.c
@@ -151,7 +151,7 @@ void display_sec_ace(SEC_ACE *ace)
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)) {
@@ -246,12 +246,12 @@ void display_sec_desc(SEC_DESC *sec)
}
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);
}
}
diff --git a/source3/lib/privileges.c b/source3/lib/privileges.c
index 9f155acd8b..63fb462e32 100644
--- a/source3/lib/privileges.c
+++ b/source3/lib/privileges.c
@@ -54,7 +54,7 @@ static bool get_privileges( const DOM_SID *sid, SE_PRIV *mask )
/* 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 );
@@ -95,7 +95,7 @@ static bool set_privileges( const DOM_SID *sid, SE_PRIV *mask )
/* 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 */
diff --git a/source3/lib/smbldap_util.c b/source3/lib/smbldap_util.c
index 42861ae111..66aef6ba66 100644
--- a/source3/lib/smbldap_util.c
+++ b/source3/lib/smbldap_util.c
@@ -192,7 +192,7 @@ static NTSTATUS add_new_domain_info(struct smbldap_state *ldap_state,
/* 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),
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index 3fbdd2859e..e06917c8fb 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -309,7 +309,7 @@ static char *longvar_domainsid( void )
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"));
diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c
index 868ac36d11..52f65aa77d 100644
--- a/source3/lib/util_sid.c
+++ b/source3/lib/util_sid.c
@@ -172,7 +172,7 @@ const char *get_global_sam_name(void)
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);
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index c3dd9154de..e9124a387c 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -1849,7 +1849,7 @@ static void dump_sid(ADS_STRUCT *ads, const char *field, struct berval **values)
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));
}
}
diff --git a/source3/libsmb/cliquota.c b/source3/libsmb/cliquota.c
index 3c794240bc..206576f040 100644
--- a/source3/libsmb/cliquota.c
+++ b/source3/libsmb/cliquota.c
@@ -608,7 +608,7 @@ void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_
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) {
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c
index 9b8d5edb4a..2ff2830256 100644
--- a/source3/libsmb/libsmbclient.c
+++ b/source3/libsmb/libsmbclient.c
@@ -4136,7 +4136,7 @@ convert_sid_to_string(struct cli_state *ipc_cli,
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 */
diff --git a/source3/libsmb/samlogon_cache.c b/source3/libsmb/samlogon_cache.c
index a15a3b228d..4f791f66f6 100644
--- a/source3/libsmb/samlogon_cache.c
+++ b/source3/libsmb/samlogon_cache.c
@@ -81,7 +81,7 @@ void netsamlogon_clear_cached_user(TDB_CONTEXT *tdb, NET_USER_INFO_3 *user)
/* 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));
@@ -89,7 +89,7 @@ void netsamlogon_clear_cached_user(TDB_CONTEXT *tdb, NET_USER_INFO_3 *user)
/* 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));
@@ -124,7 +124,7 @@ bool netsamlogon_cache_store( const char *username, NET_USER_INFO_3 *user )
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));
@@ -186,7 +186,7 @@ NET_USER_INFO_3* netsamlogon_cache_get( TALLOC_CTX *mem_ctx, const DOM_SID *user
}
/* 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 );
diff --git a/source3/libsmb/trustdom_cache.c b/source3/libsmb/trustdom_cache.c
index 498a0221f2..6755de3814 100644
--- a/source3/libsmb/trustdom_cache.c
+++ b/source3/libsmb/trustdom_cache.c
@@ -129,7 +129,7 @@ bool trustdom_cache_store(char* name, char* alt_name, const DOM_SID *sid,
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
diff --git a/source3/nsswitch/wb_client.c b/source3/nsswitch/wb_client.c
index ce5e8ef1d0..d24bba2fe1 100644
--- a/source3/nsswitch/wb_client.c
+++ b/source3/nsswitch/wb_client.c
@@ -75,7 +75,7 @@ bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
ZERO_STRUCT(request);
ZERO_STRUCT(response);
- sid_to_string(request.data.sid, sid);
+ sid_to_fstring(request.data.sid, sid);
/* Make request */
@@ -134,7 +134,7 @@ bool winbind_lookup_rids(TALLOC_CTX *mem_ctx,
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;
@@ -238,7 +238,7 @@ bool winbind_sid_to_uid(uid_t *puid, const DOM_SID *sid)
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 */
@@ -305,7 +305,7 @@ bool winbind_sid_to_gid(gid_t *pgid, const DOM_SID *sid)
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 */
@@ -470,7 +470,7 @@ bool winbind_set_mapping(const struct id_map *map)
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);
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index 6a75732de7..ed6a91cb2b 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -606,7 +606,7 @@ static NTSTATUS pdb_default_create_dom_group(struct pdb_methods *methods,
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);
}
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 466222da80..bc912ada29 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -407,7 +407,7 @@ static int ldapsam_search_suffix_by_sid (struct ldapsam_privates *ldap_state,
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;
@@ -1152,7 +1152,7 @@ static bool init_ldap_from_sam (struct ldapsam_privates *ldap_state,
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:
@@ -1190,7 +1190,7 @@ static bool init_ldap_from_sam (struct ldapsam_privates *ldap_state,
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:
@@ -2582,7 +2582,7 @@ static NTSTATUS ldapsam_getgrsid(struct pdb_methods *methods, GROUP_MAP *map,
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;
}
@@ -3566,7 +3566,7 @@ static NTSTATUS ldapsam_modify_aliasmem(struct pdb_methods *methods,
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;
}
@@ -3614,7 +3614,7 @@ static NTSTATUS ldapsam_modify_aliasmem(struct pdb_methods *methods,
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);
@@ -3688,7 +3688,7 @@ static NTSTATUS ldapsam_enum_aliasmem(struct pdb_methods *methods,
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;
}
@@ -4743,7 +4743,7 @@ static bool ldapsam_search_grouptype(struct pdb_methods *methods,
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);
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index 02f7f090a4..a1ddc8e6c8 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -870,8 +870,8 @@ static NTSTATUS _lsa_lookup_sids_internal(pipes_struct *p,
* 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;
}
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index d013ec8f03..1af41228a7 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -315,7 +315,7 @@ static struct samr_info *get_samr_info_by_sid(DOM_SID *psid)
TALLOC_CTX *mem_ctx;
if (psid) {
- sid_to_string(sid_str, psid);
+ sid_to_fstring(sid_str, psid);
} else {
fstrcpy(sid_str,"(NULL)");
}
@@ -4875,7 +4875,7 @@ NTSTATUS _samr_open_group(pipes_struct *p, SAMR_Q_OPEN_GROUP *q_u, SAMR_R_OPEN_G
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;
diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c
index 61495075c1..d54f67264a 100644
--- a/source3/rpcclient/cmd_lsarpc.c
+++ b/source3/rpcclient/cmd_lsarpc.c
@@ -251,7 +251,7 @@ static NTSTATUS cmd_lsa_lookup_names(struct rpc_pipe_client *cli,
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]);
}
@@ -301,7 +301,7 @@ static NTSTATUS cmd_lsa_lookup_names_level(struct rpc_pipe_client *cli,
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]);
}
@@ -369,7 +369,7 @@ static NTSTATUS cmd_lsa_lookup_sids(struct rpc_pipe_client *cli, TALLOC_CTX *mem
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]);
@@ -432,7 +432,7 @@ static NTSTATUS cmd_lsa_enum_trust_dom(struct rpc_pipe_client *cli,
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);
}
@@ -581,7 +581,7 @@ static NTSTATUS cmd_lsa_enum_sids(struct rpc_pipe_client *cli,
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);
}
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
index 6acac8273c..e997bb5090 100644
--- a/source3/rpcclient/cmd_netlogon.c
+++ b/source3/rpcclient/cmd_netlogon.c
@@ -365,7 +365,7 @@ static void display_sam_sync(uint32 num_deltas, SAM_DELTA_HDR *hdr_deltas,
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);
}
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index 6a3c92a16a..dae6c42bf2 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -1118,7 +1118,7 @@ static NTSTATUS cmd_samr_query_aliasmem(struct rpc_pipe_client *cli,
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);
}
@@ -2114,7 +2114,7 @@ static NTSTATUS cmd_samr_lookup_domain(struct rpc_pipe_client *cli,
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",
diff --git a/source3/utils/net.c b/source3/utils/net.c
index 8118ec4512..bf70d08d8b 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -665,7 +665,7 @@ static int net_getlocalsid(int argc, const char **argv)
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;
}
@@ -743,7 +743,7 @@ static int net_getdomainsid(int argc, const char **argv)
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)) {
@@ -751,7 +751,7 @@ static int net_getdomainsid(int argc, const char **argv)
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;
diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c
index c59548b2f1..b0e3d60a24 100644
--- a/source3/utils/net_groupmap.c
+++ b/source3/utils/net_groupmap.c
@@ -270,7 +270,7 @@ static int net_groupmap_add(int argc, const char **argv)
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]) {
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 2e085d6c0a..ab0cc73e49 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -442,7 +442,7 @@ NTSTATUS rpc_info_internals(const DOM_SID *domain_sid,
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,
@@ -519,7 +519,7 @@ static NTSTATUS rpc_getsid_internals(const DOM_SID *domain_sid,
{
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);
@@ -2661,7 +2661,7 @@ static NTSTATUS rpc_list_group_members(struct rpc_pipe_client *pipe_hnd,
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,
@@ -2773,7 +2773,7 @@ static NTSTATUS rpc_list_alias_members(struct rpc_pipe_client *pipe_hnd,
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,
@@ -5818,7 +5818,7 @@ static NTSTATUS rpc_query_domain_sid(const DOM_SID *domain_sid,
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;
}
@@ -5829,7 +5829,7 @@ static void print_trusted_domain(DOM_SID *dom_sid, const char *trusted_dom_name)
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);
diff --git a/source3/utils/net_rpc_rights.c b/source3/utils/net_rpc_rights.c
index 2375bc9fcf..23be8859e0 100644
--- a/source3/utils/net_rpc_rights.c
+++ b/source3/utils/net_rpc_rights.c
@@ -231,7 +231,7 @@ static NTSTATUS enum_accounts_for_privilege(struct rpc_pipe_client *pipe_hnd,
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);
}
@@ -267,7 +267,7 @@ static NTSTATUS enum_privileges_for_accounts(struct rpc_pipe_client *pipe_hnd,
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);
diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c
index d546c83357..ca3279ee3a 100644
--- a/source3/utils/net_rpc_samsync.c
+++ b/source3/utils/net_rpc_samsync.c
@@ -535,11 +535,13 @@ static NTSTATUS fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta)
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));
@@ -548,7 +550,8 @@ static NTSTATUS fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta)
} 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));
@@ -603,7 +606,7 @@ static NTSTATUS fetch_group_info(uint32 rid, SAM_GROUP_INFO *delta)
/* 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 )
@@ -794,7 +797,7 @@ static NTSTATUS fetch_alias_info(uint32 rid, SAM_ALIAS_INFO *delta,
/* 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);
@@ -1838,7 +1841,7 @@ static NTSTATUS fetch_database_to_ldif(struct rpc_pipe_client *pipe_hnd,
}
/* Get the sid */
- sid_to_string(sid, &dom_sid);
+ sid_to_fstring(sid, &dom_sid);
/* Get the ldap suffix */
suffix = lp_ldap_suffix();
@@ -2117,10 +2120,10 @@ NTSTATUS rpc_vampire_internals(const DOM_SID *domain_sid,
"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;
}
diff --git a/source3/utils/net_usershare.c b/source3/utils/net_usershare.c
index 3af5fd44b8..550157a103 100644
--- a/source3/utils/net_usershare.c
+++ b/source3/utils/net_usershare.c
@@ -423,7 +423,8 @@ static int info_fn(struct file_list *fl, void *priv)
} 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);
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c
index f823ea3bfd..958f8e255e 100644
--- a/source3/utils/smbcacls.c
+++ b/source3/utils/smbcacls.c
@@ -168,7 +168,7 @@ static void SidToString(struct cli_state *cli, fstring str, const DOM_SID *sid)
enum lsa_SidType type;
NTSTATUS status;
- sid_to_string(str, sid);
+ sid_to_fstring(str, sid);
if (numeric) {
return;
diff --git a/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c
index 08a3cc1806..e6aa5e86cf 100644
--- a/source3/utils/smbcquotas.c
+++ b/source3/utils/smbcquotas.c
@@ -80,7 +80,7 @@ static void SidToString(fstring str, DOM_SID *sid, bool _numeric)
char **names = NULL;
enum lsa_SidType *types = NULL;
- sid_to_string(str, sid);
+ sid_to_fstring(str, sid);
if (_numeric) return;
diff --git a/source3/winbindd/idmap_cache.c b/source3/winbindd/idmap_cache.c
index 4e286f88c0..cf46196ebe 100644
--- a/source3/winbindd/idmap_cache.c
+++ b/source3/winbindd/idmap_cache.c
@@ -80,7 +80,7 @@ NTSTATUS idmap_cache_build_sidkey(TALLOC_CTX *ctx, char **sidkey, const struct i
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;
diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c
index d693c357f7..e5f605361b 100644
--- a/source3/winbindd/idmap_tdb.c
+++ b/source3/winbindd/idmap_tdb.c
@@ -86,7 +86,7 @@ static int convert_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA data, void *state
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) {
@@ -714,8 +714,8 @@ static NTSTATUS idmap_tdb_sid_to_id(struct idmap_tdb_context *ctx, struct id_map
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;
@@ -909,7 +909,7 @@ static NTSTATUS idmap_tdb_set_mapping(struct idmap_domain *dom, const struct id_
}
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;
@@ -1024,7 +1024,7 @@ static NTSTATUS idmap_tdb_remove_mapping(struct idmap_domain *dom, const struct
}
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;
diff --git a/source3/winbindd/winbindd_async.c b/source3/winbindd/winbindd_async.c
index 0971476f44..76724582a1 100644
--- a/source3/winbindd/winbindd_async.c
+++ b/source3/winbindd/winbindd_async.c
@@ -175,7 +175,7 @@ static void lookupsid_recv(TALLOC_CTX *mem_ctx, bool success,
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);
@@ -209,7 +209,7 @@ void winbindd_lookupsid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
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"));
@@ -443,7 +443,7 @@ enum winbindd_result winbindd_dual_lookupname(struct winbindd_domain *domain,
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;
@@ -460,7 +460,7 @@ bool print_sidlist(TALLOC_CTX *mem_ctx, const DOM_SID *sids,
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)) {
@@ -796,7 +796,7 @@ void winbindd_gettoken_async(TALLOC_CTX *mem_ctx, const DOM_SID *user_sid,
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);
@@ -949,7 +949,7 @@ void query_user_async(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
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);
}
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index 31747dd4c8..f63c7a5b2f 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -756,7 +756,7 @@ static void centry_put_hash16(struct cache_entry *centry, const uint8 val[16])
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));
}
@@ -876,7 +876,7 @@ static void wcache_save_sid_to_name(struct winbindd_domain *domain, NTSTATUS sta
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);
@@ -902,7 +902,8 @@ static void wcache_save_user(struct winbindd_domain *domain, NTSTATUS status, WI
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);
}
@@ -966,7 +967,7 @@ NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const DOM_SID
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) {
@@ -1009,7 +1010,7 @@ NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
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)));
@@ -1027,7 +1028,7 @@ NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
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. */
@@ -1095,7 +1096,7 @@ NTSTATUS wcache_save_creds(struct winbindd_domain *domain,
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));
@@ -1470,7 +1471,8 @@ static NTSTATUS sid_to_name(struct winbindd_domain *domain,
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;
@@ -1565,7 +1567,7 @@ static NTSTATUS rids_to_names(struct winbindd_domain *domain,
}
centry = wcache_fetch(cache, domain, "SN/%s",
- sid_to_string(tmp, &sid));
+ sid_to_fstring(tmp, &sid));
if (!centry) {
goto do_query;
}
@@ -1687,7 +1689,7 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
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
@@ -1759,7 +1761,8 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
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
@@ -1826,7 +1829,7 @@ do_query:
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:
@@ -1859,7 +1862,7 @@ static NTSTATUS lookup_useraliases(struct winbindd_domain *domain,
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;
}
@@ -1939,7 +1942,8 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
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;
@@ -1999,7 +2003,7 @@ 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:
@@ -2480,7 +2484,8 @@ bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
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;
}
@@ -2690,7 +2695,7 @@ NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const
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));
@@ -3544,7 +3549,7 @@ static int pack_tdc_domains( struct winbindd_tdc_domain *domains,
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 );
@@ -3825,7 +3830,7 @@ static void wcache_save_user_pwinfo(struct winbindd_domain *domain,
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) ));
@@ -3848,7 +3853,7 @@ NTSTATUS nss_get_info_cached( struct winbindd_domain *domain,
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;
diff --git a/source3/winbindd/winbindd_group.c b/source3/winbindd/winbindd_group.c
index 49562a112c..140943cc2c 100644
--- a/source3/winbindd/winbindd_group.c
+++ b/source3/winbindd/winbindd_group.c
@@ -1649,7 +1649,7 @@ static void getusersids_recv(void *private_data, bool success, DOM_SID *sids,
/* 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;
}
@@ -1663,7 +1663,7 @@ static void getusersids_recv(void *private_data, bool success, DOM_SID *sids,
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;
}
diff --git a/source3/winbindd/winbindd_idmap.c b/source3/winbindd/winbindd_idmap.c
index ebea6a7495..3c7aa2d0c2 100644
--- a/source3/winbindd/winbindd_idmap.c
+++ b/source3/winbindd/winbindd_idmap.c
@@ -84,7 +84,7 @@ void winbindd_set_mapping_async(TALLOC_CTX *mem_ctx, const struct id_map *map,
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);
@@ -301,7 +301,7 @@ void winbindd_sid2uid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
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);
}
@@ -357,7 +357,7 @@ void winbindd_sid2gid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
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));
@@ -444,7 +444,7 @@ enum winbindd_result winbindd_dual_uid2sid(struct winbindd_domain *domain,
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;
}
@@ -501,7 +501,7 @@ enum winbindd_result winbindd_dual_gid2sid(struct winbindd_domain *domain,
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));
diff --git a/source3/winbindd/winbindd_misc.c b/source3/winbindd/winbindd_misc.c
index 2771faf152..8c3ef5bb6f 100644
--- a/source3/winbindd/winbindd_misc.c
+++ b/source3/winbindd/winbindd_misc.c
@@ -466,7 +466,7 @@ void winbindd_domain_info(struct winbindd_cli_state *state)
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;
@@ -498,7 +498,7 @@ static void domain_info_init_recv(void *private_data, bool success)
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;
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index 8a372a3a8c..5133239258 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -51,7 +51,7 @@ static NTSTATUS append_info3_as_txt(TALLOC_CTX *mem_ctx,
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;
@@ -187,7 +187,7 @@ static NTSTATUS append_afs_token(TALLOC_CTX *mem_ctx,
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);
}
diff --git a/source3/winbindd/winbindd_sid.c b/source3/winbindd/winbindd_sid.c
index 302460c942..0e8e6ca00b 100644
--- a/source3/winbindd/winbindd_sid.c
+++ b/source3/winbindd/winbindd_sid.c
@@ -118,7 +118,7 @@ static void lookupname_recv(void *private_data, bool success,
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;
diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c
index 5ac1eb64da..70468b6bcd 100644
--- a/source3/winbindd/winbindd_util.c
+++ b/source3/winbindd/winbindd_util.c
@@ -668,7 +668,7 @@ enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domai
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;