s4-rpc: dnsserver: Fix removal of trailing '.' in soa mname
[obnox/samba/samba-obnox.git] / source4 / rpc_server / dnsserver / dnsdata.c
index f0584a981163e97c207fa93679b73fe773e6f097..87b7d87ae3b4e681b95e649204c0f64bca816248 100644 (file)
@@ -412,9 +412,9 @@ struct dnsp_DnssrvRpcRecord *dns_to_dnsp_copy(TALLOC_CTX *mem_ctx, struct DNS_RP
 
                len = dns->data.soa.NamePrimaryServer.len;
                if (dns->data.soa.NamePrimaryServer.str[len-1] == '.') {
-                       dnsp->data.soa.mname = talloc_strdup(mem_ctx, dns->data.soa.NamePrimaryServer.str);
-               } else {
                        dnsp->data.soa.mname = talloc_strndup(mem_ctx, dns->data.soa.NamePrimaryServer.str, len-1);
+               } else {
+                       dnsp->data.soa.mname = talloc_strdup(mem_ctx, dns->data.soa.NamePrimaryServer.str);
                }
 
                len = dns->data.soa.ZoneAdministratorEmail.len;