Permalink
Browse files

Change flags from db|data to bind|tinydns (yes, we are backward-compa…

…tible)

git-svn-id: https://svn.alkaloid.net/gpl/ldap2dns/trunk@515 06cd67b6-e706-0410-b29e-9de616bca6e9
  • Loading branch information...
bklang committed Feb 18, 2010
1 parent d723e44 commit f8a79c72fea5419229eef0ca6c25742e3b436a5d
Showing with 18 additions and 14 deletions.
  1. +0 −8 TODO
  2. +18 −6 ldap2dns.c
View
8 TODO
@@ -6,14 +6,6 @@
* Print warning if running as root (2006/06/08 bklang)
---- For ldap2dns 1.0beta --- WILL BREAK COMPATIBILITY ---
-* Clean up DNS TXT support: text current requires a trailing '.', probably
- should introduce a new attribute for DNS TXT so it is unambiguous
- (2005/12/23 bklang)
-
-* Change output formats of "data" and "db" to "tinydns" and "bind"
- (2006/06/08 bklang)
-
--- Old TODOs from Jacob ---
Version ?.?.?
+ Make ldap2dns behave like a secondary nameserver by storing
View
@@ -164,7 +164,7 @@ static void set_datadir(void)
static void print_usage(void)
{
print_version();
- printf("usage: ldap2dns[d] [-df] [-o data|db] [-h host] [-p port] [-H hostURI] \\\n");
+ printf("usage: ldap2dns[d] [-df] [-o tinydns|bind] [-h host] [-p port] [-H hostURI] \\\n");
printf("\t\t[-D binddn] [-w password] [-L[filename]] [-u numsecs] \\\n");
printf("\t\t[-b searchbase] [-v[v]] [-V] [-t timeout] [-M maxrecords]\n");
printf("\n");
@@ -175,8 +175,8 @@ static void print_usage(void)
printf(" -D binddn\tUse the distinguished name binddn to bind to the LDAP directory\n");
printf(" -w bindpasswd\tUse bindpasswd as the password for simple authentication\n");
printf(" -b\t\tSearch base to use instead of default\n");
- printf(" -o data\tGenerate a tinydns compatible \"data\" file\n");
- printf(" -o db\t\tGenerate a BIND compatible zone files\n");
+ printf(" -o tinydns\tGenerate a tinydns compatible \"data\" file\n");
+ printf(" -o bind\t\tGenerate a BIND compatible zone files\n");
printf(" -L [filename]\tPrint output in LDIF format for reimport\n");
printf(" -h host\tHostname of LDAP server, defaults to localhost\n");
printf(" -p port\tPort number to connect to LDAP server, defaults to %d\n", LDAP_PORT);
@@ -344,10 +344,16 @@ static int parse_options()
options.reclimit = DEF_RECLIMIT;
ev = getenv("LDAP2DNS_OUTPUT");
if (ev) {
- if (strcmp(ev, "data")==0)
+ if (strcmp(ev, "bind")==0)
+ options.output = OUTPUT_DB;
+ else if (strcmp(ev, "tinydns")==0)
options.output = OUTPUT_DATA;
else if (strcmp(ev, "db")==0)
+ // Backward compatibility
options.output = OUTPUT_DB;
+ else if (strcmp(ev, "data")==0)
+ // Backward compatibility
+ options.output = OUTPUT_DATA;
}
ev = getenv("LDAP2DNS_VERBOSE");
if (ev && sscanf(ev, "%hd", (short *)&options.verbose) != 1)
@@ -428,9 +434,15 @@ static int parse_options()
break;
case 'o':
options.output = 0;
- if (strcmp(optarg, "data")==0)
+ if (strcmp(optarg, "tinydns")==0)
+ options.output = OUTPUT_DATA;
+ else if (strcmp(optarg, "bind")==0)
+ options.output = OUTPUT_DB;
+ else if (strcmp(optarg, "data")==0)
+ // Backward compatibility
options.output = OUTPUT_DATA;
else if (strcmp(optarg, "db")==0)
+ // Backward compatibility
options.output = OUTPUT_DB;
break;
case 'p':
@@ -1246,7 +1258,7 @@ int main(int argc, char** argv)
parse_options();
if (!options.output) {
- fprintf(stderr, "[!!]\tMust select an output type (\"db\" or \"data\")\n");
+ fprintf(stderr, "[!!]\tMust select an output type (\"bind\" or \"tinydns\")\n");
fprintf(stderr, "Use --help to see usage information\n");
exit(1);
}

0 comments on commit f8a79c7

Please sign in to comment.