Bind 9 / chroot problems

Mark_Andrews at isc.org Mark_Andrews at isc.org
Tue Jan 1 00:02:30 UTC 2002


> I've been doodling around with Bind 9.2.0 trying to get it
> working on FreeBSD 4.4 stable.  As a matter of fact I've
> spent so much time playing around with it, I decided to
> create a document describing all the steps.
> 
> Just when I thought I had done everything perfectly, I discover
> various problems.  First of all it claims it can't find the
> conf file, although the path it says it can't read from is the
> one where it is.  This is the identical problem described on
> 10/30 by Anand R (URL wrapped):
> 
> http://groups.google.com/groups?selm=9rm48d%24ol3%40pub3.rc.
> vix.com&output=gplain
> 
> I originally specified the --sysconfdir and --localstatedir as the
> full actual path as arguments to ./configure.  So I tried re-
> compiling with just the relative paths to the chroot jail, but
> it didn't help.  I still have to specify -c <relative path> on 
> the command-line so it will launch at all.

	Well given that you havn't actually given any hard details
	it's hard to say what you have done wrong.

	If you don't try and change the locations named will look
	for the config file in <chrootdir>/etc/named.conf.

> 
> The next problem is that I need to generate a rndc-key file, but
> the rndc-confgen program dumps core on me.  It seems to create a
> file in the chroot jail, but not in /etc/namedb which I gather
> it is supposed to do when I call it this way:
> 
> rndc-confgen -a -u bind -t /var/chroot/named
> 
> It reports "..pid 1234 (rndc-confgen), uid 0: exited on signal
> 6 (core dumped)"

	It's a bug.

1144.   [bug]           rndc-confgen would crash if both the -a and -t
                        options were specified. [RT #2159]

Index: bind9/bin/rndc/rndc-confgen.c
diff -u bind9/bin/rndc/rndc-confgen.c:1.12 bind9/bin/rndc/rndc-confgen.c:1.13
--- bind9/bin/rndc/rndc-confgen.c:1.12	Tue Nov 27 12:59:52 2001
+++ bind9/bin/rndc/rndc-confgen.c	Wed Nov 28 13:44:19 2001
@@ -280,8 +280,9 @@
 			char *buf;
 			len = strlen(chrootdir) + strlen(keyfile) + 2;
 			buf = isc_mem_get(mctx, len);
-			if (buf != NULL) {
-				fprintf(stderr, "isc_mem_get(%d) failed\n", len);
+			if (buf == NULL) {
+				fprintf(stderr, "isc_mem_get(%d) failed\n",
+					len);
 				goto cleanup;
 			}
 			snprintf(buf, len, "%s/%s", chrootdir, keyfile);

	Mark
> 
> 
> Anyone have any helpful hints here?
> 
> TIA,
> 
> Phil
> 
> 
> -- 
> Philip J. Koenig         The Electric Kahuna Organization       [anti-spammed
> ]
> ----------------Computers & Communications for the New Millennium------------
> -
> * To send email, remove numbers and spaces:  pjkunet64 @  ekahuna27 . com    
> *
> *           Email Blacklists: stop using innocent users as pawns.            
> *
> * Simple answers are for simple minds.  Try a new way of looking at things.  
> *
> 
--
Mark Andrews, Internet Software Consortium
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: Mark.Andrews at isc.org


More information about the bind-users mailing list