aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Grosbein <eugen@FreeBSD.org>2020-12-18 12:20:29 +0000
committerEugene Grosbein <eugen@FreeBSD.org>2020-12-18 12:20:29 +0000
commitaed5ed4ef4fccadac4148f006c04a09e018ebc93 (patch)
tree9dbaf233863ca2a6b6e7fedd52e334919c6f5bb4
parent169dd9073832d10b2f4985f8bbca5d4613facc44 (diff)
downloadsrc-aed5ed4ef4fccadac4148f006c04a09e018ebc93.tar.gz
src-aed5ed4ef4fccadac4148f006c04a09e018ebc93.zip
MFC r368148: fix hastd(8)
hastd(8) assumes it has no extra file descriptors opened and aborts otherwise, so call closefrom() early. PR: 227461
Notes
Notes: svn path=/stable/12/; revision=368758
-rw-r--r--sbin/hastd/hastd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sbin/hastd/hastd.c b/sbin/hastd/hastd.c
index 160dfef437e9..be58411b7ec7 100644
--- a/sbin/hastd/hastd.c
+++ b/sbin/hastd/hastd.c
@@ -1222,6 +1222,7 @@ main(int argc, char *argv[])
pjdlog_init(PJDLOG_MODE_STD);
pjdlog_debug_set(debuglevel);
+ closefrom(MAX(MAX(STDIN_FILENO, STDOUT_FILENO), STDERR_FILENO) + 1);
g_gate_load();
/*