s3-dns: prevent from potentially doing wrong SRV DNS lookups.
authorGünther Deschner <gd@samba.org>
Wed, 21 Dec 2011 14:47:35 +0000 (15:47 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 21 Dec 2011 16:23:25 +0000 (17:23 +0100)
With an empty sitename we asked for e.g.
_ldap._tcp.._sites.dc._msdcs.AD.EXAMPLE.COM

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Dec 21 17:23:25 CET 2011 on sn-devel-104

source3/libads/dns.c

index 5eae10ec28593fe572d08bea993a4080de26f959..39454fcebc099199e1edaecc1b62c7e2fe4ad981 100644 (file)
@@ -756,7 +756,7 @@ static NTSTATUS ads_dns_query_internal(TALLOC_CTX *ctx,
                                       int *numdcs )
 {
        char *name;
-       if (sitename) {
+       if (sitename && strlen(sitename)) {
                name = talloc_asprintf(ctx, "%s._tcp.%s._sites.%s._msdcs.%s",
                                       servicename, sitename,
                                       dc_pdc_gc_domains, realm);