summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/idmap.c12
-rw-r--r--source3/winbindd/idmap_ad.c6
-rw-r--r--source3/winbindd/idmap_ldap.c6
-rw-r--r--source3/winbindd/idmap_rid.c2
-rw-r--r--source3/winbindd/idmap_util.c12
-rw-r--r--source3/winbindd/winbindd_ads.c33
-rw-r--r--source3/winbindd/winbindd_async.c4
-rw-r--r--source3/winbindd/winbindd_cache.c18
-rw-r--r--source3/winbindd/winbindd_group.c31
-rw-r--r--source3/winbindd/winbindd_idmap.c4
-rw-r--r--source3/winbindd/winbindd_pam.c2
-rw-r--r--source3/winbindd/winbindd_passdb.c4
-rw-r--r--source3/winbindd/winbindd_rpc.c17
-rw-r--r--source3/winbindd/winbindd_user.c21
-rw-r--r--source3/winbindd/winbindd_util.c5
15 files changed, 86 insertions, 91 deletions
diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c
index 6b4af10f6f..c1b4e10adf 100644
--- a/source3/winbindd/idmap.c
+++ b/source3/winbindd/idmap.c
@@ -912,7 +912,7 @@ static NTSTATUS idmap_can_map(const struct id_map *map,
"our primary domain when <trusted domain "
"only> is True\n"));
DEBUGADD(10, ("Leave [%s] unmapped\n",
- sid_string_static(map->sid)));
+ sid_string_dbg(map->sid)));
return NT_STATUS_UNSUCCESSFUL;
}
}
@@ -921,7 +921,7 @@ static NTSTATUS idmap_can_map(const struct id_map *map,
/* huh, couldn't find a suitable domain,
* let's just leave it unmapped */
DEBUG(10, ("Could not find idmap backend for SID %s\n",
- sid_string_static(map->sid)));
+ sid_string_dbg(map->sid)));
return NT_STATUS_NO_SUCH_DOMAIN;
}
@@ -929,7 +929,7 @@ static NTSTATUS idmap_can_map(const struct id_map *map,
/* ouch the domain is read only,
* let's just leave it unmapped */
DEBUG(10, ("idmap backend for SID %s is READONLY!\n",
- sid_string_static(map->sid)));
+ sid_string_dbg(map->sid)));
return NT_STATUS_UNSUCCESSFUL;
}
@@ -983,7 +983,7 @@ static NTSTATUS idmap_new_mapping(TALLOC_CTX *ctx, struct id_map *map)
map->status = ID_MAPPED;
DEBUG(10, ("Setting mapping: %s <-> %s %lu\n",
- sid_string_static(map->sid),
+ sid_string_dbg(map->sid),
(map->xid.type == ID_TYPE_UID) ? "UID" : "GID",
(unsigned long)map->xid.id));
ret = dom->methods->set_mapping(dom, map);
@@ -1006,7 +1006,7 @@ static NTSTATUS idmap_backends_set_mapping(const struct id_map *map)
NTSTATUS ret;
DEBUG(10, ("Setting mapping %s <-> %s %lu\n",
- sid_string_static(map->sid),
+ sid_string_dbg(map->sid),
(map->xid.type == ID_TYPE_UID) ? "UID" : "GID",
(unsigned long)map->xid.id));
@@ -1150,7 +1150,7 @@ static NTSTATUS idmap_backends_sids_to_unixids(struct id_map **ids)
}
DEBUG(10,("SID %s is being handled by %s\n",
- sid_string_static(ids[i]->sid),
+ sid_string_dbg(ids[i]->sid),
dom ? dom->name : "none" ));
idx = find_idmap_domain_index( dom );
diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c
index 50f7914f85..0d7c068844 100644
--- a/source3/winbindd/idmap_ad.c
+++ b/source3/winbindd/idmap_ad.c
@@ -441,8 +441,7 @@ again:
/* mapped */
map->status = ID_MAPPED;
- DEBUG(10, ("Mapped %s -> %lu (%d)\n",
- sid_string_static(map->sid),
+ DEBUG(10, ("Mapped %s -> %lu (%d)\n", sid_string_dbg(map->sid),
(unsigned long)map->xid.id,
map->xid.type));
}
@@ -628,8 +627,7 @@ again:
map->xid.id = id;
map->status = ID_MAPPED;
- DEBUG(10, ("Mapped %s -> %lu (%d)\n",
- sid_string_static(map->sid),
+ DEBUG(10, ("Mapped %s -> %lu (%d)\n", sid_string_dbg(map->sid),
(unsigned long)map->xid.id,
map->xid.type));
}
diff --git a/source3/winbindd/idmap_ldap.c b/source3/winbindd/idmap_ldap.c
index 17e9eefe43..fa80fae5d8 100644
--- a/source3/winbindd/idmap_ldap.c
+++ b/source3/winbindd/idmap_ldap.c
@@ -1065,8 +1065,7 @@ again:
/* mapped */
map->status = ID_MAPPED;
- DEBUG(10, ("Mapped %s -> %lu (%d)\n",
- sid_string_static(map->sid),
+ DEBUG(10, ("Mapped %s -> %lu (%d)\n", sid_string_dbg(map->sid),
(unsigned long)map->xid.id, map->xid.type));
}
@@ -1298,8 +1297,7 @@ again:
map->xid.id = id;
map->status = ID_MAPPED;
- DEBUG(10, ("Mapped %s -> %lu (%d)\n",
- sid_string_static(map->sid),
+ DEBUG(10, ("Mapped %s -> %lu (%d)\n", sid_string_dbg(map->sid),
(unsigned long)map->xid.id, map->xid.type));
}
diff --git a/source3/winbindd/idmap_rid.c b/source3/winbindd/idmap_rid.c
index 8e5f1302f7..f1cd77853c 100644
--- a/source3/winbindd/idmap_rid.c
+++ b/source3/winbindd/idmap_rid.c
@@ -237,7 +237,7 @@ static NTSTATUS idmap_rid_sids_to_unixids(struct idmap_domain *dom, struct id_ma
( ! NT_STATUS_EQUAL(ret, NT_STATUS_NONE_MAPPED))) {
/* some fatal error occurred, log it */
DEBUG(3, ("Unexpected error resolving a SID (%s)\n",
- sid_string_static(ids[i]->sid)));
+ sid_string_dbg(ids[i]->sid)));
}
}
diff --git a/source3/winbindd/idmap_util.c b/source3/winbindd/idmap_util.c
index 077c599739..bf06cd8472 100644
--- a/source3/winbindd/idmap_util.c
+++ b/source3/winbindd/idmap_util.c
@@ -101,7 +101,7 @@ NTSTATUS idmap_sid_to_uid(DOM_SID *sid, uid_t *uid)
struct id_map map;
struct id_map *maps[2];
- DEBUG(10,("idmap_sid_to_uid: sid = [%s]\n", sid_string_static(sid)));
+ DEBUG(10,("idmap_sid_to_uid: sid = [%s]\n", sid_string_dbg(sid)));
map.sid = sid;
map.xid.type = ID_TYPE_UID;
@@ -112,13 +112,13 @@ NTSTATUS idmap_sid_to_uid(DOM_SID *sid, uid_t *uid)
ret = idmap_sids_to_unixids(maps);
if ( ! NT_STATUS_IS_OK(ret)) {
DEBUG(10, ("error mapping sid [%s] to uid\n",
- sid_string_static(sid)));
+ sid_string_dbg(sid)));
return ret;
}
if ((map.status != ID_MAPPED) || (map.xid.type != ID_TYPE_UID)) {
DEBUG(10, ("sid [%s] not mapped to an uid [%u,%u,%u]\n",
- sid_string_static(sid),
+ sid_string_dbg(sid),
map.status,
map.xid.type,
map.xid.id));
@@ -141,7 +141,7 @@ NTSTATUS idmap_sid_to_gid(DOM_SID *sid, gid_t *gid)
struct id_map map;
struct id_map *maps[2];
- DEBUG(10,("idmap_sid_to_gid: sid = [%s]\n", sid_string_static(sid)));
+ DEBUG(10,("idmap_sid_to_gid: sid = [%s]\n", sid_string_dbg(sid)));
map.sid = sid;
map.xid.type = ID_TYPE_GID;
@@ -152,13 +152,13 @@ NTSTATUS idmap_sid_to_gid(DOM_SID *sid, gid_t *gid)
ret = idmap_sids_to_unixids(maps);
if ( ! NT_STATUS_IS_OK(ret)) {
DEBUG(10, ("error mapping sid [%s] to gid\n",
- sid_string_static(sid)));
+ sid_string_dbg(sid)));
return ret;
}
if ((map.status != ID_MAPPED) || (map.xid.type != ID_TYPE_GID)) {
DEBUG(10, ("sid [%s] not mapped to a gid [%u,%u,%u]\n",
- sid_string_static(sid),
+ sid_string_dbg(sid),
map.status,
map.xid.type,
map.xid.id));
diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c
index 71ce3dd364..c9b2a52388 100644
--- a/source3/winbindd/winbindd_ads.c
+++ b/source3/winbindd/winbindd_ads.c
@@ -435,7 +435,7 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
{
DEBUG(5,("query_user: Cache lookup succeeded for %s\n",
- sid_string_static(sid)));
+ sid_string_dbg(sid)));
sid_compose(&info->user_sid, &domain->sid, user->user_rid);
sid_compose(&info->group_sid, &domain->sid, user->group_rid);
@@ -490,14 +490,14 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
free(sidstr);
if (!ADS_ERR_OK(rc) || !msg) {
DEBUG(1,("query_user(sid=%s) ads_search: %s\n",
- sid_string_static(sid), ads_errstr(rc)));
+ sid_string_dbg(sid), ads_errstr(rc)));
goto done;
}
count = ads_count_replies(ads, msg);
if (count != 1) {
DEBUG(1,("query_user(sid=%s): Not found\n",
- sid_string_static(sid)));
+ sid_string_dbg(sid)));
goto done;
}
@@ -513,7 +513,7 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
if (!ads_pull_uint32(ads, msg, "primaryGroupID", &group_rid)) {
DEBUG(1,("No primary group for %s !?\n",
- sid_string_static(sid)));
+ sid_string_dbg(sid)));
goto done;
}
@@ -756,7 +756,6 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
int i;
DOM_SID primary_group;
uint32 primary_group_rid;
- fstring sid_string;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
size_t num_groups = 0;
@@ -790,8 +789,8 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
if (!ADS_ERR_OK(rc)) {
status = ads_ntstatus(rc);
- DEBUG(1,("lookup_usergroups(sid=%s) ads_search tokenGroups: %s\n",
- sid_to_string(sid_string, sid), ads_errstr(rc)));
+ DEBUG(1, ("lookup_usergroups(sid=%s) ads_search tokenGroups: "
+ "%s\n", sid_string_dbg(sid), ads_errstr(rc)));
goto done;
}
@@ -800,13 +799,13 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
status = NT_STATUS_UNSUCCESSFUL;
DEBUG(1,("lookup_usergroups(sid=%s) ads_search tokenGroups: "
"invalid number of results (count=%d)\n",
- sid_to_string(sid_string, sid), count));
+ sid_string_dbg(sid), count));
goto done;
}
if (!msg) {
DEBUG(1,("lookup_usergroups(sid=%s) ads_search tokenGroups: NULL msg\n",
- sid_to_string(sid_string, sid)));
+ sid_string_dbg(sid)));
status = NT_STATUS_UNSUCCESSFUL;
goto done;
}
@@ -819,7 +818,7 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
if (!ads_pull_uint32(ads, msg, "primaryGroupID", &primary_group_rid)) {
DEBUG(1,("%s: No primary group for sid=%s !?\n",
- domain->name, sid_to_string(sid_string, sid)));
+ domain->name, sid_string_dbg(sid)));
goto done;
}
@@ -885,7 +884,7 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
status = (*user_sids != NULL) ? NT_STATUS_OK : NT_STATUS_NO_MEMORY;
DEBUG(3,("ads lookup_usergroups (tokenGroups) succeeded for sid=%s\n",
- sid_to_string(sid_string, sid)));
+ sid_string_dbg(sid)));
done:
ads_memfree(ads, user_dn);
ads_msgfree(ads, msg);
@@ -920,7 +919,7 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
TALLOC_CTX *tmp_ctx = NULL;
DEBUG(10,("ads: lookup_groupmem %s sid=%s\n", domain->name,
- sid_string_static(group_sid)));
+ sid_string_dbg(group_sid)));
*num_names = 0;
@@ -1018,8 +1017,8 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
goto done;
}
if (lookup_cached_sid(mem_ctx, &sid, &domain_name, &name, &name_type)) {
- DEBUG(10,("ads: lookup_groupmem: got sid %s from cache\n",
- sid_string_static(&sid)));
+ DEBUG(10,("ads: lookup_groupmem: got sid %s from "
+ "cache\n", sid_string_dbg(&sid)));
sid_copy(&(*sid_mem)[*num_names], &sid);
(*names)[*num_names] = talloc_asprintf(*names, "%s%c%s",
domain_name,
@@ -1030,8 +1029,8 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
(*num_names)++;
}
else {
- DEBUG(10, ("ads: lookup_groupmem: sid %s not found in cache\n",
- sid_string_static(&sid)));
+ DEBUG(10, ("ads: lookup_groupmem: sid %s not found in "
+ "cache\n", sid_string_dbg(&sid)));
sid_copy(&(sid_mem_nocache)[num_nocache], &sid);
num_nocache++;
}
@@ -1096,7 +1095,7 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
status = NT_STATUS_OK;
DEBUG(3,("ads lookup_groupmem for sid=%s succeeded\n",
- sid_string_static(group_sid)));
+ sid_string_dbg(group_sid)));
done:
diff --git a/source3/winbindd/winbindd_async.c b/source3/winbindd/winbindd_async.c
index c0254412e5..6cd85a2694 100644
--- a/source3/winbindd/winbindd_async.c
+++ b/source3/winbindd/winbindd_async.c
@@ -202,7 +202,7 @@ void winbindd_lookupsid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
domain = find_lookup_domain_from_sid(sid);
if (domain == NULL) {
DEBUG(5, ("Could not find domain for sid %s\n",
- sid_string_static(sid)));
+ sid_string_dbg(sid)));
cont(private_data, False, NULL, NULL, SID_NAME_UNKNOWN);
return;
}
@@ -788,7 +788,7 @@ void winbindd_gettoken_async(TALLOC_CTX *mem_ctx, const DOM_SID *user_sid,
domain = find_domain_from_sid_noinit(user_sid);
if (domain == NULL) {
DEBUG(5, ("Could not find domain from SID %s\n",
- sid_string_static(user_sid)));
+ sid_string_dbg(user_sid)));
cont(private_data, False, NULL, 0);
return;
}
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index 7ec8208f4b..c4554a2ad4 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -855,8 +855,8 @@ static void wcache_save_name_to_sid(struct winbindd_domain *domain,
fstrcpy(uname, name);
strupper_m(uname);
centry_end(centry, "NS/%s/%s", domain_name, uname);
- DEBUG(10,("wcache_save_name_to_sid: %s\\%s -> %s (%s)\n", domain_name, uname,
- sid_string_static(sid), nt_errstr(status)));
+ DEBUG(10,("wcache_save_name_to_sid: %s\\%s -> %s (%s)\n", domain_name,
+ uname, sid_string_dbg(sid), nt_errstr(status)));
centry_free(centry);
}
@@ -1010,7 +1010,7 @@ NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
centry = wcache_fetch(cache, domain, "CRED/%s", sid_string_static(sid));
if (!centry) {
DEBUG(10,("wcache_get_creds: entry for [CRED/%s] not found\n",
- sid_string_static(sid)));
+ sid_string_dbg(sid)));
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
@@ -1023,7 +1023,9 @@ NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
*cached_nt_pass = (const uint8 *)centry_hash16(centry, mem_ctx);
if (*cached_nt_pass == NULL) {
- const char *sidstr = sid_string_static(sid);
+ fstring sidstr;
+
+ sid_to_string(sidstr, sid);
/* Bad (old) cred cache. Delete and pretend we
don't have it. */
@@ -1049,7 +1051,7 @@ NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
status = centry->status;
DEBUG(10,("wcache_get_creds: [Cached] - cached creds for user %s status: %s\n",
- sid_string_static(sid), nt_errstr(status) ));
+ sid_string_dbg(sid), nt_errstr(status) ));
centry_free(centry);
return status;
@@ -3696,7 +3698,7 @@ bool wcache_tdc_add_domain( struct winbindd_domain *domain )
DEBUG(10,("wcache_tdc_add_domain: Adding domain %s (%s), SID %s, "
"flags = 0x%x, attributes = 0x%x, type = 0x%x\n",
domain->name, domain->alt_name,
- sid_string_static(&domain->sid),
+ sid_string_dbg(&domain->sid),
domain->domain_flags,
domain->domain_trust_attribs,
domain->domain_type));
@@ -3815,7 +3817,7 @@ static void wcache_save_user_pwinfo(struct winbindd_domain *domain,
centry_end(centry, "NSS/PWINFO/%s", sid_string_static(user_sid) );
- DEBUG(10,("wcache_save_user_pwinfo: %s\n", sid_string_static(user_sid) ));
+ DEBUG(10,("wcache_save_user_pwinfo: %s\n", sid_string_dbg(user_sid) ));
centry_free(centry);
}
@@ -3847,7 +3849,7 @@ NTSTATUS nss_get_info_cached( struct winbindd_domain *domain,
centry_free(centry);
DEBUG(10,("nss_get_info_cached: [Cached] - user_sid %s\n",
- sid_string_static(user_sid)));
+ sid_string_dbg(user_sid)));
return NT_STATUS_OK;
diff --git a/source3/winbindd/winbindd_group.c b/source3/winbindd/winbindd_group.c
index 30e274ff86..dc8cebf92f 100644
--- a/source3/winbindd/winbindd_group.c
+++ b/source3/winbindd/winbindd_group.c
@@ -77,7 +77,7 @@ static void add_expanded_sid(const DOM_SID *sid, char **pp_members, size_t *p_nu
if (domain == NULL) {
DEBUG(3, ("Could not find domain for sid %s\n",
- sid_string_static(sid)));
+ sid_string_dbg(sid)));
goto done;
}
@@ -86,7 +86,7 @@ static void add_expanded_sid(const DOM_SID *sid, char **pp_members, size_t *p_nu
if (!NT_STATUS_IS_OK(result)) {
DEBUG(3, ("sid_to_name failed for sid %s\n",
- sid_string_static(sid)));
+ sid_string_dbg(sid)));
goto done;
}
@@ -109,7 +109,7 @@ static void add_expanded_sid(const DOM_SID *sid, char **pp_members, size_t *p_nu
if (domain == NULL) {
DEBUG(3, ("Could not find domain from SID %s\n",
- sid_string_static(sid)));
+ sid_string_dbg(sid)));
goto done;
}
@@ -126,7 +126,7 @@ static void add_expanded_sid(const DOM_SID *sid, char **pp_members, size_t *p_nu
for (i=0; i<num_names; i++) {
DEBUG(10, ("Adding group member SID %s\n",
- sid_string_static(&sid_mem[i])));
+ sid_string_dbg(&sid_mem[i])));
if (types[i] != SID_NAME_USER) {
DEBUG(1, ("Hmmm. Member %s of group %s is no user. "
@@ -234,7 +234,7 @@ static bool fill_grent_mem_domusers( TALLOC_CTX *mem_ctx,
pquerying_user_sid = &querying_user_sid;
DEBUG(10,("fill_grent_mem_domain_users: querying uid %u -> %s\n",
(unsigned int)ret_uid,
- sid_string_static(pquerying_user_sid) ));
+ sid_string_dbg(pquerying_user_sid)));
}
}
}
@@ -244,7 +244,7 @@ static bool fill_grent_mem_domusers( TALLOC_CTX *mem_ctx,
(sid_compare_domain(pquerying_user_sid, &domain->sid) == 0)) {
DEBUG(10,("fill_grent_mem_domain_users: querying user = %s\n",
- sid_string_static(pquerying_user_sid) ));
+ sid_string_dbg(pquerying_user_sid) ));
status = domain->methods->lookup_usergroups(domain,
mem_ctx,
@@ -254,7 +254,7 @@ static bool fill_grent_mem_domusers( TALLOC_CTX *mem_ctx,
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("fill_grent_mem_domain_users: lookup_usergroups failed "
"for sid %s in domain %s (error: %s)\n",
- sid_string_static(pquerying_user_sid),
+ sid_string_dbg(pquerying_user_sid),
domain->name,
nt_errstr(status)));
return False;
@@ -278,7 +278,8 @@ static bool fill_grent_mem_domusers( TALLOC_CTX *mem_ctx,
enum lsa_SidType type;
DEBUG(10,("fill_grent_mem_domain_users: sid %s in 'Domain Users' in domain %s\n",
- sid_string_static(pquerying_user_sid), domain->name ));
+ sid_string_dbg(pquerying_user_sid),
+ domain->name ));
status = domain->methods->sid_to_name(domain, mem_ctx,
pquerying_user_sid,
@@ -288,7 +289,7 @@ static bool fill_grent_mem_domusers( TALLOC_CTX *mem_ctx,
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("could not lookup username for user "
"sid %s in domain %s (error: %s)\n",
- sid_string_static(pquerying_user_sid),
+ sid_string_dbg(pquerying_user_sid),
domain->name,
nt_errstr(status)));
return False;
@@ -488,7 +489,7 @@ static bool fill_grent_mem(struct winbindd_domain *domain,
if (!(mem_ctx = talloc_init("fill_grent_mem(%s)", domain->name)))
return False;
- DEBUG(10, ("group SID %s\n", sid_string_static(group_sid)));
+ DEBUG(10, ("group SID %s\n", sid_string_dbg(group_sid)));
/* Initialize with no members */
@@ -511,8 +512,8 @@ static bool fill_grent_mem(struct winbindd_domain *domain,
((group_name_type==SID_NAME_ALIAS) && domain->primary)) )
{
DEBUG(1, ("SID %s in domain %s isn't a domain group (%d)\n",
- sid_string_static(group_sid), domain->name,
- group_name_type));
+ sid_string_dbg(group_sid),
+ domain->name, group_name_type));
goto done;
}
@@ -836,7 +837,7 @@ static void winbindd_getgrsid( struct winbindd_cli_state *state, const DOM_SID g
if ( (s->domain = find_domain_from_sid_noinit(&group_sid)) == NULL ) {
DEBUG(3, ("Could not find domain for sid %s\n",
- sid_string_static(&group_sid)));
+ sid_string_dbg(&group_sid)));
request_error(state);
return;
}
@@ -1191,7 +1192,7 @@ void winbindd_getgrent(struct winbindd_cli_state *state)
enum lsa_SidType type;
DEBUG(10, ("SID %s not in idmap\n",
- sid_string_static(&group_sid)));
+ sid_string_dbg(&group_sid)));
if (!pdb_sid_to_id(&group_sid, &id, &type)) {
DEBUG(1, ("could not look up gid for group "
@@ -1690,7 +1691,7 @@ void winbindd_getuserdomgroups(struct winbindd_cli_state *state)
/* Get info for the domain */
if ((domain = find_domain_from_sid_noinit(&user_sid)) == NULL) {
DEBUG(0,("could not find domain entry for sid %s\n",
- sid_string_static(&user_sid)));
+ sid_string_dbg(&user_sid)));
request_error(state);
return;
}
diff --git a/source3/winbindd/winbindd_idmap.c b/source3/winbindd/winbindd_idmap.c
index 6f7b562415..ebea6a7495 100644
--- a/source3/winbindd/winbindd_idmap.c
+++ b/source3/winbindd/winbindd_idmap.c
@@ -385,7 +385,9 @@ enum winbindd_result winbindd_dual_sid2gid(struct winbindd_domain *domain,
result = idmap_sid_to_gid(&sid, &state->response.data.gid);
- DEBUG(10, ("winbindd_dual_sid2gid: 0x%08x - %s - %u\n", NT_STATUS_V(result), sid_string_static(&sid), state->response.data.gid));
+ DEBUG(10, ("winbindd_dual_sid2gid: 0x%08x - %s - %u\n",
+ NT_STATUS_V(result), sid_string_dbg(&sid),
+ state->response.data.gid));
return NT_STATUS_IS_OK(result) ? WINBINDD_OK : WINBINDD_ERROR;
}
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index 4eda0fcada..8a372a3a8c 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -304,7 +304,7 @@ static NTSTATUS check_info3_in_group(TALLOC_CTX *mem_ctx,
debug_nt_user_token(DBGC_CLASS, 10, token);
for (i=0; i<num_require_membership_of_sid; i++) {
- DEBUG(10, ("Checking SID %s\n", sid_string_static(
+ DEBUG(10, ("Checking SID %s\n", sid_string_dbg(
&require_membership_of_sid[i])));
if (nt_token_check_sid(&require_membership_of_sid[i],
token)) {
diff --git a/source3/winbindd/winbindd_passdb.c b/source3/winbindd/winbindd_passdb.c
index f925ac2153..29db8be857 100644
--- a/source3/winbindd/winbindd_passdb.c
+++ b/source3/winbindd/winbindd_passdb.c
@@ -132,7 +132,7 @@ static NTSTATUS sid_to_name(struct winbindd_domain *domain,
{
const char *dom, *nam;
- DEBUG(10, ("Converting SID %s\n", sid_string_static(sid)));
+ DEBUG(10, ("Converting SID %s\n", sid_string_dbg(sid)));
/* Paranoia check */
if (!sid_check_is_in_builtin(sid) &&
@@ -144,7 +144,7 @@ static NTSTATUS sid_to_name(struct winbindd_domain *domain,
!sid_check_is_in_wellknown_domain(sid))
{
DEBUG(0, ("Possible deadlock: Trying to lookup SID %s with "
- "passdb backend\n", sid_string_static(sid)));
+ "passdb backend\n", sid_string_dbg(sid)));
return NT_STATUS_NONE_MAPPED;
}
diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c
index dd45060412..ffb47692cb 100644
--- a/source3/winbindd/winbindd_rpc.c
+++ b/source3/winbindd/winbindd_rpc.c
@@ -313,8 +313,8 @@ NTSTATUS msrpc_sid_to_name(struct winbindd_domain *domain,
struct rpc_pipe_client *cli;
POLICY_HND lsa_policy;
- DEBUG(3,("sid_to_name [rpc] %s for domain %s\n", sid_string_static(sid),
- domain->name ));
+ DEBUG(3,("sid_to_name [rpc] %s for domain %s\n", sid_string_dbg(sid),
+ domain->name ));
result = cm_connect_lsa(domain, mem_ctx, &cli, &lsa_policy);
if (!NT_STATUS_IS_OK(result)) {
@@ -409,13 +409,11 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
POLICY_HND dom_pol, user_pol;
SAM_USERINFO_CTR *ctr;
- fstring sid_string;
uint32 user_rid;
NET_USER_INFO_3 *user;
struct rpc_pipe_client *cli;
- DEBUG(3,("rpc: query_user sid=%s\n",
- sid_to_string(sid_string, user_sid)));
+ DEBUG(3,("rpc: query_user sid=%s\n", sid_string_dbg(user_sid)));
if (!sid_peek_check_rid(&domain->sid, user_sid, &user_rid))
return NT_STATUS_UNSUCCESSFUL;
@@ -430,7 +428,7 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
{
DEBUG(5,("query_user: Cache lookup succeeded for %s\n",
- sid_string_static(user_sid)));
+ sid_string_dbg(user_sid)));
sid_compose(&user_info->user_sid, &domain->sid, user->user_rid);
sid_compose(&user_info->group_sid, &domain->sid,
@@ -506,12 +504,10 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
uint32 des_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
DOM_GID *user_groups;
unsigned int i;
- fstring sid_string;
uint32 user_rid;
struct rpc_pipe_client *cli;
- DEBUG(3,("rpc: lookup_usergroups sid=%s\n",
- sid_to_string(sid_string, user_sid)));
+ DEBUG(3,("rpc: lookup_usergroups sid=%s\n", sid_string_dbg(user_sid)));
if (!sid_peek_check_rid(&domain->sid, user_sid, &user_rid))
return NT_STATUS_UNSUCCESSFUL;
@@ -677,12 +673,11 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
uint32 *rid_mem = NULL;
uint32 group_rid;
unsigned int j;
- fstring sid_string;
struct rpc_pipe_client *cli;
unsigned int orig_timeout;
DEBUG(10,("rpc: lookup_groupmem %s sid=%s\n", domain->name,
- sid_to_string(sid_string, group_sid)));
+ sid_string_dbg(group_sid)));
if ( !winbindd_can_contact_domain( domain ) ) {
DEBUG(10,("lookup_groupmem: No incoming trust for domain %s\n",
diff --git a/source3/winbindd/winbindd_user.c b/source3/winbindd/winbindd_user.c
index 01cdd0a9d3..6241d84fe6 100644
--- a/source3/winbindd/winbindd_user.c
+++ b/source3/winbindd/winbindd_user.c
@@ -73,7 +73,6 @@ static bool winbindd_fill_pwent(char *dom_name, char *user_name,
struct winbindd_pw *pw)
{
fstring output_username;
- fstring sid_string;
if (!pw || !dom_name || !user_name)
return False;
@@ -81,14 +80,16 @@ static bool winbindd_fill_pwent(char *dom_name, char *user_name,
/* Resolve the uid number */
if (!NT_STATUS_IS_OK(idmap_sid_to_uid(user_sid, &pw->pw_uid))) {
- DEBUG(1, ("error getting user id for sid %s\n", sid_to_string(sid_string, user_sid)));
+ DEBUG(1, ("error getting user id for sid %s\n",
+ sid_string_dbg(user_sid)));
return False;
}
/* Resolve the gid number */
if (!NT_STATUS_IS_OK(idmap_sid_to_gid(group_sid, &pw->pw_gid))) {
- DEBUG(1, ("error getting group id for sid %s\n", sid_to_string(sid_string, group_sid)));
+ DEBUG(1, ("error getting group id for sid %s\n",
+ sid_string_dbg(group_sid)));
return False;
}
@@ -146,7 +147,7 @@ enum winbindd_result winbindd_dual_userinfo(struct winbindd_domain *domain,
&sid, &user_info);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("error getting user info for sid %s\n",
- sid_string_static(&sid)));
+ sid_string_dbg(&sid)));
return WINBINDD_ERROR;
}
@@ -158,7 +159,7 @@ enum winbindd_result winbindd_dual_userinfo(struct winbindd_domain *domain,
if (!sid_peek_check_rid(&domain->sid, &user_info.group_sid,
&state->response.data.user_info.group_rid)) {
DEBUG(1, ("Could not extract group rid out of %s\n",
- sid_string_static(&sid)));
+ sid_string_dbg(&sid)));
return WINBINDD_ERROR;
}
@@ -203,7 +204,7 @@ static void winbindd_getpwsid(struct winbindd_cli_state *state,
s->domain = find_domain_from_sid_noinit(sid);
if (s->domain == NULL) {
DEBUG(3, ("Could not find domain for sid %s\n",
- sid_string_static(sid)));
+ sid_string_dbg(sid)));
goto error;
}
@@ -230,8 +231,8 @@ static void getpwsid_queryuser_recv(void *private_data, bool success,
talloc_get_type_abort(private_data, struct getpwsid_state);
if (!success) {
- DEBUG(5, ("Could not query domain %s SID %s\n", s->domain->name,
- sid_string_static(&s->user_sid)));
+ DEBUG(5, ("Could not query domain %s SID %s\n",
+ s->domain->name, sid_string_dbg(&s->user_sid)));
request_error(s->state);
return;
}
@@ -247,7 +248,7 @@ static void getpwsid_queryuser_recv(void *private_data, bool success,
domain = find_lookup_domain_from_sid(&s->user_sid);
if (domain == NULL) {
DEBUG(5, ("find_lookup_domain_from_sid(%s) failed\n",
- sid_string_static(&s->user_sid)));
+ sid_string_dbg(&s->user_sid)));
request_error(s->state);
return;
}
@@ -258,7 +259,7 @@ static void getpwsid_queryuser_recv(void *private_data, bool success,
/* If this still fails we ar4e done. Just error out */
if ( !user_name ) {
DEBUG(5,("Could not obtain a name for SID %s\n",
- sid_string_static(&s->user_sid)));
+ sid_string_dbg(&s->user_sid)));
request_error(s->state);
return;
}
diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c
index 2389a4be13..b552aac709 100644
--- a/source3/winbindd/winbindd_util.c
+++ b/source3/winbindd/winbindd_util.c
@@ -193,7 +193,7 @@ static struct winbindd_domain *add_trusted_domain(const char *domain_name, const
DEBUG(2,("Added domain %s %s %s\n",
domain->name, domain->alt_name,
- &domain->sid?sid_string_static(&domain->sid):""));
+ &domain->sid?sid_string_dbg(&domain->sid):""));
return domain;
}
@@ -922,8 +922,7 @@ struct winbindd_domain *find_lookup_domain_from_sid(const DOM_SID *sid)
* one to contact the external DC's. On member servers the internal
* domains are different: These are part of the local SAM. */
- DEBUG(10, ("find_lookup_domain_from_sid(%s)\n",
- sid_string_static(sid)));
+ DEBUG(10, ("find_lookup_domain_from_sid(%s)\n", sid_string_dbg(sid)));
if (IS_DC || is_internal_domain(sid) || is_in_internal_domain(sid)) {
DEBUG(10, ("calling find_domain_from_sid\n"));