From 21345b3faf269ccd4e3d13f9c59e6eaca91039b3 Mon Sep 17 00:00:00 2001 From: bluhm Date: Sat, 1 Sep 2018 18:09:14 +0000 Subject: [PATCH] Accidentally relayd(8) closed file descriptor 0 in the pfe child process. If env->sc_snmp is initialized with 0, snmp_init() closes it. Set it to -1 to prevent the close(2). OK reyk@ benno@ millert@ --- usr.sbin/relayd/relayd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c index c2e675adf67..ad6bce1c178 100644 --- a/usr.sbin/relayd/relayd.c +++ b/usr.sbin/relayd/relayd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relayd.c,v 1.172 2018/08/06 17:31:31 benno Exp $ */ +/* $OpenBSD: relayd.c,v 1.173 2018/09/01 18:09:14 bluhm Exp $ */ /* * Copyright (c) 2007 - 2016 Reyk Floeter @@ -184,6 +184,7 @@ main(int argc, char *argv[]) TAILQ_INIT(&env->sc_hosts); TAILQ_INIT(&env->sc_sessions); env->sc_rtable = getrtable(); + env->sc_snmp = -1; /* initialize the TLS session id to a random key for all relay procs */ arc4random_buf(env->sc_conf.tls_sid, sizeof(env->sc_conf.tls_sid)); -- 2.20.1