mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
winbindd: Use dom_sid_str_buf
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
This commit is contained in:
parent
d425cd5b68
commit
58f76ab137
@ -847,6 +847,7 @@ static NTSTATUS idmap_ad_sids_to_unixids(struct idmap_domain *dom,
|
||||
bool ok;
|
||||
uint64_t account_type, xid;
|
||||
enum id_type type;
|
||||
struct dom_sid_buf buf;
|
||||
|
||||
if (tldap_msg_type(msg) != TLDAP_RES_SEARCH_ENTRY) {
|
||||
continue;
|
||||
@ -872,7 +873,6 @@ static NTSTATUS idmap_ad_sids_to_unixids(struct idmap_domain *dom,
|
||||
}
|
||||
}
|
||||
if (map == NULL) {
|
||||
struct dom_sid_buf buf;
|
||||
DBG_DEBUG("Got unexpected sid %s from object %s\n",
|
||||
dom_sid_str_buf(&sid, &buf),
|
||||
dn);
|
||||
@ -915,7 +915,8 @@ static NTSTATUS idmap_ad_sids_to_unixids(struct idmap_domain *dom,
|
||||
map->xid.id = xid;
|
||||
map->status = ID_MAPPED;
|
||||
|
||||
DEBUG(10, ("Mapped %s -> %lu (%d)\n", sid_string_dbg(map->sid),
|
||||
DEBUG(10, ("Mapped %s -> %lu (%d)\n",
|
||||
dom_sid_str_buf(map->sid, &buf),
|
||||
(unsigned long)map->xid.id, map->xid.type));
|
||||
}
|
||||
|
||||
|
@ -453,6 +453,7 @@ static NTSTATUS idmap_autorid_sid_to_id_alloc_action(
|
||||
ctx = (struct idmap_autorid_sid_to_id_alloc_ctx *)private_data;
|
||||
|
||||
if (idmap_autorid_sid_is_special(ctx->map->sid)) {
|
||||
struct dom_sid_buf buf;
|
||||
NTSTATUS ret;
|
||||
|
||||
ret = idmap_autorid_sid_to_id_special(ctx->dom, ctx->map);
|
||||
@ -465,7 +466,7 @@ static NTSTATUS idmap_autorid_sid_to_id_alloc_action(
|
||||
|
||||
DEBUG(10, ("Sepecial sid %s not mapped. falling back to "
|
||||
"regular allocation\n",
|
||||
sid_string_dbg(ctx->map->sid)));
|
||||
dom_sid_str_buf(ctx->map->sid, &buf)));
|
||||
}
|
||||
|
||||
return idmap_tdb_common_new_mapping(ctx->dom, ctx->map);
|
||||
@ -481,6 +482,7 @@ static NTSTATUS idmap_autorid_sid_to_id_alloc(
|
||||
{
|
||||
NTSTATUS ret;
|
||||
struct idmap_autorid_sid_to_id_alloc_ctx alloc_ctx;
|
||||
struct dom_sid_buf buf;
|
||||
|
||||
map->status = ID_UNKNOWN;
|
||||
|
||||
@ -495,19 +497,21 @@ static NTSTATUS idmap_autorid_sid_to_id_alloc(
|
||||
/* bad things happened */
|
||||
if (!NT_STATUS_EQUAL(ret, NT_STATUS_NONE_MAPPED)) {
|
||||
DEBUG(1, ("Looking up SID->ID mapping for %s failed: %s\n",
|
||||
sid_string_dbg(map->sid), nt_errstr(ret)));
|
||||
dom_sid_str_buf(map->sid, &buf),
|
||||
nt_errstr(ret)));
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (dom->read_only) {
|
||||
DEBUG(3, ("Not allocating new mapping for %s, because backend "
|
||||
"is read-only\n", sid_string_dbg(map->sid)));
|
||||
"is read-only\n",
|
||||
dom_sid_str_buf(map->sid, &buf)));
|
||||
map->status = ID_UNMAPPED;
|
||||
return NT_STATUS_NONE_MAPPED;
|
||||
}
|
||||
|
||||
DEBUG(10, ("Creating new mapping in pool for %s\n",
|
||||
sid_string_dbg(map->sid)));
|
||||
dom_sid_str_buf(map->sid, &buf)));
|
||||
|
||||
alloc_ctx.dom = dom;
|
||||
alloc_ctx.map = map;
|
||||
@ -546,25 +550,26 @@ static NTSTATUS idmap_autorid_sid_to_id(struct idmap_tdb_common_context *common,
|
||||
struct autorid_range_config range;
|
||||
uint32_t rid;
|
||||
struct dom_sid domainsid;
|
||||
struct dom_sid_buf buf;
|
||||
NTSTATUS ret;
|
||||
|
||||
ZERO_STRUCT(range);
|
||||
map->status = ID_UNKNOWN;
|
||||
|
||||
DEBUG(10, ("Trying to map %s\n", sid_string_dbg(map->sid)));
|
||||
DEBUG(10, ("Trying to map %s\n", dom_sid_str_buf(map->sid, &buf)));
|
||||
|
||||
sid_copy(&domainsid, map->sid);
|
||||
if (!sid_split_rid(&domainsid, &rid)) {
|
||||
DEBUG(4, ("Could not determine domain SID from %s, "
|
||||
"ignoring mapping request\n",
|
||||
sid_string_dbg(map->sid)));
|
||||
dom_sid_str_buf(map->sid, &buf)));
|
||||
map->status = ID_UNMAPPED;
|
||||
return NT_STATUS_NONE_MAPPED;
|
||||
}
|
||||
|
||||
if (idmap_autorid_domsid_is_for_alloc(&domainsid)) {
|
||||
DEBUG(10, ("SID %s is for ALLOC range.\n",
|
||||
sid_string_dbg(map->sid)));
|
||||
dom_sid_str_buf(map->sid, &buf)));
|
||||
|
||||
return idmap_autorid_sid_to_id_alloc(common, dom, map);
|
||||
}
|
||||
@ -709,9 +714,10 @@ static NTSTATUS idmap_autorid_sids_to_unixids(struct idmap_domain *dom,
|
||||
ret = idmap_autorid_sid_to_id(commoncfg, dom, ids[i]);
|
||||
if ((!NT_STATUS_IS_OK(ret)) &&
|
||||
(!NT_STATUS_EQUAL(ret, NT_STATUS_NONE_MAPPED))) {
|
||||
struct dom_sid_buf buf;
|
||||
/* some fatal error occurred, log it */
|
||||
DEBUG(3, ("Unexpected error resolving a SID (%s)\n",
|
||||
sid_string_dbg(ids[i]->sid)));
|
||||
dom_sid_str_buf(ids[i]->sid, &buf)));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -144,6 +144,7 @@ static NTSTATUS idmap_hash_initialize(struct idmap_domain *dom)
|
||||
/* create the hash table of domain SIDs */
|
||||
|
||||
for (i=0; i<num_domains; i++) {
|
||||
struct dom_sid_buf buf;
|
||||
uint32_t hash;
|
||||
|
||||
if (is_null_sid(&dom_list[i].sid))
|
||||
@ -166,7 +167,7 @@ static NTSTATUS idmap_hash_initialize(struct idmap_domain *dom)
|
||||
|
||||
DBG_INFO("Adding %s (%s) -> %d\n",
|
||||
dom_list[i].domain_name,
|
||||
sid_string_dbg(&dom_list[i].sid),
|
||||
dom_sid_str_buf(&dom_list[i].sid, &buf),
|
||||
hash);
|
||||
|
||||
hashed_domains[hash].sid = talloc(hashed_domains, struct dom_sid);
|
||||
|
@ -724,6 +724,7 @@ again:
|
||||
enum id_type type;
|
||||
struct id_map *map;
|
||||
uint32_t id;
|
||||
struct dom_sid_buf buf;
|
||||
|
||||
if (i == 0) { /* first entry */
|
||||
entry = ldap_first_entry(
|
||||
@ -797,7 +798,10 @@ again:
|
||||
DEBUG(1, ("WARNING: duplicate %s mapping in LDAP. "
|
||||
"overwriting mapping %u -> %s with %u -> %s\n",
|
||||
(type == ID_TYPE_UID) ? "UID" : "GID",
|
||||
id, sid_string_dbg(map->sid), id, sidstr));
|
||||
id,
|
||||
dom_sid_str_buf(map->sid, &buf),
|
||||
id,
|
||||
sidstr));
|
||||
}
|
||||
|
||||
TALLOC_FREE(sidstr);
|
||||
@ -805,7 +809,8 @@ again:
|
||||
/* mapped */
|
||||
map->status = ID_MAPPED;
|
||||
|
||||
DEBUG(10, ("Mapped %s -> %lu (%d)\n", sid_string_dbg(map->sid),
|
||||
DEBUG(10, ("Mapped %s -> %lu (%d)\n",
|
||||
dom_sid_str_buf(map->sid, &buf),
|
||||
(unsigned long)map->xid.id, map->xid.type));
|
||||
}
|
||||
|
||||
@ -940,6 +945,7 @@ again:
|
||||
enum id_type type;
|
||||
struct id_map *map;
|
||||
struct dom_sid sid;
|
||||
struct dom_sid_buf buf;
|
||||
uint32_t id;
|
||||
|
||||
if (i == 0) { /* first entry */
|
||||
@ -1024,8 +1030,10 @@ again:
|
||||
map->xid.id = id;
|
||||
map->status = ID_MAPPED;
|
||||
|
||||
DEBUG(10, ("Mapped %s -> %lu (%d)\n", sid_string_dbg(map->sid),
|
||||
(unsigned long)map->xid.id, map->xid.type));
|
||||
DEBUG(10, ("Mapped %s -> %lu (%d)\n",
|
||||
dom_sid_str_buf(map->sid, &buf),
|
||||
(unsigned long)map->xid.id,
|
||||
map->xid.type));
|
||||
}
|
||||
|
||||
/* free the ldap results */
|
||||
|
@ -158,9 +158,10 @@ static NTSTATUS idmap_rid_sids_to_unixids(struct idmap_domain *dom, struct id_ma
|
||||
|
||||
if (( ! NT_STATUS_IS_OK(ret)) &&
|
||||
( ! NT_STATUS_EQUAL(ret, NT_STATUS_NONE_MAPPED))) {
|
||||
struct dom_sid_buf buf;
|
||||
/* some fatal error occurred, log it */
|
||||
DEBUG(3, ("Unexpected error resolving a SID (%s)\n",
|
||||
sid_string_dbg(ids[i]->sid)));
|
||||
dom_sid_str_buf(ids[i]->sid, &buf)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "winbindd.h"
|
||||
#include "idmap.h"
|
||||
#include "idmap_rw.h"
|
||||
#include "libcli/security/dom_sid.h"
|
||||
|
||||
#undef DBGC_CLASS
|
||||
#define DBGC_CLASS DBGC_IDMAP
|
||||
@ -31,6 +32,7 @@ NTSTATUS idmap_rw_new_mapping(struct idmap_domain *dom,
|
||||
struct idmap_rw_ops *ops,
|
||||
struct id_map *map)
|
||||
{
|
||||
struct dom_sid_buf buf;
|
||||
NTSTATUS status;
|
||||
|
||||
if (map == NULL) {
|
||||
@ -53,7 +55,7 @@ NTSTATUS idmap_rw_new_mapping(struct idmap_domain *dom,
|
||||
}
|
||||
|
||||
DEBUG(10, ("Setting mapping: %s <-> %s %lu\n",
|
||||
sid_string_dbg(map->sid),
|
||||
dom_sid_str_buf(map->sid, &buf),
|
||||
(map->xid.type == ID_TYPE_UID) ? "UID" : "GID",
|
||||
(unsigned long)map->xid.id));
|
||||
|
||||
@ -63,7 +65,7 @@ NTSTATUS idmap_rw_new_mapping(struct idmap_domain *dom,
|
||||
if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
|
||||
struct id_map *ids[2];
|
||||
DEBUG(5, ("Mapping for %s exists - retrying to map sid\n",
|
||||
sid_string_dbg(map->sid)));
|
||||
dom_sid_str_buf(map->sid, &buf)));
|
||||
ids[0] = map;
|
||||
ids[1] = NULL;
|
||||
status = dom->methods->sids_to_unixids(dom, ids);
|
||||
|
@ -49,8 +49,9 @@ struct tevent_req *wb_lookupsid_send(TALLOC_CTX *mem_ctx,
|
||||
|
||||
state->lookup_domain = find_lookup_domain_from_sid(sid);
|
||||
if (state->lookup_domain == NULL) {
|
||||
struct dom_sid_buf buf;
|
||||
DEBUG(5, ("Could not find domain for sid %s\n",
|
||||
sid_string_dbg(sid)));
|
||||
dom_sid_str_buf(sid, &buf)));
|
||||
tevent_req_nterror(req, NT_STATUS_NONE_MAPPED);
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
@ -221,9 +221,12 @@ static void wb_xids2sids_init_dom_maps_lookupname_done(
|
||||
}
|
||||
|
||||
if (type != SID_NAME_DOMAIN) {
|
||||
struct dom_sid_buf buf;
|
||||
|
||||
DBG_WARNING("SID %s for idmap domain name '%s' "
|
||||
"not a domain SID\n",
|
||||
sid_string_dbg(&dom_maps[state->dom_idx].sid),
|
||||
dom_sid_str_buf(&dom_maps[state->dom_idx].sid,
|
||||
&buf),
|
||||
dom_maps[state->dom_idx].name);
|
||||
|
||||
ZERO_STRUCT(dom_maps[state->dom_idx].sid);
|
||||
|
@ -835,6 +835,7 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
|
||||
uint32_t primary_group_rid;
|
||||
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
|
||||
uint32_t num_groups = 0;
|
||||
struct dom_sid_buf buf;
|
||||
|
||||
DEBUG(3,("ads: lookup_usergroups\n"));
|
||||
*p_num_groups = 0;
|
||||
@ -867,7 +868,9 @@ 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_string_dbg(sid), ads_errstr(rc)));
|
||||
"%s\n",
|
||||
dom_sid_str_buf(sid, &buf),
|
||||
ads_errstr(rc)));
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -876,13 +879,14 @@ 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_string_dbg(sid), count));
|
||||
dom_sid_str_buf(sid, &buf),
|
||||
count));
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!msg) {
|
||||
DEBUG(1,("lookup_usergroups(sid=%s) ads_search tokenGroups: NULL msg\n",
|
||||
sid_string_dbg(sid)));
|
||||
dom_sid_str_buf(sid, &buf)));
|
||||
status = NT_STATUS_UNSUCCESSFUL;
|
||||
goto done;
|
||||
}
|
||||
@ -895,7 +899,8 @@ 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_string_dbg(sid)));
|
||||
domain->name,
|
||||
dom_sid_str_buf(sid, &buf)));
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -961,7 +966,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_string_dbg(sid)));
|
||||
dom_sid_str_buf(sid, &buf)));
|
||||
done:
|
||||
TALLOC_FREE(user_dn);
|
||||
ads_msgfree(ads, msg);
|
||||
@ -1085,9 +1090,10 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
|
||||
uint32_t num_nocache = 0;
|
||||
TALLOC_CTX *tmp_ctx = NULL;
|
||||
uint32_t rid;
|
||||
struct dom_sid_buf buf;
|
||||
|
||||
DEBUG(10,("ads: lookup_groupmem %s sid=%s\n", domain->name,
|
||||
sid_string_dbg(group_sid)));
|
||||
dom_sid_str_buf(group_sid, &buf)));
|
||||
|
||||
*num_names = 0;
|
||||
|
||||
@ -1213,7 +1219,8 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
|
||||
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_dbg(&sid)));
|
||||
"cache\n",
|
||||
dom_sid_str_buf(&sid, &buf)));
|
||||
sid_copy(&(*sid_mem)[*num_names], &sid);
|
||||
(*names)[*num_names] = fill_domain_username_talloc(
|
||||
*names,
|
||||
@ -1226,7 +1233,8 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
|
||||
}
|
||||
else {
|
||||
DEBUG(10, ("ads: lookup_groupmem: sid %s not found in "
|
||||
"cache\n", sid_string_dbg(&sid)));
|
||||
"cache\n",
|
||||
dom_sid_str_buf(&sid, &buf)));
|
||||
sid_copy(&(sid_mem_nocache)[num_nocache], &sid);
|
||||
num_nocache++;
|
||||
}
|
||||
@ -1302,7 +1310,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_dbg(group_sid)));
|
||||
dom_sid_str_buf(group_sid, &buf)));
|
||||
|
||||
done:
|
||||
|
||||
|
@ -1280,7 +1280,7 @@ NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
|
||||
struct cache_entry *centry = NULL;
|
||||
NTSTATUS status;
|
||||
uint32_t rid;
|
||||
struct dom_sid_buf tmp;
|
||||
struct dom_sid_buf sidstr;
|
||||
|
||||
if (!cache->tdb) {
|
||||
return NT_STATUS_INTERNAL_DB_ERROR;
|
||||
@ -1298,10 +1298,10 @@ NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
|
||||
fall back to an unsalted cred. */
|
||||
|
||||
centry = wcache_fetch(cache, domain, "CRED/%s",
|
||||
dom_sid_str_buf(sid, &tmp));
|
||||
dom_sid_str_buf(sid, &sidstr));
|
||||
if (!centry) {
|
||||
DEBUG(10,("wcache_get_creds: entry for [CRED/%s] not found\n",
|
||||
sid_string_dbg(sid)));
|
||||
dom_sid_str_buf(sid, &sidstr)));
|
||||
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
|
||||
}
|
||||
|
||||
@ -1319,7 +1319,6 @@ NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
|
||||
|
||||
*cached_nt_pass = (const uint8_t *)centry_hash16(centry, mem_ctx);
|
||||
if (*cached_nt_pass == NULL) {
|
||||
struct dom_sid_buf sidstr;
|
||||
|
||||
dom_sid_str_buf(sid, &sidstr);
|
||||
|
||||
@ -1347,7 +1346,8 @@ 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_dbg(sid), nt_errstr(status) ));
|
||||
dom_sid_str_buf(sid, &sidstr),
|
||||
nt_errstr(status) ));
|
||||
|
||||
centry_free(centry);
|
||||
return status;
|
||||
|
@ -167,8 +167,10 @@ NTSTATUS _wbint_Sids2UnixIDs(struct pipes_struct *p,
|
||||
|
||||
dom = idmap_find_domain_with_sid(d->name.string, d->sid);
|
||||
if (dom == NULL) {
|
||||
struct dom_sid_buf buf;
|
||||
DEBUG(10, ("idmap domain %s:%s not found\n",
|
||||
d->name.string, sid_string_dbg(d->sid)));
|
||||
d->name.string,
|
||||
dom_sid_str_buf(d->sid, &buf)));
|
||||
|
||||
for (i=0; i<num_ids; i++) {
|
||||
|
||||
|
@ -115,8 +115,10 @@ NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
|
||||
char *buf;
|
||||
|
||||
if (tevent_req_is_nterror(req, &status)) {
|
||||
struct dom_sid_buf sidbuf;
|
||||
DEBUG(5, ("Could not convert sid %s: %s\n",
|
||||
sid_string_dbg(state->sid), nt_errstr(status)));
|
||||
dom_sid_str_buf(state->sid, &sidbuf),
|
||||
nt_errstr(status)));
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include "includes.h"
|
||||
#include "winbindd.h"
|
||||
#include "libcli/security/dom_sid.h"
|
||||
|
||||
struct winbindd_getgrnam_state {
|
||||
struct tevent_context *ev;
|
||||
@ -168,8 +169,10 @@ NTSTATUS winbindd_getgrnam_recv(struct tevent_req *req,
|
||||
char *buf;
|
||||
|
||||
if (tevent_req_is_nterror(req, &status)) {
|
||||
struct dom_sid_buf sidbuf;
|
||||
DEBUG(5, ("Could not convert sid %s: %s\n",
|
||||
sid_string_dbg(&state->sid), nt_errstr(status)));
|
||||
dom_sid_str_buf(&state->sid, &sidbuf),
|
||||
nt_errstr(status)));
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -246,8 +246,10 @@ NTSTATUS winbindd_getgroups_recv(struct tevent_req *req,
|
||||
NTSTATUS status;
|
||||
|
||||
if (tevent_req_is_nterror(req, &status)) {
|
||||
struct dom_sid_buf buf;
|
||||
DEBUG(5, ("Could not convert sid %s: %s\n",
|
||||
sid_string_dbg(&state->sid), nt_errstr(status)));
|
||||
dom_sid_str_buf(&state->sid, &buf),
|
||||
nt_errstr(status)));
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "includes.h"
|
||||
#include "winbindd.h"
|
||||
#include "passdb/lookup_sid.h" /* only for LOOKUP_NAME_NO_NSS flag */
|
||||
#include "libcli/security/dom_sid.h"
|
||||
|
||||
struct winbindd_getpwnam_state {
|
||||
struct tevent_context *ev;
|
||||
@ -136,8 +137,10 @@ NTSTATUS winbindd_getpwnam_recv(struct tevent_req *req,
|
||||
NTSTATUS status;
|
||||
|
||||
if (tevent_req_is_nterror(req, &status)) {
|
||||
struct dom_sid_buf buf;
|
||||
DEBUG(5, ("Could not convert sid %s: %s\n",
|
||||
sid_string_dbg(&state->sid), nt_errstr(status)));
|
||||
dom_sid_str_buf(&state->sid, &buf),
|
||||
nt_errstr(status)));
|
||||
return status;
|
||||
}
|
||||
response->data.pw = state->pw;
|
||||
|
@ -87,8 +87,10 @@ NTSTATUS winbindd_getpwsid_recv(struct tevent_req *req,
|
||||
NTSTATUS status;
|
||||
|
||||
if (tevent_req_is_nterror(req, &status)) {
|
||||
struct dom_sid_buf buf;
|
||||
DEBUG(5, ("Could not convert sid %s: %s\n",
|
||||
sid_string_dbg(&state->sid), nt_errstr(status)));
|
||||
dom_sid_str_buf(&state->sid, &buf),
|
||||
nt_errstr(status)));
|
||||
return status;
|
||||
}
|
||||
response->data.pw = state->pw;
|
||||
|
@ -110,8 +110,10 @@ NTSTATUS winbindd_getpwuid_recv(struct tevent_req *req,
|
||||
NTSTATUS status;
|
||||
|
||||
if (tevent_req_is_nterror(req, &status)) {
|
||||
struct dom_sid_buf buf;
|
||||
DEBUG(5, ("Could not convert sid %s: %s\n",
|
||||
sid_string_dbg(state->sid), nt_errstr(status)));
|
||||
dom_sid_str_buf(state->sid, &buf),
|
||||
nt_errstr(status)));
|
||||
return status;
|
||||
}
|
||||
response->data.pw = state->pw;
|
||||
|
@ -88,13 +88,15 @@ NTSTATUS winbindd_getusersids_recv(struct tevent_req *req,
|
||||
{
|
||||
struct winbindd_getusersids_state *state = tevent_req_data(
|
||||
req, struct winbindd_getusersids_state);
|
||||
struct dom_sid_buf sidbuf;
|
||||
NTSTATUS status;
|
||||
int i;
|
||||
char *result;
|
||||
|
||||
if (tevent_req_is_nterror(req, &status)) {
|
||||
DEBUG(5, ("Could not convert sid %s: %s\n",
|
||||
sid_string_dbg(&state->sid), nt_errstr(status)));
|
||||
dom_sid_str_buf(&state->sid, &sidbuf),
|
||||
nt_errstr(status)));
|
||||
return status;
|
||||
}
|
||||
|
||||
@ -104,7 +106,6 @@ NTSTATUS winbindd_getusersids_recv(struct tevent_req *req,
|
||||
}
|
||||
|
||||
for (i=0; i<state->num_sids; i++) {
|
||||
struct dom_sid_buf sidbuf;
|
||||
result = talloc_asprintf_append_buffer(
|
||||
result,
|
||||
"%s\n",
|
||||
|
@ -602,6 +602,7 @@ static void wb_irpc_lsa_LookupNames4_done(struct tevent_req *subreq)
|
||||
struct wb_irpc_lsa_LookupNames4_state *state =
|
||||
talloc_get_type_abort(nstate->state,
|
||||
struct wb_irpc_lsa_LookupNames4_state);
|
||||
struct dom_sid_buf buf;
|
||||
NTSTATUS status;
|
||||
|
||||
SMB_ASSERT(state->num_pending > 0);
|
||||
@ -619,7 +620,8 @@ static void wb_irpc_lsa_LookupNames4_done(struct tevent_req *subreq)
|
||||
&nstate->authority_sid, NULL);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DBG_ERR("dom_sid_split_rid(%s) failed - %s\n",
|
||||
sid_string_dbg(&nstate->sid), nt_errstr(status));
|
||||
dom_sid_str_buf(&nstate->sid, &buf),
|
||||
nt_errstr(status));
|
||||
irpc_send_reply(state->msg, status);
|
||||
return;
|
||||
}
|
||||
@ -630,7 +632,8 @@ static void wb_irpc_lsa_LookupNames4_done(struct tevent_req *subreq)
|
||||
&state->num_domain_sids);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DBG_ERR("add_sid_to_array_unique(%s) failed - %s\n",
|
||||
sid_string_dbg(nstate->authority_sid), nt_errstr(status));
|
||||
dom_sid_str_buf(nstate->authority_sid, &buf),
|
||||
nt_errstr(status));
|
||||
irpc_send_reply(state->msg, status);
|
||||
return;
|
||||
}
|
||||
|
@ -64,8 +64,9 @@ struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX *mem_ctx,
|
||||
|
||||
domain = find_lookup_domain_from_sid(&state->domain_sid);
|
||||
if (domain == NULL) {
|
||||
struct dom_sid_buf buf;
|
||||
DEBUG(5, ("Domain for sid %s not found\n",
|
||||
sid_string_dbg(&state->domain_sid)));
|
||||
dom_sid_str_buf(&state->domain_sid, &buf)));
|
||||
tevent_req_nterror(req, NT_STATUS_NO_SUCH_DOMAIN);
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
@ -89,8 +89,10 @@ NTSTATUS winbindd_lookupsid_recv(struct tevent_req *req,
|
||||
NTSTATUS status;
|
||||
|
||||
if (tevent_req_is_nterror(req, &status)) {
|
||||
struct dom_sid_buf buf;
|
||||
DEBUG(5, ("Could not lookup sid %s: %s\n",
|
||||
sid_string_dbg(&state->sid), nt_errstr(status)));
|
||||
dom_sid_str_buf(&state->sid, &buf),
|
||||
nt_errstr(status)));
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -289,9 +289,11 @@ static NTSTATUS msrpc_sid_to_name(struct winbindd_domain *domain,
|
||||
NTSTATUS result;
|
||||
NTSTATUS name_map_status = NT_STATUS_UNSUCCESSFUL;
|
||||
char *mapped_name = NULL;
|
||||
struct dom_sid_buf buf;
|
||||
|
||||
DEBUG(3, ("msrpc_sid_to_name: %s for domain %s\n", sid_string_dbg(sid),
|
||||
domain->name ));
|
||||
DEBUG(3, ("msrpc_sid_to_name: %s for domain %s\n",
|
||||
dom_sid_str_buf(sid, &buf),
|
||||
domain->name));
|
||||
|
||||
result = winbindd_lookup_sids(mem_ctx,
|
||||
domain,
|
||||
@ -403,11 +405,13 @@ static NTSTATUS msrpc_lookup_usergroups(struct winbindd_domain *domain,
|
||||
struct rpc_pipe_client *samr_pipe;
|
||||
struct policy_handle dom_pol;
|
||||
struct dom_sid *user_grpsids = NULL;
|
||||
struct dom_sid_buf buf;
|
||||
uint32_t num_groups = 0;
|
||||
TALLOC_CTX *tmp_ctx;
|
||||
NTSTATUS status;
|
||||
|
||||
DEBUG(3,("msrpc_lookup_usergroups sid=%s\n", sid_string_dbg(user_sid)));
|
||||
DEBUG(3,("msrpc_lookup_usergroups sid=%s\n",
|
||||
dom_sid_str_buf(user_sid, &buf)));
|
||||
|
||||
*pnum_groups = 0;
|
||||
|
||||
@ -549,9 +553,10 @@ static NTSTATUS msrpc_lookup_groupmem(struct winbindd_domain *domain,
|
||||
unsigned int orig_timeout;
|
||||
struct samr_RidAttrArray *rids = NULL;
|
||||
struct dcerpc_binding_handle *b;
|
||||
struct dom_sid_buf buf;
|
||||
|
||||
DEBUG(3,("msrpc_lookup_groupmem: %s sid=%s\n", domain->name,
|
||||
sid_string_dbg(group_sid)));
|
||||
dom_sid_str_buf(group_sid, &buf)));
|
||||
|
||||
if ( !winbindd_can_contact_domain( domain ) ) {
|
||||
DEBUG(10,("lookup_groupmem: No incoming trust for domain %s\n",
|
||||
|
@ -375,8 +375,10 @@ static NTSTATUS check_info3_in_group(struct netr_SamInfo3 *info3,
|
||||
security_token_debug(DBGC_CLASS, 10, token);
|
||||
|
||||
for (i=0; i<num_require_membership_of_sid; i++) {
|
||||
DEBUG(10, ("Checking SID %s\n", sid_string_dbg(
|
||||
&require_membership_of_sid[i])));
|
||||
struct dom_sid_buf buf;
|
||||
DEBUG(10, ("Checking SID %s\n",
|
||||
dom_sid_str_buf(&require_membership_of_sid[i],
|
||||
&buf)));
|
||||
if (nt_token_check_sid(&require_membership_of_sid[i],
|
||||
token)) {
|
||||
DEBUG(10, ("Access ok\n"));
|
||||
@ -3046,6 +3048,7 @@ NTSTATUS winbindd_pam_auth_pac_verify(struct winbindd_cli_state *state,
|
||||
info3_copy->base.logon_domain.string);
|
||||
if (domain && domain->primary ) {
|
||||
struct dom_sid user_sid;
|
||||
struct dom_sid_buf buf;
|
||||
|
||||
sid_compose(&user_sid,
|
||||
info3_copy->base.domain_sid,
|
||||
@ -3060,7 +3063,7 @@ NTSTATUS winbindd_pam_auth_pac_verify(struct winbindd_cli_state *state,
|
||||
DBG_INFO("PAC for user %s\\%s SID %s primed cache\n",
|
||||
info3_copy->base.logon_domain.string,
|
||||
info3_copy->base.account_name.string,
|
||||
sid_string_dbg(&user_sid));
|
||||
dom_sid_str_buf(&user_sid, &buf));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -668,8 +668,10 @@ static NTSTATUS sam_sid_to_name(struct winbindd_domain *domain,
|
||||
!sid_check_is_in_unix_groups(sid) &&
|
||||
!sid_check_is_unix_groups(sid) &&
|
||||
!sid_check_is_in_wellknown_domain(sid)) {
|
||||
struct dom_sid_buf buf;
|
||||
DEBUG(0, ("sam_sid_to_name: possible deadlock - trying to "
|
||||
"lookup SID %s\n", sid_string_dbg(sid)));
|
||||
"lookup SID %s\n",
|
||||
dom_sid_str_buf(sid, &buf)));
|
||||
return NT_STATUS_NONE_MAPPED;
|
||||
}
|
||||
|
||||
@ -746,8 +748,10 @@ static NTSTATUS sam_rids_to_names(struct winbindd_domain *domain,
|
||||
!sid_check_is_unix_users(domain_sid) &&
|
||||
!sid_check_is_unix_groups(domain_sid) &&
|
||||
!sid_check_is_in_wellknown_domain(domain_sid)) {
|
||||
struct dom_sid_buf buf;
|
||||
DEBUG(0, ("sam_rids_to_names: possible deadlock - trying to "
|
||||
"lookup SID %s\n", sid_string_dbg(domain_sid)));
|
||||
"lookup SID %s\n",
|
||||
dom_sid_str_buf(domain_sid, &buf)));
|
||||
return NT_STATUS_NONE_MAPPED;
|
||||
}
|
||||
|
||||
|
@ -126,6 +126,7 @@ static NTSTATUS add_trusted_domain(const char *domain_name,
|
||||
const char **ignored_domains = NULL;
|
||||
const char **dom = NULL;
|
||||
int role = lp_server_role();
|
||||
struct dom_sid_buf buf;
|
||||
|
||||
if (is_null_sid(sid)) {
|
||||
DBG_ERR("Got null SID for domain [%s]\n", domain_name);
|
||||
@ -169,7 +170,8 @@ static NTSTATUS add_trusted_domain(const char *domain_name,
|
||||
if (check_domain != NULL) {
|
||||
DBG_ERR("SID [%s] already used by domain [%s], "
|
||||
"expected [%s]\n",
|
||||
sid_string_dbg(sid), check_domain->name,
|
||||
dom_sid_str_buf(sid, &buf),
|
||||
check_domain->name,
|
||||
domain->name);
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
@ -292,7 +294,7 @@ static NTSTATUS add_trusted_domain(const char *domain_name,
|
||||
|
||||
DBG_NOTICE("Added domain [%s] [%s] [%s]\n",
|
||||
domain->name, domain->alt_name,
|
||||
sid_string_dbg(&domain->sid));
|
||||
dom_sid_str_buf(&domain->sid, &buf));
|
||||
|
||||
*_d = domain;
|
||||
return NT_STATUS_OK;
|
||||
@ -1455,7 +1457,9 @@ struct winbindd_domain *find_default_route_domain(void)
|
||||
|
||||
struct winbindd_domain *find_lookup_domain_from_sid(const struct dom_sid *sid)
|
||||
{
|
||||
DBG_DEBUG("SID [%s]\n", sid_string_dbg(sid));
|
||||
struct dom_sid_buf buf;
|
||||
|
||||
DBG_DEBUG("SID [%s]\n", dom_sid_str_buf(sid, &buf));
|
||||
|
||||
/*
|
||||
* SIDs in the S-1-22-{1,2} domain and well-known SIDs should be handled
|
||||
|
Loading…
Reference in New Issue
Block a user