From 2991d167eed65acc94423e9243819e13477cc26e Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Fri, 2 Dec 2005 04:21:08 +0000 Subject: [PATCH] Importing version 0.2.4 git-svn-id: https://svn.alkaloid.net/gpl/ldap2dns/trunk@4 06cd67b6-e706-0410-b29e-9de616bca6e9 --- CHANGELOG | 15 ++++++++--- Makefile | 10 +++---- README.html | 3 ++- Specfile | 5 ---- TODO | 3 --- dns.schema | 4 +-- index.html | 2 ++ ldap2dns.c | 78 ++++++++++++++++++++++++++++++++++++++++------------- 8 files changed, 81 insertions(+), 39 deletions(-) delete mode 100644 TODO diff --git a/CHANGELOG b/CHANGELOG index a66b408..84d1f6d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,8 +1,15 @@ -Version 0.2.4 (todo) -+ Check for next availabe server in /etc/ldap.conf - if first one is unavialable. +Version 0.2.5 (next) ++ Make ldap2dns behave like a secondary nameserver by storing + the serial number, expire, refresh, retry and minimum values + in a record. ++ Password to connect to LDAP now is invisible to ps. -Version 0.2.3 +Version 0.2.4 (latest) +- Check for next availabe server in /etc/ldap.conf + if one is unavialable. +- Schema for DNSzone in dns.schema was corrected. + +Version 0.2.3 - Replaced integer variables for DNSserial, DNSttl etc. by strings to allow better default handling by tinydns-data. - ldap2dns now writes logfiles. diff --git a/Makefile b/Makefile index 0b94dbe..6c1d434 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ -# $Id: Makefile,v 1.22 2001/02/16 09:51:23 jrief Exp $ -VERSION=0.2.3 +# $Id: Makefile,v 1.24 2001/05/08 07:00:06 jrief Exp $ +VERSION=0.2.4 RELEASE=1 CC=gcc -O2 -CFLAGS=$(INC) $(WITHTINYDNS) -DVERSION='"$(VERSION)"' +CFLAGS=$(INC) -DVERSION='"$(VERSION)"' OBJS=ldap2dns.o -LIBS=-lldap -llber -lresolv +LIBS=-lldap -llber LD=gcc LDFLAGS= INSTALL_PREFIX= @@ -32,7 +32,7 @@ install: all install -o root -g root -m 644 dns.oc.conf $(LDAPCONFDIR)/ clean: - rm -f $(OBJS) ldap2dns ldap2dnsd data* *.db $(SPECFILE) + rm -f $(OBJS) ldap2dns ldap2dnsd data* *.db core $(SPECFILE) tar: clean cd ..; \ diff --git a/README.html b/README.html index 8e26116..2eb03b6 100644 --- a/README.html +++ b/README.html @@ -329,7 +329,8 @@ to populate Your LDAP directory.

6. Coming soon

A browser-based administration toolkit, which connects directly -to the LDAP-directory service. Here is a screenshot +to the LDAP-directory service. +Here is a screenshot

7. To Do

diff --git a/Specfile b/Specfile index ebdc9bd..61c48ef 100644 --- a/Specfile +++ b/Specfile @@ -7,7 +7,6 @@ Release: %RELEASE% Copyright: GPL Group: Daemons/DNS Source: ldap2dns-%{version}.tar.gz -Source1: http://cr.yp.to/djbdns/%{djbdns}.tar.gz BuildRoot: /var/tmp/%{name}-root Requires: openldap @@ -24,17 +23,13 @@ ldap2dns is designed to write binary data.cdb files used by tinydns, but also ma used to write .db-files used by named. %prep -#%setup -a1 -q %setup %build -#make -C %{djbdns} -#make DJBDNSDIR="%{djbdns}" VERSION=%{version} RPM_OPT_FLAGS="$RPM_OPT_FLAGS" make VERSION=%{version} RPM_OPT_FLAGS="$RPM_OPT_FLAGS" %install [ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot} -#make DJBDNSDIR="%{djbdns}" INSTALL_PREFIX=$RPM_BUILD_ROOT install make INSTALL_PREFIX=$RPM_BUILD_ROOT install %clean diff --git a/TODO b/TODO deleted file mode 100644 index 9709902..0000000 --- a/TODO +++ /dev/null @@ -1,3 +0,0 @@ -- Use env-variable LDAP2DNS_UPDATE for update intervalls -- If connection to ldapserver fialed retry later - diff --git a/dns.schema b/dns.schema index ac6e3c6..f2a4a94 100644 --- a/dns.schema +++ b/dns.schema @@ -1,6 +1,6 @@ # schema for DNS data # include this file into Your slapd.conf for openldap-2.0.x -# $Id: dns.schema,v 1.4 2001/02/16 09:51:23 jrief Exp $ +# $Id: dns.schema,v 1.5 2001/05/08 07:00:06 jrief Exp $ attributetype ( 1.2.840.113556.1.17.1 NAME 'DNSzonename' @@ -99,7 +99,7 @@ objectclass ( 1.2.840.113556.1.17.21 NAME 'DNSzone' MUST ( objectclass $ cn ) MAY ( DNSdomainname $ DNSserial $ DNSrefresh $ DNSretry $ DNSexpire $ DNSminimum - $ DNSadminmailbox $ DNSzonemaster $ DNSzonetype $ DNSzoneclass $ DNSrrcount + $ DNSadminmailbox $ DNSzonemaster $ DNStype $ DNSclass $ DNSrrcount $ DNSttl $ DNStimestamp ) ) objectclass ( 1.2.840.113556.1.17.22 diff --git a/index.html b/index.html index 3c7d5b3..a6fb37e 100644 --- a/index.html +++ b/index.html @@ -27,6 +27,7 @@

