mirror of
https://github.com/bklang/ldap2dns.git
synced 2025-10-27 14:24:15 -04:00
Importing version 0.2.6
git-svn-id: https://svn.alkaloid.net/gpl/ldap2dns/trunk@6 06cd67b6-e706-0410-b29e-9de616bca6e9
This commit is contained in:
10
CHANGELOG
10
CHANGELOG
@@ -1,10 +1,14 @@
|
|||||||
Version 0.2.6 (next)
|
Version 0.2.7 (next)
|
||||||
+ Make ldap2dns behave like a secondary nameserver by storing
|
+ Make ldap2dns behave like a secondary nameserver by storing
|
||||||
the serial number, expire, refresh, retry and minimum values
|
the serial number, expire, refresh, retry and minimum values
|
||||||
in a record.
|
in a record.
|
||||||
+ Password to connect to LDAP now is invisible to ps.
|
|
||||||
|
|
||||||
Version 0.2.5 (latest)
|
Version 0.2.6 (latest)
|
||||||
|
+ Password passed with option -w now is invisible to 'ps'.
|
||||||
|
+ ldap2tinydns-conf now takes a parameter to specify to user under
|
||||||
|
which ldap2dns will be running.
|
||||||
|
|
||||||
|
Version 0.2.5
|
||||||
- Tested with OpenLDAP-2.0.
|
- Tested with OpenLDAP-2.0.
|
||||||
- Adopted dns.schema with official numbers.
|
- Adopted dns.schema with official numbers.
|
||||||
|
|
||||||
|
|||||||
4
Makefile
4
Makefile
@@ -1,5 +1,5 @@
|
|||||||
# $Id: Makefile,v 1.26 2001/06/27 15:16:10 jrief Exp $
|
# $Id: Makefile,v 1.27 2001/08/09 10:35:49 jrief Exp $
|
||||||
VERSION=0.2.5
|
VERSION=0.2.6
|
||||||
RELEASE=1
|
RELEASE=1
|
||||||
CC=gcc -O2
|
CC=gcc -O2
|
||||||
CFLAGS=$(INC) -DVERSION='"$(VERSION)"'
|
CFLAGS=$(INC) -DVERSION='"$(VERSION)"'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# schema for DNS data
|
# schema for DNS data
|
||||||
# include this file into Your slapd.conf for openldap-2.0.x
|
# include this file into Your slapd.conf for openldap-2.0.x
|
||||||
# $Id: dns.schema,v 1.7 2001/06/28 07:41:12 jrief Exp $
|
# $Id: dns.schema,v 1.8 2001/08/09 10:35:49 jrief Exp $
|
||||||
|
|
||||||
attributetype ( 1.3.6.1.4.1.7222.1.4.1
|
attributetype ( 1.3.6.1.4.1.7222.1.4.1
|
||||||
NAME 'DNSzonename'
|
NAME 'DNSzonename'
|
||||||
@@ -55,13 +55,13 @@ attributetype ( 1.3.6.1.4.1.7222.1.4.12
|
|||||||
NAME 'DNSipaddr'
|
NAME 'DNSipaddr'
|
||||||
EQUALITY numericStringMatch
|
EQUALITY numericStringMatch
|
||||||
SUBSTR numericStringSubstringsMatch
|
SUBSTR numericStringSubstringsMatch
|
||||||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.36 )
|
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{16} )
|
||||||
|
|
||||||
attributetype ( 1.3.6.1.4.1.7222.1.4.13
|
attributetype ( 1.3.6.1.4.1.7222.1.4.13
|
||||||
NAME 'DNScipaddr'
|
NAME 'DNScipaddr'
|
||||||
EQUALITY numericStringMatch
|
EQUALITY numericStringMatch
|
||||||
SUBSTR numericStringSubstringsMatch
|
SUBSTR numericStringSubstringsMatch
|
||||||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.36 )
|
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{16} )
|
||||||
|
|
||||||
attributetype ( 1.3.6.1.4.1.7222.1.4.14
|
attributetype ( 1.3.6.1.4.1.7222.1.4.14
|
||||||
NAME 'DNScname'
|
NAME 'DNScname'
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
<TR align=center><TD>0.2.3</TD><TD><A HREF="ldap2dns-0.2.3.tar.gz">ldap2dns</A></TD><TD><A HREF="ldap2dns-0.2.3-1.i386.rpm">ldap2dns</A></TD><TD><A HREF="ldap2dns-0.2.3-1.src.rpm">ldap2dns</A></TD><TD>2001-Mar-23</TD></TR>
|
<TR align=center><TD>0.2.3</TD><TD><A HREF="ldap2dns-0.2.3.tar.gz">ldap2dns</A></TD><TD><A HREF="ldap2dns-0.2.3-1.i386.rpm">ldap2dns</A></TD><TD><A HREF="ldap2dns-0.2.3-1.src.rpm">ldap2dns</A></TD><TD>2001-Mar-23</TD></TR>
|
||||||
<TR align=center><TD>0.2.4</TD><TD><A HREF="ldap2dns-0.2.4.tar.gz">ldap2dns</A></TD><TD><A HREF="ldap2dns-0.2.4-1.i386.rpm">ldap2dns</A></TD><TD><A HREF="ldap2dns-0.2.4-1.src.rpm">ldap2dns</A></TD><TD>2001-May-08</TD></TR>
|
<TR align=center><TD>0.2.4</TD><TD><A HREF="ldap2dns-0.2.4.tar.gz">ldap2dns</A></TD><TD><A HREF="ldap2dns-0.2.4-1.i386.rpm">ldap2dns</A></TD><TD><A HREF="ldap2dns-0.2.4-1.src.rpm">ldap2dns</A></TD><TD>2001-May-08</TD></TR>
|
||||||
<TR align=center><TD>0.2.5</TD><TD><A HREF="ldap2dns-0.2.5.tar.gz">ldap2dns</A></TD><TD><A HREF="ldap2dns-0.2.5-1.i386.rpm">ldap2dns</A></TD><TD><A HREF="ldap2dns-0.2.5-1.src.rpm">ldap2dns</A></TD><TD>2001-Jun-27</TD></TR>
|
<TR align=center><TD>0.2.5</TD><TD><A HREF="ldap2dns-0.2.5.tar.gz">ldap2dns</A></TD><TD><A HREF="ldap2dns-0.2.5-1.i386.rpm">ldap2dns</A></TD><TD><A HREF="ldap2dns-0.2.5-1.src.rpm">ldap2dns</A></TD><TD>2001-Jun-27</TD></TR>
|
||||||
|
<TR align=center><TD>0.2.6</TD><TD><A HREF="ldap2dns-0.2.6.tar.gz">ldap2dns</A></TD><TD><A HREF="ldap2dns-0.2.6-1.i386.rpm">ldap2dns</A></TD><TD><A HREF="ldap2dns-0.2.6-1.src.rpm">ldap2dns</A></TD><TD>2001-Aug-09</TD></TR>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
|
|
||||||
</BLOCKQUOTE>
|
</BLOCKQUOTE>
|
||||||
|
|||||||
24
ldap2dns.c
24
ldap2dns.c
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Create data from an LDAP directory service to be used for tinydns
|
* Create data from an LDAP directory service to be used for tinydns
|
||||||
* $Id: ldap2dns.c,v 1.29 2001/06/27 15:16:10 jrief Exp $
|
* $Id: ldap2dns.c,v 1.30 2001/08/09 10:35:49 jrief Exp $
|
||||||
* Copyright 2000 by Jacob Rief <jacob.rief@tiscover.com>
|
* Copyright 2000 by Jacob Rief <jacob.rief@tiscover.com>
|
||||||
* License: GPL version 2 or later. See http://www.fsf.org for details
|
* License: GPL version 2 or later. See http://www.fsf.org for details
|
||||||
*/
|
*/
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#define UPDATE_INTERVALL 59
|
#define UPDATE_INTERVALL 59
|
||||||
#define LDAP_CONF "/etc/openldap/ldap.conf"
|
#define LDAP_CONF "/etc/ldap.conf"
|
||||||
#define OUTPUT_DATA 1
|
#define OUTPUT_DATA 1
|
||||||
#define OUTPUT_DB 2
|
#define OUTPUT_DB 2
|
||||||
#define MAXHOSTS 10
|
#define MAXHOSTS 10
|
||||||
@@ -183,7 +183,7 @@ static int parse_options()
|
|||||||
extern int optind, opterr, optopt;
|
extern int optind, opterr, optopt;
|
||||||
char buf[256], value[128];
|
char buf[256], value[128];
|
||||||
int len;
|
int len;
|
||||||
FILE* ldap_conf;
|
FILE* ldap_conf,*fp;
|
||||||
char* ev;
|
char* ev;
|
||||||
|
|
||||||
strcpy(options.searchbase, "");
|
strcpy(options.searchbase, "");
|
||||||
@@ -199,6 +199,11 @@ static int parse_options()
|
|||||||
if (sscanf(buf, "PORT %d", &len)==1)
|
if (sscanf(buf, "PORT %d", &len)==1)
|
||||||
for (i = 0; i<MAXHOSTS; i++)
|
for (i = 0; i<MAXHOSTS; i++)
|
||||||
options.port[i] = len;
|
options.port[i] = len;
|
||||||
|
if (sscanf(buf, "BINDDN %128s", value)==1) {
|
||||||
|
strcpy(options.binddn, value);
|
||||||
|
if (sscanf(buf, "BINDPW %128s", value)==1)
|
||||||
|
strcpy(options.password, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fclose(ldap_conf);
|
fclose(ldap_conf);
|
||||||
}
|
}
|
||||||
@@ -212,8 +217,9 @@ static int parse_options()
|
|||||||
options.update_iv = 0;
|
options.update_iv = 0;
|
||||||
}
|
}
|
||||||
ev = getenv("LDAP2DNS_UPDATE");
|
ev = getenv("LDAP2DNS_UPDATE");
|
||||||
if (ev && sscanf(ev, "%d", &len)==1 && len>0)
|
if (ev && sscanf(ev, "%d", &len)==1 && len>0) {
|
||||||
options.update_iv = len;
|
options.update_iv = len;
|
||||||
|
}
|
||||||
options.output = 0;
|
options.output = 0;
|
||||||
ev = getenv("LDAP2DNS_OUTPUT");
|
ev = getenv("LDAP2DNS_OUTPUT");
|
||||||
if (ev) {
|
if (ev) {
|
||||||
@@ -222,11 +228,18 @@ static int parse_options()
|
|||||||
else if (strcmp(ev, "db")==0)
|
else if (strcmp(ev, "db")==0)
|
||||||
options.output = OUTPUT_DB;
|
options.output = OUTPUT_DB;
|
||||||
}
|
}
|
||||||
|
ev = getenv("LDAP2DNS_BINDDN");
|
||||||
|
if (ev) {
|
||||||
|
strncpy(options.binddn, ev, 128);
|
||||||
|
ev = getenv("LDAP2DNS_PASSWORD");
|
||||||
|
if (ev)
|
||||||
|
strncpy(options.password, ev, 128);
|
||||||
|
}
|
||||||
options.verbose = 0;
|
options.verbose = 0;
|
||||||
options.ldifname[0] = '\0';
|
options.ldifname[0] = '\0';
|
||||||
strcpy(options.password, "");
|
strcpy(options.password, "");
|
||||||
strcpy(options.exec_command, "");
|
strcpy(options.exec_command, "");
|
||||||
while ( (len = getopt(main_argc, main_argv, "b:D:e:h:o:p:u:Vw:v::L::"))>0 ) {
|
while ( (len = getopt(main_argc, main_argv, "b:D:e:h:o:p:u:V:v::w:L::"))>0 ) {
|
||||||
if (optarg && strlen(optarg)>127) {
|
if (optarg && strlen(optarg)>127) {
|
||||||
fprintf(stderr, "argument %s too long\n", optarg);
|
fprintf(stderr, "argument %s too long\n", optarg);
|
||||||
continue;
|
continue;
|
||||||
@@ -274,6 +287,7 @@ static int parse_options()
|
|||||||
exit(0);
|
exit(0);
|
||||||
case 'w':
|
case 'w':
|
||||||
strcpy(options.password, optarg);
|
strcpy(options.password, optarg);
|
||||||
|
memset(optarg, 'x', strlen(options.password));
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
strcpy(options.exec_command, optarg);
|
strcpy(options.exec_command, optarg);
|
||||||
|
|||||||
Reference in New Issue
Block a user