named-xfer of a stub zone without a specified filename failed when running

without write permissions in (the chroot-ed) '/'.
Problem reported by <jason@couch.com>.
This commit is contained in:
ho 2001-02-04 15:24:01 +00:00
parent a0e3e58ba6
commit 4fbcb854ff
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,12 @@
--- named/ns_config.c.orig Sun Feb 4 16:04:24 2001
+++ named/ns_config.c Sun Feb 4 16:05:07 2001
@@ -634,7 +634,8 @@
* We will always transfer this zone again
* after a reload.
*/
- sprintf(buf, "NsTmp%ld.%d", (long)getpid(), tmpnum++);
+ sprintf(buf, "%s%ld.%d", _PATH_TMPXFERSTUB,
+ (long)getpid(), tmpnum++);
new_zp->z_source = savestr(buf, 1);
zp->z_flags |= Z_TMP_FILE;
} else

View File

@ -0,0 +1,19 @@
--- named/pathtemplate.h.orig Sun Feb 4 16:03:25 2001
+++ named/pathtemplate.h Sun Feb 4 16:03:03 2001
@@ -1,4 +1,4 @@
-/* $OpenBSD: patch-named_pathtemplate.h,v 1.1 2001/02/04 15:24:01 ho Exp $ */
+/* $OpenBSD: patch-named_pathtemplate.h,v 1.1 2001/02/04 15:24:01 ho Exp $ */
/*
* $ISC: pathtemplate.h,v 8.6 2000/04/21 06:54:15 vixie Exp $
*/
@@ -60,6 +60,10 @@
#ifndef _PATH_TMPXFER
#define _PATH_TMPXFER "%DESTTMP%/xfer.ddt.XXXXXX"
+#endif
+
+#ifndef _PATH_TMPXFERSTUB
+#define _PATH_TMPXFERSTUB "%DESTTMP%/NsTmp"
#endif
#ifndef _PATH_XFER