- Added some patches to fix a memory leak in the bind backend

- Added a patch to fix a problem with the allow-axfr-ips option (host/32 netmask didn't work)
- Added an option to the configure dialog to compile the recursor
- Bumped PORTREVISION

PR:		59385
Submitted by:	tremere@cainites.net
This commit is contained in:
Dirk Meyer 2003-11-18 13:34:59 +00:00
parent abf0fa71b1
commit adaf6f04c5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=94261
14 changed files with 268 additions and 2 deletions

View file

@ -7,6 +7,7 @@
PORTNAME= powerdns
PORTVERSION= 2.9.12
PORTREVISION= 1
CATEGORIES= dns ipv6
MASTER_SITES= http://downloads.powerdns.com/releases/
DISTNAME= pdns-${PORTVERSION}

View file

@ -11,7 +11,7 @@ if [ "${POWERDNS_OPTIONS}" ]; then
else
dialog --title "configuration options" --clear \
--checklist "\n\
Please select desired options:" -1 -1 7 \
Please select desired options:" -1 -1 8 \
PostgreSQL "PostgreSQL driver" ON \
MySQL323 "MySQL 3.23 driver" OFF \
MySQL40 "MySQL 4.0 driver" OFF \
@ -19,6 +19,7 @@ MySQL41 "MySQL 4.1 driver" OFF \
OpenLDAP20 "OpenLDAP 2.0 backend" OFF \
OpenLDAP21 "OpenLDAP 2.1 backend" OFF \
OpenLDAP22 "OpenLDAP 2.2 backend" OFF \
Recursor "Build Recursor" OFF \
2> /tmp/checklist.tmp.$$
retval=$?
@ -70,6 +71,9 @@ while [ "$1" ]; do
echo WITH_LDAP=YES
echo LDAP_PORT?=net/openldap22-client
;;
\"Recursor\")
echo POWERDNS_WITH_RECURSOR=YES
;;
\"nothing\"|true)
;;
*)

View file

@ -0,0 +1,16 @@
--- pdns/backends/bind/bindbackend2.cc.orig Sat Oct 4 16:15:46 2003
+++ pdns/backends/bind/bindbackend2.cc Mon Nov 17 20:54:19 2003
@@ -61,11 +61,10 @@
d_loaded=false;
d_last_check=0;
d_checknow=false;
- d_rwlock=new pthread_rwlock_t;
d_status="Seen in bind configuration";
d_confcount=0;
- // cout<<"Generated a new bbdomaininfo: "<<(void*)d_rwlock<<"/"<<getpid()<<endl;
- pthread_rwlock_init(d_rwlock,0);
+ // cout<<"Generated a new bbdomaininfo: "<<d_rwlock<<"/"<<getpid()<<endl;
+ pthread_rwlock_init(&d_rwlock,0);
}
void BB2DomainInfo::setCheckInterval(time_t seconds)

View file

@ -0,0 +1,39 @@
--- pdns/backends/bind/bindbackend2.hh.orig Sun Sep 28 20:20:03 2003
+++ pdns/backends/bind/bindbackend2.hh Mon Nov 17 20:54:19 2003
@@ -58,21 +58,20 @@
bool tryRLock()
{
- // cout<<"[trylock!] "<<(void*)d_rwlock<<"/"<<getpid()<<endl;
- return pthread_rwlock_tryrdlock(d_rwlock)!=EBUSY;
+ // cout<<"[trylock!] "<<d_rwlock<<"/"<<getpid()<<endl;
+ return pthread_rwlock_tryrdlock(&d_rwlock)!=EBUSY;
}
void unlock()
{
- // cout<<"[unlock] "<<(void*)d_rwlock<<"/"<<getpid()<<endl;
- pthread_rwlock_unlock(d_rwlock);
+ // cout<<"[unlock] "<<d_rwlock<<"/"<<getpid()<<endl;
+ pthread_rwlock_unlock(&d_rwlock);
}
void lock()
{
- //cout<<"[writelock!] "<<(void*)d_rwlock<<"/"<<getpid()<<endl;
-
- pthread_rwlock_wrlock(d_rwlock);
+ // cout<<"[writelock!] "<<d_rwlock<<"/"<<getpid()<<endl;
+ pthread_rwlock_wrlock(&d_rwlock);
}
void setCheckInterval(time_t seconds);
@@ -81,7 +80,7 @@
time_t getCtime();
time_t d_checkinterval;
time_t d_lastcheck;
- pthread_rwlock_t *d_rwlock;
+ pthread_rwlock_t d_rwlock;
};

View file

@ -0,0 +1,16 @@
--- pdns/backends/bind/bindbackend.cc.orig Sat Aug 23 16:35:35 2003
+++ pdns/backends/bind/bindbackend.cc Mon Nov 17 20:54:19 2003
@@ -58,11 +58,10 @@
d_loaded=false;
d_last_check=0;
d_checknow=false;
- d_rwlock=new pthread_rwlock_t;
d_status="Seen in bind configuration";
d_confcount=0;
- //cout<<"Generated a new bbdomaininfo: "<<(void*)d_rwlock<<"/"<<getpid()<<endl;
- pthread_rwlock_init(d_rwlock,0);
+ //cout<<"Generated a new bbdomaininfo: "<<d_rwlock<<"/"<<getpid()<<endl;
+ pthread_rwlock_init(&d_rwlock,0);
}
void BBDomainInfo::setCheckInterval(time_t seconds)

