]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3-winbind: DON'T PANIC if we couldn't find the domain.
authorAndreas Schneider <asn@samba.org>
Tue, 4 Sep 2012 12:30:38 +0000 (14:30 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 4 Sep 2012 17:08:38 +0000 (19:08 +0200)
If we don't have a connection to a trusted domain but still try to do a
lookup we shouldn't segfault.

Signed-off-by: Andreas Schneider <asn@samba.org>
Fix bug #9135 - Don't segfault if we don't find a domain in
resolve_username_to_alias()/fill_grent() .

source3/winbindd/winbindd_group.c

index 9cc1d1467ef9829f9f1fb956e34527b05a729809..8662a9c16bde2aaac7a3d31987b4aef8791683ca 100644 (file)
@@ -35,9 +35,17 @@ bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
 {
        fstring full_group_name;
        char *mapped_name = NULL;
-       struct winbindd_domain *domain = find_domain_from_name_noinit(dom_name);
+       struct winbindd_domain *domain;
        NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
 
+       domain = find_domain_from_name_noinit(dom_name);
+       if (domain == NULL) {
+               DEBUG(0, ("Failed to find domain '%s'. "
+                         "Check connection to trusted domains!\n",
+                         dom_name));
+               return false;
+       }
+
        nt_status = normalize_name_map(mem_ctx, domain, gr_name,
                                       &mapped_name);