diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-03-24 22:07:16 -0600 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2022-03-26 19:16:27 -0500 |
commit | 076c2552aeff88a27fe275dfaae61dedf4bb4bd5 (patch) | |
tree | ff7a18f569e7b433486a67c982f16194f35eb975 /src/rc/Makefile | |
parent | 270e5c6828577e50830fd3b5662f2b3ec4fb6772 (diff) |
Use seedrng for seeding the random number generator
The RNG can't actually be seeded from a shell script, due to the
reliance on ioctls. For this reason, the seedrng project provides a
basic script meant to be copy and pasted into projects like OpenRC and
tweaked as needed: https://git.zx2c4.com/seedrng/about/
This commit imports it into OpenRC and wires up /etc/init.d/urandom to
call it. It shouldn't be called by other things on the system, so it
lives in rc_sbindir.
Closes #506.
Closes #507.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/rc/Makefile')
-rw-r--r-- | src/rc/Makefile | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rc/Makefile b/src/rc/Makefile index fd796d92..62539f13 100644 --- a/src/rc/Makefile +++ b/src/rc/Makefile @@ -15,7 +15,7 @@ endif ifeq (${OS},Linux) SRCS+= kill_all.c openrc-init.c openrc-shutdown.c rc-sysvinit.c broadcast.c \ - rc-wtmp.c + rc-wtmp.c seedrng.c endif CLEANFILES= version.h rc-selinux.o @@ -47,6 +47,7 @@ RC_SBINPROGS= mark_service_starting mark_service_started \ ifeq (${OS},Linux) RC_BINPROGS+= kill_all +RC_SBINPROGS+= seedrng SBINPROGS+= openrc-init openrc-shutdown endif @@ -180,3 +181,6 @@ shell_var: shell_var.o swclock: swclock.o _usage.o rc-misc.o ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} + +seedrng: seedrng.o + ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} |