Re: isc_mem_get question/bug

2014-11-06 Thread Evan Hunt
On Fri, Nov 07, 2014 at 04:20:46AM +1100, Joshua Rogers wrote:
> > filenamelen += strlen(dsdir) + 1;
>
> The last line, "sprintf(filename, "%s/", dsdir);".
> Since "/" is also added to the buffer, doesn't that mean the buffer will
> be overflowed by one byte if the dsdir is full?

The allocated buffer size is "filenamelen + 1", which includes space for
"strlen(dsdir) + 1" if dsdir is not NULL.

The first "+ 1" is there to make room for a null terminator; the second
is there to make room for the slash.

-- 
Evan Hunt -- e...@isc.org
Internet Systems Consortium, Inc.
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: BIND 9.10 dlz(BDB): slow query times

2014-11-06 Thread Evan Hunt
On Fri, Nov 07, 2014 at 12:27:55AM +0800, ShanyiWan wrote:
> 10+ domains, 50 records,
> 
> Most of the query time in 1-3 seconds, is this normal?

DLZ is slow, but it's not that slow.  I would guess the delay you're
seeing is due to the time it takes to retrieve data from the berkeley
DB.  How long does it take to query the database directly?

Turning on minimal-responses reduces the number of database lookups
required for each query, which might help if the database is slow.  There
may also be a bdb mailing list that can recommend database optimizations.

-- 
Evan Hunt -- e...@isc.org
Internet Systems Consortium, Inc.
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


isc_mem_get question/bug

2014-11-06 Thread Joshua Rogers
Hi,

in dnssec-signzone.c, this code appears:

> filenamelen = strlen(prefix) + strlen(namestr);
> if (dsdir != NULL)   
> filenamelen += strlen(dsdir) + 1;
> filename = isc_mem_get(mctx, filenamelen + 1);
> if (filename == NULL)
> fatal("out of memory");
> if (dsdir != NULL)
> sprintf(filename, "%s/", dsdir);

The last line, "sprintf(filename, "%s/", dsdir);".
Since "/" is also added to the buffer, doesn't that mean the buffer will
be overflowed by one byte if the dsdir is full?


Thanks,
-- 
-- Joshua Rogers 



signature.asc
Description: OpenPGP digital signature
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

BIND 9.10 dlz(BDB): slow query times

2014-11-06 Thread ShanyiWan
# lsb_release -a 
LSB Version: 
:core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
 
Distributor ID: CentOS 
Description: CentOS release 5.8 (Final) 
Release: 5.8 
Codename: Final 
# named -V 
BIND 9.10.1  built by make with '--enable-threads' 
'--with-dlz-bdb=/usr/local/BerkeleyDB.5.1/' 
compiled by GCC 4.1.2 20080704 (Red Hat 4.1.2-52) 
using OpenSSL version: OpenSSL 0.9.8e-rhel5 01 Jul 2008 
using libxml2 version: 2.6.26

10+ domains, 50 records,

Most of the query time in 1-3 seconds, is this normal?


ShanyiWan
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users