Download

+ @@ -35,6 +36,7 @@ +
latestldap2dnsldap2dnsldap2dnsCHANGELOG
Versiontar.gzrpmsrpmReleased
0.1.1ldap2dns2000-Sep-19
0.1.2ldap2dns2000-Sep-22
0.2.0ldap2dnsldap2dnsldap2dns2000-Dec-14
0.2.2ldap2dnsldap2dnsldap2dns2001-Feb-16
0.2.3ldap2dnsldap2dnsldap2dns2001-Mar-23
0.2.4ldap2dnsldap2dnsldap2dns2001-May-08
diff --git a/ldap2dns.c b/ldap2dns.c index 7655a7f..1d2facb 100644 --- a/ldap2dns.c +++ b/ldap2dns.c @@ -1,6 +1,6 @@ /* * Create data from an LDAP directory service to be used for tinydns - * $Id: ldap2dns.c,v 1.27 2001/03/12 12:26:55 jrief Exp $ + * $Id: ldap2dns.c,v 1.28 2001/05/08 07:00:06 jrief Exp $ * Copyright 2000 by Jacob Rief * License: GPL version 2 or later. See http://www.fsf.org for details */ @@ -17,6 +17,7 @@ #define LDAP_CONF "/etc/openldap/ldap.conf" #define OUTPUT_DATA 1 #define OUTPUT_DB 2 +#define MAXHOSTS 10 static char tinydns_textfile[256]; static char tinydns_texttemp[256]; @@ -83,11 +84,12 @@ static struct { char searchbase[128]; char binddn[128]; - char hostname[128]; + char hostname[MAXHOSTS][128]; + int port[MAXHOSTS]; char password[128]; + int usedhosts; int is_daemon; int update_iv; - int port; unsigned int output; int verbose; char ldifname[128]; @@ -150,6 +152,31 @@ static void print_usage(void) printf(" -V\t\tprint version and exit\n\n"); } +static void parse_hosts(char* buf) +{ + int i, port, k; + char value[128], rest[512]; + + options.usedhosts = 0; + for (i = 0; i=2) { + strcpy(options.hostname[i], value); + options.port[i] = port; + options.usedhosts++; + if (k==2) + break; + buf = rest; + } else if ((k = sscanf(buf, "%128s %512[A-Za-z0-9 .:_+-]", value, rest))>=1) { + strcpy(options.hostname[i], value); + options.port[i] = LDAP_PORT; + options.usedhosts++; + if (k==1) + break; + buf = rest; + } else break; + } +} + static int parse_options() { extern char* optarg; @@ -160,19 +187,18 @@ static int parse_options() char* ev; strcpy(options.searchbase, ""); - strcpy(options.hostname, "localhost"); - options.port = LDAP_PORT; + strcpy(options.hostname[0], "localhost"); + options.port[0] = LDAP_PORT; if (ldap_conf = fopen(LDAP_CONF, "r")) { while(fgets(buf, 256, ldap_conf)!=0) { + int i; if (sscanf(buf, "BASE %128s", value)==1) strcpy(options.searchbase, value); - if (sscanf(buf, "HOST %128s:%d", value, &len)==2) { - strcpy(options.hostname, value); - options.port = len; - } else if (sscanf(buf, "HOST %128s", value)==1) - strcpy(options.hostname, value); + if (sscanf(buf, "HOST %512[A-Za-z0-9 .:_+-]", value)==1) + parse_hosts(value); if (sscanf(buf, "PORT %d", &len)==1) - options.port = len; + for (i = 0; i