8.2 bug when moving files around

Mark_Andrews at isc.org Mark_Andrews at isc.org
Thu Jun 3 02:54:13 UTC 1999


> i've stumbled across a bug in 8.2 in the following scenario.
> 
> i'm secondary for domains from site x.  so i use lines like the following
> in my config:
> 
> zone "foo.com" { type slave; file "x/foo.com"; masters { 192.168.1.1; }; };
> 
> the name of the site changes to y, so i change the config to reflect that:
> 
> zone "foo.com" { type slave; file "y/foo.com"; masters { 192.168.1.1; }; };
> 
> and then i rename the x subdir to y (since i have lots of domains).  i
> then do a reload and things seem fine.  eventually one of the domains changes
> ,
> and a named-xfer gets spit out like this:
> 
> named-xfer -z foo.com -f y/foo.com -i x/foo.com.ixfr.tmp -s 1 -C 1 -P 53 -T f
> oo.com.120 192.168.1.1 axfr
> 
> which generates a syslog message like this:
> 
> named-xfer[17894]: rename y/foo.com.0ZHiJb to x/foo.com.ixfr.tmp: No such fil
> e or directory
> 
> it looks like end_zone is calling validate_zone with a pre-existing
> structure, so validate_zone doesn't regenerate the ixfr_tmp field.
> which is probably because the whole method for reloading doesn't throw
> away old data before re-reading the config file.  it looks like a few
> other fields will get treated the same way in validate_zone.  i don't
> see a trivial fix, so i'll throw it out here.
> 
> is this one fixed in the mysterious 8.2.1?
> 
> 
	It is now:-)

	Mark

Index: ns_config.c
===================================================================
RCS file: /proj/cvs/isc/bind/src/bin/named/ns_config.c,v
retrieving revision 8.71
diff -c -r8.71 ns_config.c
*** ns_config.c	1999/05/14 18:00:07	8.71
--- ns_config.c	1999/06/03 02:42:31
***************
*** 541,556 ****
  			freestr(zp->z_source);
  			purge_zone(zp->z_origin, fcachetab, zp->z_class);
  		}
- 		if (zp->z_ixfr_base)
- 			freestr(zp->z_ixfr_base);
- 		if (zp->z_ixfr_tmp)
- 			freestr(zp->z_ixfr_tmp);
  		zp->z_source = new_zp->z_source;
  		new_zp->z_source = NULL;
  		zp->z_ixfr_base = new_zp->z_ixfr_base;
  		new_zp->z_ixfr_base = NULL;	
  		zp->z_ixfr_tmp = new_zp->z_ixfr_tmp;
  		new_zp->z_ixfr_tmp = NULL;	
  		ns_debug(ns_log_config, 1, "reloading hint zone");
  		(void) db_load(zp->z_source, zp->z_origin, zp, NULL,
  			       ISNOTIXFR);
--- 542,560 ----
  			freestr(zp->z_source);
  			purge_zone(zp->z_origin, fcachetab, zp->z_class);
  		}
  		zp->z_source = new_zp->z_source;
  		new_zp->z_source = NULL;
+ 
+ 		if (zp->z_ixfr_base)
+ 			freestr(zp->z_ixfr_base);
  		zp->z_ixfr_base = new_zp->z_ixfr_base;
  		new_zp->z_ixfr_base = NULL;	
+ 
+ 		if (zp->z_ixfr_tmp)
+ 			freestr(zp->z_ixfr_tmp);
  		zp->z_ixfr_tmp = new_zp->z_ixfr_tmp;
  		new_zp->z_ixfr_tmp = NULL;	
+ 
  		ns_debug(ns_log_config, 1, "reloading hint zone");
  		(void) db_load(zp->z_source, zp->z_origin, zp, NULL,
  			       ISNOTIXFR);
***************
*** 581,596 ****
  #endif /* BIND_UPDATE */
  		if (zp->z_source != NULL)
  			freestr(zp->z_source);
- 		if (zp->z_ixfr_base)
- 			freestr(zp->z_ixfr_base);
- 		if (zp->z_ixfr_tmp)
- 			freestr(zp->z_ixfr_tmp);
  		zp->z_source = new_zp->z_source;
  		new_zp->z_source = NULL;
  		zp->z_ixfr_base = new_zp->z_ixfr_base;
  		new_zp->z_ixfr_base = NULL;
  		zp->z_ixfr_tmp = new_zp->z_ixfr_tmp;
  		new_zp->z_ixfr_tmp = NULL;
  		zp->z_flags &= ~Z_AUTH;
  		ns_stopxfrs(zp);
  		purge_zone(zp->z_origin, hashtab, zp->z_class);
--- 585,603 ----
  #endif /* BIND_UPDATE */
  		if (zp->z_source != NULL)
  			freestr(zp->z_source);
  		zp->z_source = new_zp->z_source;
  		new_zp->z_source = NULL;
+ 
+ 		if (zp->z_ixfr_base != NULL)
+ 			freestr(zp->z_ixfr_base);
  		zp->z_ixfr_base = new_zp->z_ixfr_base;
  		new_zp->z_ixfr_base = NULL;
+ 
+ 		if (zp->z_ixfr_tmp != NULL)
+ 			freestr(zp->z_ixfr_tmp);
  		zp->z_ixfr_tmp = new_zp->z_ixfr_tmp;
  		new_zp->z_ixfr_tmp = NULL;
+ 
  		zp->z_flags &= ~Z_AUTH;
  		ns_stopxfrs(zp);
  		purge_zone(zp->z_origin, hashtab, zp->z_class);
***************
*** 680,693 ****
  			zp->z_source = new_zp->z_source;
  			new_zp->z_source = NULL;
  		}
! 		if (zp->z_ixfr_base == NULL) {
! 			zp->z_ixfr_base = new_zp->z_ixfr_base;
! 			new_zp->z_ixfr_base = NULL;
! 		}
! 		if (zp->z_ixfr_tmp == NULL) {
! 			zp->z_ixfr_tmp = new_zp->z_ixfr_tmp;
! 			new_zp->z_ixfr_tmp = NULL;
! 		}
  		if (!(zp->z_flags & Z_AUTH))
  			zoneinit(zp);
  #ifdef FORCED_RELOAD
--- 687,703 ----
  			zp->z_source = new_zp->z_source;
  			new_zp->z_source = NULL;
  		}
! 
! 		if (zp->z_ixfr_base != NULL)
! 			freestr(zp->z_ixfr_base);
! 		zp->z_ixfr_base = new_zp->z_ixfr_base;
! 		new_zp->z_ixfr_base = NULL;
! 
! 		if (zp->z_ixfr_tmp != NULL)
! 			freestr(zp->z_ixfr_tmp);
! 		zp->z_ixfr_tmp = new_zp->z_ixfr_tmp;
! 		new_zp->z_ixfr_tmp = NULL;
! 
  		if (!(zp->z_flags & Z_AUTH))
  			zoneinit(zp);
  #ifdef FORCED_RELOAD
-- 
Mark Andrews, Internet Software Consortium
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: marka at isc.org



More information about the bind-users mailing list