From 1b0421a1a3d2b2e0168c0957864c16adf93e326d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
Date: Wed, 21 Dec 2011 15:47:35 +0100
Subject: [PATCH] s3-dns: prevent from potentially doing wrong SRV DNS
 lookups.

With an empty sitename we asked for e.g.
_ldap._tcp.._sites.dc._msdcs.AD.EXAMPLE.COM

Guenther
---
 source3/libads/dns.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Index: samba-3.6.6/source3/libads/dns.c
===================================================================
--- samba-3.6.6.orig/source3/libads/dns.c
+++ samba-3.6.6/source3/libads/dns.c
@@ -741,7 +741,7 @@ static NTSTATUS ads_dns_query_internal(T
 				       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);
