Re: nsd 4.1.19

2018-01-26 Thread Florian Obser
On Fri, Jan 26, 2018 at 05:38:46PM +, Stuart Henderson wrote:
> On 2018/01/26 18:12, Florian Obser wrote:
> > anyone else?
> > Got around to read the diff, not too much insanity in there, going to
> > commit soon.
> 
> ok with me.
> 
> > diff --git nsd.c nsd.c
> > index f2cf6ccf0cb..dfbc58696b3 100644
> > --- nsd.c
> > +++ nsd.c
> > @@ -579,6 +579,7 @@ main(int argc, char *argv[])
> > case 'v':
> > version();
> > /* version exits */
> > +   break;
> >  #ifndef NDEBUG
> > case 'F':
> > sscanf(optarg, "%x", _debug_facilities);
> > @@ -980,6 +981,7 @@ main(int argc, char *argv[])
> > break;
> > case -1:
> > error("fork() failed: %s", strerror(errno));
> > +   break;
> > default:
> > /* Parent is done */
> > server_close_all_sockets(nsd.udp, nsd.ifs);
> 
> that gcc lint thing doesn't seem particularly clever if those are needed!
> 

Indeed, there is also some comment spam that's not relevant for us, I
left that in to not create conflicts for future updates.

I like this one :D

/** Fallthrough: AXFR over UDP queries are discarded. */
+   /* fallthrough */


I dropped this though:

+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"

Don't want to find out in two weeks time what gcc on the luna88k
thinks about that...

-- 
I'm not entirely sure you are real.



Re: nsd 4.1.19

2018-01-26 Thread Stuart Henderson
On 2018/01/26 18:12, Florian Obser wrote:
> anyone else?
> Got around to read the diff, not too much insanity in there, going to
> commit soon.

ok with me.

> diff --git nsd.c nsd.c
> index f2cf6ccf0cb..dfbc58696b3 100644
> --- nsd.c
> +++ nsd.c
> @@ -579,6 +579,7 @@ main(int argc, char *argv[])
>   case 'v':
>   version();
>   /* version exits */
> + break;
>  #ifndef NDEBUG
>   case 'F':
>   sscanf(optarg, "%x", _debug_facilities);
> @@ -980,6 +981,7 @@ main(int argc, char *argv[])
>   break;
>   case -1:
>   error("fork() failed: %s", strerror(errno));
> + break;
>   default:
>   /* Parent is done */
>   server_close_all_sockets(nsd.udp, nsd.ifs);

that gcc lint thing doesn't seem particularly clever if those are needed!



Re: nsd 4.1.19

2018-01-26 Thread Florian Obser
anyone else?
Got around to read the diff, not too much insanity in there, going to
commit soon.

rebased on top of millert@'s autohell fix:

diff --git Makefile.in Makefile.in
index 495160c0826..3468101c19d 100644
--- Makefile.in
+++ Makefile.in
@@ -286,9 +286,6 @@ qtest.o:$(srcdir)/tpkg/cutest/qtest.c
 udb-inspect.o: $(srcdir)/tpkg/cutest/udb-inspect.c
$(COMPILE) -c $(srcdir)/tpkg/cutest/udb-inspect.c
 
-xfr-inspect.o: $(srcdir)/tpkg/cutest/xfr-inspect.c
-   $(COMPILE) -c $(srcdir)/tpkg/cutest/xfr-inspect.c
-
 zlexer.c:  $(srcdir)/zlexer.lex
