The branch, v3-5-test has been updated via b5c8b1b Second part of fix for bug #7777 - When requesting lookups for BUILTIN sids, winbindd allocates new uids/gids in error. via 32a5aa6 First part of fix for bug #7777 - When requesting lookups for BUILTIN sids, winbindd allocates new uids/gids in error. from 82e15a5 s3: Fix bug 7779, crash in expand_msdfs
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test - Log ----------------------------------------------------------------- commit b5c8b1bbb53caa0ceabb4a5180ff7deb1e58b538 Author: Jeremy Allison <j...@samba.org> Date: Fri Nov 5 12:13:38 2010 -0700 Second part of fix for bug #7777 - When requesting lookups for BUILTIN sids, winbindd allocates new uids/gids in error. Ensure we return after calling passdb for SID lookups for which we are authoritative. Jeremy. commit 32a5aa62cb54e90947bd027e72871ffc07c3dbcf Author: Jeremy Allison <j...@samba.org> Date: Fri Nov 5 12:11:53 2010 -0700 First part of fix for bug #7777 - When requesting lookups for BUILTIN sids, winbindd allocates new uids/gids in error. Ensure idmap_init_passdb_domain() correctly initialized the default domain first. Jeremy. ----------------------------------------------------------------------- Summary of changes: source3/winbindd/idmap.c | 10 ++++++++++ source3/winbindd/idmap_util.c | 31 +++++++++++++++++++++++++------ 2 files changed, 35 insertions(+), 6 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c index 4aa229c..7aa2853 100644 --- a/source3/winbindd/idmap.c +++ b/source3/winbindd/idmap.c @@ -428,6 +428,16 @@ fail: static struct idmap_domain *idmap_init_passdb_domain(TALLOC_CTX *mem_ctx) { + /* + * Always init the default domain, we can't go without one + */ + if (default_idmap_domain == NULL) { + default_idmap_domain = idmap_init_default_domain(NULL); + } + if (default_idmap_domain == NULL) { + return NULL; + } + if (passdb_idmap_domain != NULL) { return passdb_idmap_domain; } diff --git a/source3/winbindd/idmap_util.c b/source3/winbindd/idmap_util.c index 37b7ecb..ba5e637 100644 --- a/source3/winbindd/idmap_util.c +++ b/source3/winbindd/idmap_util.c @@ -25,6 +25,23 @@ #define DBGC_CLASS DBGC_IDMAP /***************************************************************** + Returns true if the request was for a specific domain, or + for a sid we are authoritative for - BUILTIN, or our own domain. +*****************************************************************/ + +static bool is_specific_domain_request(const char *dom_name, DOM_SID *sid) +{ + if (dom_name && dom_name[0] != '\0') { + return true; + } + if (sid_check_is_in_builtin(sid) || + sid_check_is_in_our_domain(sid)) { + return true; + } + return false; +} + +/***************************************************************** Returns the SID mapped to the given UID. If mapping is not possible returns an error. *****************************************************************/ @@ -194,10 +211,11 @@ backend: goto done; } - if (dom_name[0] != '\0') { + if (is_specific_domain_request(dom_name, sid)) { /* - * We had the task to go to a specific domain which - * could not answer our request. Fail. + * We had the task to go to a specific domain or + * a domain for which we are authoritative for and + * it could not answer our request. Fail. */ if (winbindd_use_idmap_cache()) { idmap_cache_set_sid2uid(sid, -1); @@ -275,10 +293,11 @@ backend: goto done; } - if (domname[0] != '\0') { + if (is_specific_domain_request(domname, sid)) { /* - * We had the task to go to a specific domain which - * could not answer our request. Fail. + * We had the task to go to a specific domain or + * a domain for which we are authoritative for and + * it could not answer our request. Fail. */ if (winbindd_use_idmap_cache()) { idmap_cache_set_sid2uid(sid, -1); -- Samba Shared Repository