summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJirka Hladky <jhladky@redhat.com>2020-05-11 19:17:03 +0200
committerJirka Hladky <jhladky@redhat.com>2020-05-11 19:17:03 +0200
commit193b3320bbe98cbecd465c87a8116f6047c66fa6 (patch)
treeae0c5d69afb48fd8787fe959498b08a8a3511f5a
parenthttps://github.com/jirka-h/haveged/issues/25 (diff)
downloadhaveged-193b3320bbe98cbecd465c87a8116f6047c66fa6.tar.xz
haveged-193b3320bbe98cbecd465c87a8116f6047c66fa6.zip
Fixed https://github.com/jirka-h/haveged/issues/29
-rw-r--r--NEWS2
-rwxr-xr-xconfigure22
-rw-r--r--configure.ac2
-rw-r--r--init.d/sysv.redhat2
-rw-r--r--src/havege.c1
-rw-r--r--src/havege.h3
-rw-r--r--src/havegecmd.c1
-rw-r--r--src/havegecmd.h1
-rw-r--r--src/havegecollect.c1
-rw-r--r--src/havegecollect.h1
-rw-r--r--src/haveged.c49
-rw-r--r--src/haveged.h1
-rw-r--r--src/havegetest.c1
-rw-r--r--src/havegetest.h1
-rw-r--r--src/havegetune.c1
-rw-r--r--src/havegetune.h1
-rw-r--r--src/oneiteration.h1
17 files changed, 59 insertions, 32 deletions
diff --git a/NEWS b/NEWS
index 07c9e37..70a8ea1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-v1.9.8 (Sep 30, 2018)
+v1.9.8 (Sep 30, 2019)
* Various bug fixes - please see ChangeLog for the detailed list of changes
v1.9.5 (Aug 11, 2018)
diff --git a/configure b/configure
index c1f0c11..1562e81 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for haveged 1.9.8.
+# Generated by GNU Autoconf 2.69 for haveged 1.9.9.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='haveged'
PACKAGE_TARNAME='haveged'
-PACKAGE_VERSION='1.9.8'
-PACKAGE_STRING='haveged 1.9.8'
+PACKAGE_VERSION='1.9.9'
+PACKAGE_STRING='haveged 1.9.9'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1326,7 +1326,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures haveged 1.9.8 to adapt to many kinds of systems.
+\`configure' configures haveged 1.9.9 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1396,7 +1396,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of haveged 1.9.8:";;
+ short | recursive ) echo "Configuration of haveged 1.9.9:";;
esac
cat <<\_ACEOF
@@ -1515,7 +1515,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-haveged configure 1.9.8
+haveged configure 1.9.9
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1934,7 +1934,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by haveged $as_me 1.9.8, which was
+It was created by haveged $as_me 1.9.9, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -4106,7 +4106,7 @@ fi
# Define the identity of the package.
PACKAGE='haveged'
- VERSION='1.9.8'
+ VERSION='1.9.9'
cat >>confdefs.h <<_ACEOF
@@ -11950,7 +11950,7 @@ fi
-HAVEGE_LT_VERSION="1:1:0"
+HAVEGE_LT_VERSION="2:0:0"
cat >>confdefs.h <<_ACEOF
@@ -13979,7 +13979,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by haveged $as_me 1.9.8, which was
+This file was extended by haveged $as_me 1.9.9, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -14045,7 +14045,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-haveged config.status 1.9.8
+haveged config.status 1.9.9
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index a76e25a..5e9372c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
## Minimum Autoconf version
AC_PREREQ([2.59])
-AC_INIT([haveged],[1.9.8])
+AC_INIT([haveged],[1.9.9])
AC_CONFIG_AUX_DIR(config)
AC_USE_SYSTEM_EXTENSIONS
AC_CONFIG_HEADER([config.h])
diff --git a/init.d/sysv.redhat b/init.d/sysv.redhat
index 1081138..30dee79 100644
--- a/init.d/sysv.redhat
+++ b/init.d/sysv.redhat
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright 2011-2012 Jirka Hladky hladky_dot_jiri_at_gmail_com
+# Copyright 2011-2020 Jirka Hladky hladky DOT jiri AT gmail DOT com
# Copyright 2011-2012 Gary Wuertz gary@issiweb.com
#
# This program is free software: you can redistribute it and/or modify
diff --git a/src/havege.c b/src/havege.c
index 6710458..a75f5e7 100644
--- a/src/havege.c
+++ b/src/havege.c
@@ -1,6 +1,7 @@
/**
** Simple entropy harvester based upon the havege RNG
**
+ ** Copyright 2018-2020 Jirka Hladky hladky DOT jiri AT gmail DOT com
** Copyright 2009-2014 Gary Wuertz gary@issiweb.com
** Copyright 2011-2012 BenEleventh Consulting manolson@beneleventh.com
**
diff --git a/src/havege.h b/src/havege.h
index 35bda94..46eccf2 100644
--- a/src/havege.h
+++ b/src/havege.h
@@ -1,6 +1,7 @@
/**
** Simple entropy harvester based upon the havege RNG
**
+ ** Copyright 2018-2020 Jirka Hladky hladky DOT jiri AT gmail DOT com
** Copyright 2009-2014 Gary Wuertz gary@issiweb.com
** Copyright 2011-2012 BenEleventh Consulting manolson@beneleventh.com
**
@@ -30,7 +31,7 @@ extern "C" {
* header/package version as a numeric major, minor, patch triple. See havege_version()
* below for useage.
*/
-#define HAVEGE_PREP_VERSION "1.9.8"
+#define HAVEGE_PREP_VERSION "1.9.9"
/**
* Basic types
*/
diff --git a/src/havegecmd.c b/src/havegecmd.c
index d38a101..b691c29 100644
--- a/src/havegecmd.c
+++ b/src/havegecmd.c
@@ -1,6 +1,7 @@
/**
** Provide HAVEGE socket communication API
**
+ ** Copyright 2018-2020 Jirka Hladky hladky DOT jiri AT gmail DOT com
** Copyright 2018 Werner Fink <werner@suse.de>
**
** This program is free software: you can redistribute it and/or modify
diff --git a/src/havegecmd.h b/src/havegecmd.h
index e928265..997c5d1 100644
--- a/src/havegecmd.h
+++ b/src/havegecmd.h
@@ -1,6 +1,7 @@
/**
** Provide HAVEGE socket communication API
**
+ ** Copyright 2018-2020 Jirka Hladky hladky DOT jiri AT gmail DOT com
** Copyright 2018 Werner Fink <werner@suse.de>
**
** This program is free software: you can redistribute it and/or modify
diff --git a/src/havegecollect.c b/src/havegecollect.c
index eb57447..02831b8 100644
--- a/src/havegecollect.c
+++ b/src/havegecollect.c
@@ -1,6 +1,7 @@
/**
** Simple entropy harvester based upon the havege RNG
**
+ ** Copyright 2018-2020 Jirka Hladky hladky DOT jiri AT gmail DOT com
** Copyright 2009-2014 Gary Wuertz gary@issiweb.com
** Copyright 2011-2012 BenEleventh Consulting manolson@beneleventh.com
**
diff --git a/src/havegecollect.h b/src/havegecollect.h
index 6259862..822e122 100644
--- a/src/havegecollect.h
+++ b/src/havegecollect.h
@@ -1,6 +1,7 @@
/**
** Simple entropy harvester based upon the havege RNG
**
+ ** Copyright 2018-2020 Jirka Hladky hladky DOT jiri AT gmail DOT com
** Copyright 2009-2014 Gary Wuertz gary@issiweb.com
** Copyright 2011-2012 BenEleventh Consulting manolson@beneleventh.com
**
diff --git a/src/haveged.c b/src/haveged.c
index 4d05fdb..53f71df 100644
--- a/src/haveged.c
+++ b/src/haveged.c
@@ -1,6 +1,7 @@
/**
** Simple entropy harvester based upon the havege RNG
**
+ ** Copyright 2018-2020 Jirka Hladky hladky DOT jiri AT gmail DOT com
** Copyright 2009-2014 Gary Wuertz gary@issiweb.com
** Copyright 2011-2012 BenEleventh Consulting manolson@beneleventh.com
**
@@ -384,12 +385,17 @@ int main(int argc, char **argv)
else {
socket_fd = cmd_listen(params);
if (socket_fd >= 0)
- fprintf(stderr, "%s: listening socket at %d\n", params->daemon, socket_fd);
- else if (socket_fd == -2)
- fprintf(stderr, "%s: command socket already in use\n", params->daemon);
- else
- fprintf(stderr, "%s: can not initialize command socket: %m\n", params->daemon);
+ fprintf(stderr, "%s: command socket is listening at fd %d\n", params->daemon, socket_fd);
+ else {
+ if (socket_fd == -2) {
+ fprintf(stderr, "%s: command socket already in use\n", params->daemon);
+ fprintf(stderr, "%s: please check if there is another instance of haveged running\n", params->daemon);
+ fprintf(stderr, "%s: disabling command mode for this instance\n", params->daemon);
+ } else {
+ fprintf(stderr, "%s: can not initialize command socket: %m\n", params->daemon);
+ }
}
+ }
#endif
if (params->tests_config == 0)
params->tests_config = (0 != (params->setup & RUN_AS_APP))? TESTS_DEFAULT_APP : TESTS_DEFAULT_RUN;
@@ -576,27 +582,36 @@ static void run_daemon( /* RETURN: nothing */
FD_ZERO(&write_fd);
#ifndef NO_COMMAND_MODE
- FD_ZERO(&read_fd);
+ if (socket_fd >= 0) {
+ FD_ZERO(&read_fd);
+ }
#endif
FD_SET(random_fd, &write_fd);
if (random_fd > max)
max = random_fd;
#ifndef NO_COMMAND_MODE
- FD_SET(socket_fd, &read_fd);
- if (socket_fd > max)
- max = socket_fd;
- if (conn_fd >= 0) {
- FD_SET(conn_fd, &read_fd);
- if (conn_fd > max)
- max = conn_fd;
- }
+ if (socket_fd >= 0) {
+ FD_SET(socket_fd, &read_fd);
+ if (socket_fd > max)
+ max = socket_fd;
+ if (conn_fd >= 0) {
+ FD_SET(conn_fd, &read_fd);
+ if (conn_fd > max)
+ max = conn_fd;
+ }
+ }
#endif
for(;;) {
struct timespec two = {2, 0};
+ int rc;
#ifndef NO_COMMAND_MODE
- int rc = pselect(max+1, &read_fd, &write_fd, NULL, &two, &omask);
+ if (socket_fd >= 0) {
+ rc = pselect(max+1, &read_fd, &write_fd, NULL, &two, &omask);
+ } else {
+ rc = pselect(max+1, NULL, &write_fd, NULL, &two, &omask);
+ }
#else
- int rc = pselect(max+1, NULL, &write_fd, NULL, &two, &omask);
+ rc = pselect(max+1, NULL, &write_fd, NULL, &two, &omask);
#endif
if (rc >= 0) break;
if (params->exit_code > 128)
@@ -608,7 +623,7 @@ static void run_daemon( /* RETURN: nothing */
continue;
#ifndef NO_COMMAND_MODE
- if (FD_ISSET(socket_fd, &read_fd) && conn_fd < 0) {
+ if ( socket_fd >= 0 && FD_ISSET(socket_fd, &read_fd) && conn_fd < 0) {
# ifdef HAVE_ACCEPT4
conn_fd = accept4(socket_fd, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK);
if (conn_fd < 0 && (errno == ENOSYS || errno == ENOTSUP)) {
diff --git a/src/haveged.h b/src/haveged.h
index 10cb3ad..9b1efaf 100644
--- a/src/haveged.h
+++ b/src/haveged.h
@@ -1,6 +1,7 @@
/**
** Simple entropy harvester based upon the havege RNG
**
+ ** Copyright 2018-2020 Jirka Hladky hladky DOT jiri AT gmail DOT com
** Copyright 2009-2014 Gary Wuertz gary@issiweb.com
**
** This program is free software: you can redistribute it and/or modify
diff --git a/src/havegetest.c b/src/havegetest.c
index 8cbb89a..8b423fb 100644
--- a/src/havegetest.c
+++ b/src/havegetest.c
@@ -1,6 +1,7 @@
/**
** Simple entropy harvester based upon the havege RNG
**
+ ** Copyright 2018-2020 Jirka Hladky hladky DOT jiri AT gmail DOT com
** Copyright 2012-2014 Gary Wuertz gary@issiweb.com
** Copyright 2012 BenEleventh Consulting manolson@beneleventh.com
**
diff --git a/src/havegetest.h b/src/havegetest.h
index cd9de4b..a58d9c0 100644
--- a/src/havegetest.h
+++ b/src/havegetest.h
@@ -1,6 +1,7 @@
/**
** Simple entropy harvester based upon the havege RNG
**
+ ** Copyright 2018-2020 Jirka Hladky hladky DOT jiri AT gmail DOT com
** Copyright 2012-2014 Gary Wuertz gary@issiweb.com
** Copyright 2012 BenEleventh Consulting manolson@beneleventh.com
**
diff --git a/src/havegetune.c b/src/havegetune.c
index 6f14476..19d3965 100644
--- a/src/havegetune.c
+++ b/src/havegetune.c
@@ -1,6 +1,7 @@
/**
** Determine HAVEGE environment
**
+ ** Copyright 2018-2020 Jirka Hladky hladky DOT jiri AT gmail DOT com
** Copyright 2009-2014 Gary Wuertz gary@issiweb.com
** Copyright 2011-2012 BenEleventh Consulting manolson@beneleventh.com
**
diff --git a/src/havegetune.h b/src/havegetune.h
index b4063e3..68e7232 100644
--- a/src/havegetune.h
+++ b/src/havegetune.h
@@ -1,6 +1,7 @@
/**
** Simple entropy harvester based upon the havege RNG
**
+ ** Copyright 2018-2020 Jirka Hladky hladky DOT jiri AT gmail DOT com
** Copyright 2009-2014 Gary Wuertz gary@issiweb.com
**
** This program is free software: you can redistribute it and/or modify
diff --git a/src/oneiteration.h b/src/oneiteration.h
index 0ffc246..298c3f4 100644
--- a/src/oneiteration.h
+++ b/src/oneiteration.h
@@ -1,6 +1,7 @@
/**
** Simple entropy harvester based upon the havege RNG
**
+ ** Copyright 2018-2020 Jirka Hladky hladky DOT jiri AT gmail DOT com
** Copyright 2009-2013 Gary Wuertz gary@issiweb.com
**
** This program is free software: you can redistribute it and/or modify