if test "$(LEX)" != ":"; then rm -f $@ ;\
echo '#include "config.h"' > $@ ;\
@@ -516,7 +513,7 @@ udb-inspect.o: $(srcdir)/tpkg/cutest/udb-inspect.c config.h 
$(srcdir)/udb.h $(sr
  $(srcdir)/udb.h $(srcdir)/udbzone.h $(srcdir)/dns.h $(srcdir)/udbradtree.h 
$(srcdir)/util.h $(srcdir)/buffer.h $(srcdir)/region-allocator.h \
  $(srcdir)/util.h $(srcdir)/packet.h $(srcdir)/namedb.h $(srcdir)/dname.h 
$(srcdir)/buffer.h $(srcdir)/radtree.h $(srcdir)/rbtree.h $(srcdir)/rdata.h \
  $(srcdir)/namedb.h $(srcdir)/difffile.h $(srcdir)/options.h config.h
-xfr-inspect.o: $(srcdir)/tpkg/cutest/xfr-inspect.c config.h 
$(srcdir)/udbzone.h $(srcdir)/udb.h $(srcdir)/dns.h \
+xfr-inspect.o: $(srcdir)/xfr-inspect.c config.h $(srcdir)/udbzone.h 
$(srcdir)/udb.h $(srcdir)/dns.h \
  $(srcdir)/udbradtree.h $(srcdir)/util.h $(srcdir)/buffer.h 
$(srcdir)/region-allocator.h $(srcdir)/util.h $(srcdir)/packet.h 
$(srcdir)/namedb.h \
  $(srcdir)/dname.h $(srcdir)/buffer.h $(srcdir)/radtree.h $(srcdir)/rbtree.h 
$(srcdir)/rdata.h $(srcdir)/namedb.h $(srcdir)/difffile.h \
  $(srcdir)/options.h config.h
diff --git axfr.c axfr.c
index 6f6b0957e99..dd34c0c3cee 100644
--- axfr.c
+++ axfr.c
@@ -201,6 +201,7 @@ answer_axfr_ixfr(struct nsd *nsd, struct query *q)
return query_axfr(nsd, q);
}
/** Fallthrough: AXFR over UDP queries are discarded. */
+   /* fallthrough */
case TYPE_IXFR:
RCODE_SET(q->packet, RCODE_IMPL);
return QUERY_PROCESSED;
diff --git config.h.in config.h.in
index 6c44616432f..3cc7d4e546d 100644
--- config.h.in
+++ config.h.in
@@ -73,6 +73,9 @@
 /* Define to 1 if you have the `endpwent' function. */
 #undef HAVE_ENDPWENT
 
+/* Define to 1 if you have the `ERR_load_crypto_strings' function. */
+#undef HAVE_ERR_LOAD_CRYPTO_STRINGS
+
 /* Define to 1 if you have the `event_base_free' function. */
 #undef HAVE_EVENT_BASE_FREE
 
@@ -88,6 +91,9 @@
 /* Define to 1 if you have the  header file. */
 #undef HAVE_EVENT_H
 
+/* Define to 1 if you have the `EVP_cleanup' function. */
+#undef HAVE_EVP_CLEANUP
+
 /* Define to 1 if you have the `ev_default_loop' function. */
 #undef HAVE_EV_DEFAULT_LOOP
 
@@ -194,6 +200,12 @@
 /* Define to 1 if you have the  header file. */
 #undef HAVE_OPENSSL_ERR_H
 
+/* Define to 1 if you have the `OPENSSL_init_crypto' function. */
+#undef HAVE_OPENSSL_INIT_CRYPTO
+
+/* Define to 1 if you have the `OPENSSL_init_ssl' function. */
+#undef HAVE_OPENSSL_INIT_SSL
+
 /* Define to 1 if you have the  header file. */
 #undef HAVE_OPENSSL_RAND_H
 
@@ -426,6 +438,9 @@
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
+/* Define this to use packed structure alignment. */
+#undef PACKED_STRUCTS
+
 /* Pathname to the NSD pidfile */
 #undef PIDFILE
 
@@ -483,6 +498,9 @@
 /* Define this to enable mmap instead of malloc. Experimental. */
 #undef USE_MMAP_ALLOC
 
+/* Define this to configure to use the radix tree. */
+#undef USE_RADIX_TREE
+
 /* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
@@ -659,6 +677,29 @@
 
 
 
+
+/* provide timespec def if not available */
+#ifndef CONFIG_DEFINES
+#define CONFIG_DEFINES
+#ifndef HAVE_STRUCT_TIMESPEC
+#ifndef __timespec_defined
+#define __timespec_defined 1
+   struct timespec {
+   longtv_sec; /* seconds */
+   longtv_nsec;/* nanoseconds */
+   };
+#endif /* !__timespec_defined */
+#endif /* !HAVE_STRUCT_TIMESPEC */
+#endif /* !CONFIG_DEFINES */
+
+#ifdef PACKED_STRUCTS
+#define ATTR_PACKED __attribute__((packed))
+#else
+#define ATTR_PACKED
+#endif
+
+
+
 #ifdef HAVE_VA_LIST_DOUBLE_DEF
 /* workaround double va_list definition on some platforms */
 #  ifndef _VA_LIST_DEFINED
@@ -736,13 +777,12 @@
 
 
 
