summaryrefslogtreecommitdiffstats
path: root/source3/winbindd/idmap.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-08-13 17:26:36 +0200
committerMichael Adam <obnox@samba.org>2010-08-14 02:10:57 +0200
commit60eae5a1342cb0e4463d380aa2db837684e111c7 (patch)
tree63fce5016865a603b83a40dc204f257d178f9fff /source3/winbindd/idmap.c
parent9f60eb8c1b325ece9127a7c3858de7c7a48ae18f (diff)
downloadsamba-60eae5a1342cb0e4463d380aa2db837684e111c7.tar.gz
samba-60eae5a1342cb0e4463d380aa2db837684e111c7.tar.xz
samba-60eae5a1342cb0e4463d380aa2db837684e111c7.zip
s3:idmap: fix sid_to_unixid for builtin and own domain.
The old idmap code created a new mapping if asking the backends failed. Now with the new layering, if passdb (which is used for our own domain and builtin), then we need to continue and ask the backends, giving tdb or whatever the default backend is a chance to create a mapping.
Diffstat (limited to 'source3/winbindd/idmap.c')
-rw-r--r--source3/winbindd/idmap.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c
index bfa2bbccc4..2a4e2a5a43 100644
--- a/source3/winbindd/idmap.c
+++ b/source3/winbindd/idmap.c
@@ -616,13 +616,23 @@ NTSTATUS idmap_backends_sid_to_unixid(const char *domain, struct id_map *id)
maps[1] = NULL;
if (sid_check_is_in_builtin(id->sid)
- || (sid_check_is_in_our_domain(id->sid))) {
+ || (sid_check_is_in_our_domain(id->sid)))
+ {
+ NTSTATUS status;
+
+ DEBUG(10, ("asking passdb...\n"));
dom = idmap_init_passdb_domain(NULL);
if (dom == NULL) {
return NT_STATUS_NONE_MAPPED;
}
- return dom->methods->sids_to_unixids(dom, maps);
+ status = dom->methods->sids_to_unixids(dom, maps);
+
+ if (NT_STATUS_IS_OK(status) && id->status == ID_MAPPED) {
+ return status;
+ }
+
+ DEBUG(10, ("passdb could not map, asking backends...\n"));
}
dom = idmap_find_domain(domain);