Commit Diff
Diff:
22da1ac04eecb739fb7e112da769f6631c4740b2
40df8d684e052f145329e406c1c08d0c7e60705e
Commit:
40df8d684e052f145329e406c1c08d0c7e60705e
Tree:
d5eebb1ca18e29903abc07da10b6fdf8116d50cd
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Fri May 11 20:54:29 2018 UTC
Message:
fix up last commit, it came to my attention it was creating duplicates
blob - 76ae6affd1775fc0f984526d9d5e1fea57ee0725
blob + ad08b2ea4bba4f33e931445cb0e66677f3ad248b
--- dddctl.c
+++ dddctl.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: dddctl.c,v 1.10 2018/05/10 09:18:16 pjp Exp $
+ * $Id: dddctl.c,v 1.11 2018/05/11 20:54:29 pjp Exp $
*/
#include "ddd-include.h"
@@ -7267,7 +7267,7 @@ dump_db_bind(ddDB *db, FILE *of, char *zonename)
memcpy((char *)sdomain, (char *)n->data, n->datalen);
- if (strcmp(sdomain->zonename, zonename) == 0)
+ if (strcmp(convert_name(sdomain->zone, sdomain->zonelen), zonename) == 0)
continue;
if (print_sd_bind(of, sdomain) < 0) {
@@ -7870,6 +7870,7 @@ bindfile(int argc, char *argv[])
char *zonefile;
char *zonename;
FILE *of = stdout;
+ int len;
if (argc != 3) {
usage(argc, argv);
@@ -7878,6 +7879,20 @@ bindfile(int argc, char *argv[])
zonename = argv[1];
zonefile = argv[2];
+
+ len = strlen(zonename);
+ if (zonename[len - 1] != '.') {
+ len += 2;
+ zonename = malloc(len);
+ if (zonename == NULL) {
+ perror("malloc");
+ return 1;
+ }
+
+ strlcpy(zonename, argv[1], len);
+ strlcat(zonename, ".", len);
+ }
+
#if __OpenBSD__
if (pledge("stdio rpath cpath", NULL) < 0) {
repomaster@centroid.eu