summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@herrb.eu>2017-03-01 20:28:34 +0100
committerAdam Jackson <ajax@redhat.com>2017-03-01 15:26:06 -0500
commit94c3454d9fdbcefb01042c5c9d88468d86dd4725 (patch)
treee1ff60c97bb438ad66fc415e59962971ae541cd7
parentb0298c02f0383760be899448fa666d0ea56f5d79 (diff)
Brown bag commit to fix 957e8d (arc4random_buf() support)
- typo in #ifdef check - also need to add AC_CHECK_FUNCS([arc4random_buf]) Reported-by Eric Engestrom. Thanks Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> (cherry picked from commit 386fbbe410a1168b724136e54cf3bd37fb64ad4e)
-rw-r--r--configure.ac1
-rw-r--r--os/auth.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 610de09b4..292694ba5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -226,6 +226,7 @@ AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup\
AM_CONDITIONAL(POLL, [test "x$ac_cv_func_poll" = "xyes"])
AC_CHECK_LIB([bsd], [arc4random_buf])
+AC_CHECK_FUNCS([arc4random_buf])
AC_CHECK_DECLS([program_invocation_short_name], [], [], [[#include <errno.h>]])
diff --git a/os/auth.c b/os/auth.c
index 41b625db5..c7b333ca2 100644
--- a/os/auth.c
+++ b/os/auth.c
@@ -305,7 +305,7 @@ GenerateAuthorization(unsigned name_length,
void
GenerateRandomData(int len, char *buf)
{
-#ifdef HAVE_ARC4RANDOMBUF
+#ifdef HAVE_ARC4RANDOM_BUF
arc4random_buf(buf, len);
#else
int fd;