-#ifndef HAVE_B64_NTOP
-int b64_ntop(uint8_t const *src, size_t srclength,
+int __b64_ntop(uint8_t const *src, size_t srclength,
 char *target, size_t targsize);
-#endif /* !HAVE_B64_NTOP */
-#ifndef HAVE_B64_PTON
-int b64_pton(char const *src, uint8_t *target, size_t targsize);
-#endif /* !HAVE_B64_PTON */
+int __b64_pton(char const *src, uint8_t *target, size_t targsize);
+
+
+
 #ifndef HAVE_FSEEKO
 #define fseeko fseek
 #define ftello ftell
@@ -800,22 +840,3 @@ int memcmp(const void *x, const void *y, size_t n);
 #endif
 
 
-
-
-
-/* provide timespec def if not available 

Re: nsd 4.1.19

2018-01-13 Thread Florian Obser
On Fri, Jan 12, 2018 at 11:28:48AM -0700, Todd C. Miller wrote:
> On Fri, 12 Jan 2018 18:20:58 +0100, Florian Obser wrote:
> 
> > so, here is 4.1.19. I haven't gotten around to reading the diff yet.
> > But I tossed it in production.
> >
> > When trying to re-gen config.h.in autheader bombs out:
> >
> > [florian@openbsd-build:/usr/src/usr.sbin/nsd]$ autoheader-2.69
> > autoheader-2.69: warning: missing template: HAVE_B64_NTOP
> > autoheader-2.69: Use AC_DEFINE([HAVE_B64_NTOP], [], [Description])
> > autoheader-2.69: warning: missing template: HAVE_B64_PTON
> 
> This will fix it.  I guess no one tried to re-run autoheader after
> the configure.ac changes.

Indeed. Please commit, OK florian

> 
>  - todd
> 
> --- configure.ac.orig Fri Jan 12 11:27:48 2018
> +++ configure.ac  Fri Jan 12 11:27:57 2018
> @@ -687,8 +687,8 @@
>   fi
>  fi
>  if test "x$found_b64_ntop" = xyes; then
> - AC_DEFINE(HAVE_B64_NTOP)
> - AC_DEFINE(HAVE_B64_PTON)
> + AC_DEFINE(HAVE_B64_NTOP, 1, [Define to 1 if you have the `b64_ntop' 
> function.])
> + AC_DEFINE(HAVE_B64_PTON, 1, [Define to 1 if you have the `b64_ntop' 
> function.])
>   AC_MSG_RESULT(yes)
>  else
>   AC_LIBOBJ([b64_ntop])
> 

-- 
I'm not entirely sure you are real.



Re: nsd 4.1.19

2018-01-12 Thread Todd C. Miller
On Fri, 12 Jan 2018 18:20:58 +0100, Florian Obser wrote:

> so, here is 4.1.19. I haven't gotten around to reading the diff yet.
> But I tossed it in production.

So far so good here.  A note to others, you'll need to "make cleandir"
in /usr/src/usr.sbin/nsd (or just remove /usr/obj/usr.sbin/nsd)
before rebuilding or you will get errors about ATTR_PACKED.

We may want to add a make rule to re-run configure when it changes
(or when config.h.in changes) to avoid this kind of problem.

 - todd



Re: nsd 4.1.19

2018-01-12 Thread Todd C. Miller
On Fri, 12 Jan 2018 18:20:58 +0100, Florian Obser wrote:

> so, here is 4.1.19. I haven't gotten around to reading the diff yet.
> But I tossed it in production.
>
> When trying to re-gen config.h.in autheader bombs out:
>
> [florian@openbsd-build:/usr/src/usr.sbin/nsd]$ autoheader-2.69
> autoheader-2.69: warning: missing template: HAVE_B64_NTOP
> autoheader-2.69: Use AC_DEFINE([HAVE_B64_NTOP], [], [Description])
> autoheader-2.69: warning: missing template: HAVE_B64_PTON

This will fix it.  I guess no one tried to re-run autoheader after
the configure.ac changes.

 - todd

--- configure.ac.orig   Fri Jan 12 11:27:48 2018
+++ configure.acFri Jan 12 11:27:57 2018
@@ -687,8 +687,8 @@
fi
 fi
 if test "x$found_b64_ntop" = xyes; then
-   AC_DEFINE(HAVE_B64_NTOP)
-   AC_DEFINE(HAVE_B64_PTON)
+   AC_DEFINE(HAVE_B64_NTOP, 1, [Define to 1 if you have the `b64_ntop' 
function.])
+   AC_DEFINE(HAVE_B64_PTON, 1, [Define to 1 if you have the `b64_ntop' 
function.])
AC_MSG_RESULT(yes)
 else
AC_LIBOBJ([b64_ntop])



Re: nsd 4.1.19

2018-01-12 Thread Florian Obser

Oh and yes, that packed BS is completely retarded.

Seeing how many commits it took to have it not constantly spass out on
different compilers, it's amazing that someone didn't take the hint and
gave up on it. No idea what the usecase is suppsed to be.

-- 
I'm not entirely sure you are real.