Your message dated Sun, 22 Oct 2017 13:19:11 +0200
with message-id
<1508671151.815349.1146906880.773a8...@webmail.messagingengine.com>
and subject line Closing bugs in old-old-stable bind9 versions
has caused the Debian Bug report #139129,
regarding kmh_include_d.diff patch - need feedback and code review
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
139129: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=139129
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: bind9
Version: 1:9.2.1-7
Severity: wishlist
Tags: patch
The attached UNTESTED PATCH (it builds, but is not thouroughly tested
YET) to ISC Bind 9.2.1 makes the named.conf "Include" directive able
to include a directory of files. This is to facilitate the
development of admin tools. Rather than needing to edit the
named.conf.local, they can simply drop a file into named.conf.d and
tell Bind to reload.
I submit this for your review and feedback, under the terms of the
BIND licence, with intention that it become part of Bind itself and of
the Debian packaged Bind9. I am not sure that it's entirely
"correct", and would like some feedback.
Do you folks think should it sort the files it includes or just pull
them in non-deterministic directory order the way it does now? I
figure that the files will likely be named after the zone they
configure, and that there's not really any logical reason why they
should be sorted. Any order dependant configuration can be included
explicitly or placed in named.conf.local perhaps?
Index: lib/isc/include/isc/file.h
===================================================================
RCS file: /var/cvs/debian/bind9/lib/isc/include/isc/file.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -u -r1.1.1.1 -r1.2
--- lib/isc/include/isc/file.h 16 Jul 2001 18:33:00 -0000 1.1.1.1
+++ lib/isc/include/isc/file.h 19 Jul 2002 08:53:47 -0000 1.2
@@ -179,6 +179,21 @@
* Return ISC_TRUE iff the given file name is absolute.
*/
+#ifdef KMH_INCLUDE_D
+isc_boolean_t
+isc_file_isdir(const char *filename);
+/*
+ * Return ISC_TRUE iff the given file is a directory.
+ */
+
+isc_boolean_t
+isc_file_isreg(const char *filename);
+/*
+ * Return ISC_TRUE iff the given file is a regular file.
+ * Uses "stat", not "lstat", so will follow symlinks on Unix.
+ */
+#endif /* KMH_INCLUDE_D */
+
isc_boolean_t
isc_file_iscurrentdir(const char *filename);
/*
Index: lib/isc/unix/file.c
===================================================================
RCS file: /var/cvs/debian/bind9/lib/isc/unix/file.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -u -r1.1.1.1 -r1.2
--- lib/isc/unix/file.c 16 Jul 2001 18:33:01 -0000 1.1.1.1
+++ lib/isc/unix/file.c 19 Jul 2002 08:53:48 -0000 1.2
@@ -255,6 +255,32 @@
return (ISC_TF(filename[0] == '/'));
}
+#ifdef KMH_INCLUDE_D
+isc_boolean_t
+isc_file_isdir(const char *filename) {
+ struct stat stats;
+
+ REQUIRE(filename != NULL);
+
+ if(file_stats(filename, &stats) != ISC_R_SUCCESS)
+ return ISC_FALSE;
+
+ return (ISC_TF(S_ISDIR(stats.st_mode)));
+}
+
+isc_boolean_t
+isc_file_isreg(const char *filename) {
+ struct stat stats;
+
+ REQUIRE(filename != NULL);
+
+ if(file_stats(filename, &stats) != ISC_R_SUCCESS)
+ return ISC_FALSE;
+
+ return (ISC_TF(S_ISREG(stats.st_mode)));
+}
+#endif /* KMH_INCLUDE_D */
+
isc_boolean_t
isc_file_iscurrentdir(const char *filename) {
REQUIRE(filename != NULL);
Index: lib/isc/win32/file.c
===================================================================
RCS file: /var/cvs/debian/bind9/lib/isc/win32/file.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -u -r1.1.1.1 -r1.2
--- lib/isc/win32/file.c 26 Mar 2002 00:55:11 -0000 1.1.1.1
+++ lib/isc/win32/file.c 19 Jul 2002 08:53:49 -0000 1.2
@@ -396,6 +396,35 @@
return (ISC_FALSE);
}
+#ifdef KMH_INCLUDE_D
+/* UNTESTED -- I don't do windows. (It might not even compile.)
+ * They should be identical to the Unix versions. -- karlheg
+ */
+isc_boolean_t
+isc_file_isdir(const char *filename) {
+ struct stat stats;
+
+ REQUIRE(filename != NULL);
+
+ if(file_stats(filename, &stats) != ISC_R_SUCCESS)
+ return ISC_FALSE;
+
+ return (ISC_TF(S_ISDIR(stats.st_mode)));
+}
+
+isc_boolean_t
+isc_file_isreg(const char *filename) {
+ struct stat stats;
+
+ REQUIRE(filename != NULL);
+
+ if(file_stats(filename, &stats) != ISC_R_SUCCESS)
+ return ISC_FALSE;
+
+ return (ISC_TF(S_ISREG(stats.st_mode)));
+}
+#endif /* KMH_INCLUDE_D */
+
isc_boolean_t
isc_file_iscurrentdir(const char *filename) {
REQUIRE(filename != NULL);
Index: lib/isccfg/parser.c
===================================================================
RCS file: /var/cvs/debian/bind9/lib/isccfg/parser.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -u -r1.1.1.1 -r1.2
--- lib/isccfg/parser.c 8 Feb 2002 03:57:47 -0000 1.1.1.1
+++ lib/isccfg/parser.c 19 Jul 2002 08:53:50 -0000 1.2
@@ -21,6 +21,9 @@
#include <isc/buffer.h>
#include <isc/dir.h>
+#ifdef KMH_INCLUDE_D
+# include <isc/file.h>
+#endif
#include <isc/formatcheck.h>
#include <isc/lex.h>
#include <isc/log.h>
@@ -2286,8 +2289,57 @@
*/
CHECK(parse(pctx, &cfg_type_qstring, &includename));
CHECK(parse_semicolon(pctx));
- CHECK(parser_openfile(pctx, includename->
- value.string.base));
+#ifdef KMH_INCLUDE_D
+ if(isc_file_isdir(includename->value.string.base)) {
+
+ /*
+ * It is recommended that "include" statements
always specify a
+ * full path to the file or directory you want
included since
+ * otherwise it will depend on what PWD is.
+ */
+
+ isc_dir_t dir;
+ char fullpath[ISC_DIR_PATHMAX];
+
+ isc_dir_init(&dir);
+ CHECK(isc_dir_open(&dir,
includename->value.string.base));
+ while(isc_dir_read(&dir) != ISC_R_NOMORE) {
+ /*
+ * FIXME: this is not quite right now,
is it? It should print a
+ * diagnostic error message about the
string being too long?
+ */
+ REQUIRE (ISC_DIR_PATHMAX >= strlen
(includename->value.string.base) + 1
+ + strlen (dir.entry.name) + 1);
+ strcpy (fullpath,
includename->value.string.base);
+ strcat (fullpath, "/");
+ strcat (fullpath, dir.entry.name);
+ /* Don't try to openfile a directory */
+ if( (!isc_file_isreg(fullpath))
+ /* dot or dot dot */
+ || !strncmp (dir.entry.name, "..", 2)
+ || !strncmp (dir.entry.name, ".", 1)
+ /* or an editor backup file */
+ || strstr(dir.entry.name, "~")
+ /* or somebody's dpkg'd or rpm'd
file backup */
+ || strstr(dir.entry.name,
".dpkg-dist")
+ || strstr(dir.entry.name,
".dpkg-new")
+ || strstr(dir.entry.name,
".dpkg-old")
+ || strstr(dir.entry.name, ".rpmorig")
+ || strstr(dir.entry.name, ".rpmsave")
+ || strstr(dir.entry.name, ".rpmnew"))
+ {
+ continue;
+ } else {
+ CHECK(parser_openfile(pctx,
fullpath));
+ }
+ }
+ } else {
+#endif /* KMH_INCLUDE_D */
+ CHECK(parser_openfile(pctx, includename->
+ value.string.base));
+#ifdef KMH_INCLUDE_D
+ }
+#endif /* KMH_INCLUDE_D */
cfg_obj_destroy(pctx, &includename);
goto redo;
}
--
No, one more time, I do NOT need your "leadership", sir.
Please just GET OUT OF MY WAY. .''`.
Debian -- The blue collar Linux distribution. : :' :
<URL:http://www.debian.org/social_contract> `. `'
--- End Message ---
--- Begin Message ---
Version: 1:9.10.3.dfsg.P4-12.3
Hi,
the bind9 bug list grew too much and the Debian BIND team cannot
simply test all the reported bugs against versions not in stable, so
this is mass bug close, as either the version is no longer relevant
(because of old-old-stable 9.8.x or old-stable 9.9.5 or even older
version of bind9) or the bug was already fixed.
However, if you can reproduce the bug with a current version in stable,
please use Debian BTS 'found <bug> <version_you_reproduced_the_issue>'
command to retag the bug and reopen it.
Cheers,
Ondrej
signature.asc
Description: PGP signature
--- End Message ---