View file

@ -0,0 +1,39 @@
--- pdns/backends/bind/bindbackend.hh.orig Sat Aug 23 16:35:35 2003
+++ pdns/backends/bind/bindbackend.hh Mon Nov 17 20:54:19 2003
@@ -58,21 +58,20 @@
bool tryRLock()
{
- // cout<<"[trylock!] "<<(void*)d_rwlock<<"/"<<getpid()<<endl;
- return pthread_rwlock_tryrdlock(d_rwlock)!=EBUSY;
+ // cout<<"[trylock!] "<<d_rwlock<<"/"<<getpid()<<endl;
+ return pthread_rwlock_tryrdlock(&d_rwlock)!=EBUSY;
}
void unlock()
{
- // cout<<"[unlock] "<<(void*)d_rwlock<<"/"<<getpid()<<endl;
- pthread_rwlock_unlock(d_rwlock);
+ // cout<<"[unlock] "<<d_rwlock<<"/"<<getpid()<<endl;
+ pthread_rwlock_unlock(&d_rwlock);
}
void lock()
{
- //cout<<"[writelock!] "<<(void*)d_rwlock<<"/"<<getpid()<<endl;
-
- pthread_rwlock_wrlock(d_rwlock);
+ // cout<<"[writelock!] "<<d_rwlock<<"/"<<getpid()<<endl;
+ pthread_rwlock_wrlock(&d_rwlock);
}
void setCheckInterval(time_t seconds);
@@ -80,7 +79,7 @@
time_t getCtime();
time_t d_checkinterval;
time_t d_lastcheck;
- pthread_rwlock_t *d_rwlock;
+ pthread_rwlock_t d_rwlock;
};

View file

@ -0,0 +1,18 @@
--- pdns/iputils.hh.orig Sat Aug 30 16:27:48 2003
+++ pdns/iputils.hh Mon Nov 10 17:27:02 2003
@@ -51,10 +51,13 @@
Netmask(const string &mask)
{
char *p;
- char bits=32;
+ u_int8_t bits=32;
+ d_mask=0xFFFFFFFF;
+
if((p=strchr(mask.c_str(),'/')))
- bits=atoi(p+1);
+ bits = (u_int8_t) atoi(p+1);
+ if( bits < 32 )
d_mask=~(0xFFFFFFFF>>bits);
struct in_addr a;

View file

@ -7,6 +7,7 @@
PORTNAME= powerdns
PORTVERSION= 2.9.12
PORTREVISION= 1
CATEGORIES= dns ipv6
MASTER_SITES= http://downloads.powerdns.com/releases/
DISTNAME= pdns-${PORTVERSION}

View file

@ -11,7 +11,7 @@ if [ "${POWERDNS_OPTIONS}" ]; then
else
dialog --title "configuration options" --clear \
--checklist "\n\
Please select desired options:" -1 -1 7 \
Please select desired options:" -1 -1 8 \
PostgreSQL "PostgreSQL driver" ON \
MySQL323 "MySQL 3.23 driver" OFF \
MySQL40 "MySQL 4.0 driver" OFF \
@ -19,6 +19,7 @@ MySQL41 "MySQL 4.1 driver" OFF \
OpenLDAP20 "OpenLDAP 2.0 backend" OFF \
OpenLDAP21 "OpenLDAP 2.1 backend" OFF \
OpenLDAP22 "OpenLDAP 2.2 backend" OFF \
Recursor "Build Recursor" OFF \
2> /tmp/checklist.tmp.$$
retval=$?
@ -70,6 +71,9 @@ while [ "$1" ]; do
echo WITH_LDAP=YES
echo LDAP_PORT?=net/openldap22-client
;;
\"Recursor\")
echo POWERDNS_WITH_RECURSOR=YES
;;
\"nothing\"|true)
;;
*)

View file

@ -0,0 +1,16 @@
--- pdns/backends/bind/bindbackend2.cc.orig Sat Oct 4 16:15:46 2003
+++ pdns/backends/bind/bindbackend2.cc Mon Nov 17 20:54:19 2003
@@ -61,11 +61,10 @@
d_loaded=false;
d_last_check=0;
d_checknow=false;
- d_rwlock=new pthread_rwlock_t;
d_status="Seen in bind configuration";
d_confcount=0;
- // cout<<"Generated a new bbdomaininfo: "<<(void*)d_rwlock<<"/"<<getpid()<<endl;
- pthread_rwlock_init(d_rwlock,0);
+ // cout<<"Generated a new bbdomaininfo: "<<d_rwlock<<"/"<<getpid()<<endl;
+ pthread_rwlock_init(&d_rwlock,0);
}
void BB2DomainInfo::setCheckInterval(time_t seconds)

