Re: Dropbear Digest, Vol 171, Issue 1

2020-06-22 Thread Laurent Bercot

I can't compile DB 2020.79 with uClibc-ng (1.0.32, looking at the 1.0.34 sources nothing has 
changed) unless I add "#define _GNU_SOURCE" on top of "dbrandom.c" (it is 
required by sys/random.h, line 11 
https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/libc/sysdeps/linux/common/sys/random.h).

The alternative is to #include  manually.
Which is best?


 The former is best. Or, you could simply compile dropbear with
-D_GNU_SOURCE in your CFLAGS.

 Never directly include Linux kernel headers in your application code
if you can avoid it (because it requires careful namespace manipulation
and not all kernel headers are suitable for this, so it can be the
beginning of a looong chain of problems).

--
 Laurent



Re: Dropbear Digest, Vol 171, Issue 1

2020-06-22 Thread Nik Soggia

Il 16/06/20 06:00, dropbear-requ...@ucc.asn.au ha scritto:


Dropbear 2020.79 is now released.


Hello,
I can't compile DB 2020.79 with uClibc-ng (1.0.32, looking at the 1.0.34 sources nothing has 
changed) unless I add "#define _GNU_SOURCE" on top of "dbrandom.c" (it is 
required by sys/random.h, line 11 
https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/libc/sysdeps/linux/common/sys/random.h).

The alternative is to #include  manually.
Which is best?
Cheers

diff -Naubr dropbear-2020.79.old/config.h.in dropbear-2020.79.new/config.h.in
--- dropbear-2020.79.old/config.h.in2020-06-15 17:38:40.0 +0200
+++ dropbear-2020.79.new/config.h.in2020-06-22 12:31:03.0 +0200
@@ -162,6 +162,9 @@
 /* Define to 1 if you have the  header file. */
 #undef HAVE_LINUX_PKT_SCHED_H
 
+/* Define to 1 if you have the  header file. */

+#undef HAVE_LINUX_RANDOM_H
+
 /* Have login() function */
 #undef HAVE_LOGIN
 
diff -Naubr dropbear-2020.79.old/configure.ac dropbear-2020.79.new/configure.ac

--- dropbear-2020.79.old/configure.ac   2020-06-15 17:38:08.0 +0200
+++ dropbear-2020.79.new/configure.ac   2020-06-22 12:31:03.0 +0200
@@ -371,7 +371,7 @@
pty.h libutil.h libgen.h inttypes.h stropts.h utmp.h \
utmpx.h lastlog.h paths.h util.h netdb.h security/pam_appl.h \
pam/pam_appl.h netinet/in_systm.h sys/uio.h linux/pkt_sched.h \
-   sys/random.h])
+   sys/random.h linux/random.h])
 
 # Checks for typedefs, structures, and compiler characteristics.

 AC_C_CONST
diff -Naubr dropbear-2020.79.old/includes.h dropbear-2020.79.new/includes.h
--- dropbear-2020.79.old/includes.h 2020-06-15 17:38:08.0 +0200
+++ dropbear-2020.79.new/includes.h 2020-06-22 12:31:03.0 +0200
@@ -127,6 +127,9 @@
 #ifdef HAVE_SYS_RANDOM_H
 #include 
 #endif
+#ifdef HAVE_LINUX_RANDOM_H
+#include 
+#endif
 
 #ifdef BUNDLED_LIBTOM

 #include "libtomcrypt/src/headers/tomcrypt.h"
diff -Naubr dropbear-2020.79.old/configure dropbear-2020.79.new/configure
--- dropbear-2020.79.old/configure  2020-06-15 17:38:40.0 +0200
+++ dropbear-2020.79.new/configure  2020-06-22 12:31:03.0 +0200
@@ -5685,7 +5685,7 @@
pty.h libutil.h libgen.h inttypes.h stropts.h utmp.h \
utmpx.h lastlog.h paths.h util.h netdb.h security/pam_appl.h \
pam/pam_appl.h netinet/in_systm.h sys/uio.h linux/pkt_sched.h \
-   sys/random.h
+   sys/random.h linux/random.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" 
"$ac_includes_default"


--
/\/ / /-<