From 08696dc541cafa1f25f1b4e0839fcc6b96f9d936 Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Tue, 10 May 2011 12:19:13 -0400 Subject: [PATCH] Properly quote TXT records for BIND (thanks again Alex) --- ldap2dns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldap2dns.c b/ldap2dns.c index 52bea1c..98850af 100644 --- a/ldap2dns.c +++ b/ldap2dns.c @@ -648,7 +648,7 @@ static void write_rr(struct resourcerecord* rr, int ipdx, int znix) if (tinyfile) fprintf(tinyfile, "'%s:%s:%s:%s:%s\n", rr->dnsdomainname, rr->txt, rr->ttl, rr->timestamp, rr->location); if (namedzone) - fprintf(namedzone, "%s\t%s\tIN TXT\t%s.\n", rr->dnsdomainname, rr->ttl, rr->txt); + fprintf(namedzone, "%s.\t%s\tIN TXT\t\"%s\"\n", rr->dnsdomainname, rr->ttl, rr->txt); } else if (strcasecmp(rr->type, "SRV")==0) { if (tinyfile) { fprintf(tinyfile, ":%s:33:\\%03o\\%03o\\%03o\\%03o\\%03o\\%03o", rr->dnsdomainname, rr->srvpriority >> 8, rr->srvpriority & 0xff, rr->srvweight >> 8, rr->srvweight & 0xff, rr->srvport >> 8, rr->srvport & 0xff);