View file

@ -0,0 +1,39 @@
--- pdns/backends/bind/bindbackend2.hh.orig Sun Sep 28 20:20:03 2003
+++ pdns/backends/bind/bindbackend2.hh Mon Nov 17 20:54:19 2003
@@ -58,21 +58,20 @@
bool tryRLock()
{
- // cout<<"[trylock!] "<<(void*)d_rwlock<<"/"<<getpid()<<endl;
- return pthread_rwlock_tryrdlock(d_rwlock)!=EBUSY;
+ // cout<<"[trylock!] "<<d_rwlock<<"/"<<getpid()<<endl;
+ return pthread_rwlock_tryrdlock(&d_rwlock)!=EBUSY;
}
void unlock()
{
- // cout<<"[unlock] "<<(void*)d_rwlock<<"/"<<getpid()<<endl;
- pthread_rwlock_unlock(d_rwlock);
+ // cout<<"[unlock] "<<d_rwlock<<"/"<<getpid()<<endl;
+ pthread_rwlock_unlock(&d_rwlock);
}
void lock()
{
- //cout<<"[writelock!] "<<(void*)d_rwlock<<"/"<<getpid()<<endl;
-
- pthread_rwlock_wrlock(d_rwlock);
+ // cout<<"[writelock!] "<<d_rwlock<<"/"<<getpid()<<endl;
+ pthread_rwlock_wrlock(&d_rwlock);
}
void setCheckInterval(time_t seconds);
@@ -81,7 +80,7 @@
time_t getCtime();
time_t d_checkinterval;
time_t d_lastcheck;
- pthread_rwlock_t *d_rwlock;
+ pthread_rwlock_t d_rwlock;
};

View file

@ -0,0 +1,16 @@
--- pdns/backends/bind/bindbackend.cc.orig Sat Aug 23 16:35:35 2003
+++ pdns/backends/bind/bindbackend.cc Mon Nov 17 20:54:19 2003
@@ -58,11 +58,10 @@
d_loaded=false;
d_last_check=0;
d_checknow=false;
- d_rwlock=new pthread_rwlock_t;
d_status="Seen in bind configuration";
d_confcount=0;
- //cout<<"Generated a new bbdomaininfo: "<<(void*)d_rwlock<<"/"<<getpid()<<endl;
- pthread_rwlock_init(d_rwlock,0);
+ //cout<<"Generated a new bbdomaininfo: "<<d_rwlock<<"/"<<getpid()<<endl;
+ pthread_rwlock_init(&d_rwlock,0);
}
void BBDomainInfo::setCheckInterval(time_t seconds)

View file

@ -0,0 +1,39 @@
--- pdns/backends/bind/bindbackend.hh.orig Sat Aug 23 16:35:35 2003
+++ pdns/backends/bind/bindbackend.hh Mon Nov 17 20:54:19 2003
@@ -58,21 +58,20 @@
bool tryRLock()
{
- // cout<<"[trylock!] "<<(void*)d_rwlock<<"/"<<getpid()<<endl;
- return pthread_rwlock_tryrdlock(d_rwlock)!=EBUSY;
+ // cout<<"[trylock!] "<<d_rwlock<<"/"<<getpid()<<endl;
+ return pthread_rwlock_tryrdlock(&d_rwlock)!=EBUSY;
}
void unlock()
{
- // cout<<"[unlock] "<<(void*)d_rwlock<<"/"<<getpid()<<endl;
- pthread_rwlock_unlock(d_rwlock);
+ // cout<<"[unlock] "<<d_rwlock<<"/"<<getpid()<<endl;
+ pthread_rwlock_unlock(&d_rwlock);
}
void lock()
{
- //cout<<"[writelock!] "<<(void*)d_rwlock<<"/"<<getpid()<<endl;
-
- pthread_rwlock_wrlock(d_rwlock);
+ // cout<<"[writelock!] "<<d_rwlock<<"/"<<getpid()<<endl;
+ pthread_rwlock_wrlock(&d_rwlock);
}
void setCheckInterval(time_t seconds);
@@ -80,7 +79,7 @@
time_t getCtime();
time_t d_checkinterval;
time_t d_lastcheck;
- pthread_rwlock_t *d_rwlock;
+ pthread_rwlock_t d_rwlock;
};

View file

@ -0,0 +1,18 @@
--- pdns/iputils.hh.orig Sat Aug 30 16:27:48 2003
+++ pdns/iputils.hh Mon Nov 10 17:27:02 2003
@@ -51,10 +51,13 @@
Netmask(const string &mask)
{
char *p;
- char bits=32;
+ u_int8_t bits=32;
+ d_mask=0xFFFFFFFF;
+
if((p=strchr(mask.c_str(),'/')))
- bits=atoi(p+1);
+ bits = (u_int8_t) atoi(p+1);
+ if( bits < 32 )
d_mask=~(0xFFFFFFFF>>bits);
struct in_addr a;