Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Dec 2020 12:20:29 +0000 (UTC)
From:      Eugene Grosbein <eugen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r368758 - stable/12/sbin/hastd
Message-ID:  <202012181220.0BICKUDV098902@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eugen
Date: Fri Dec 18 12:20:29 2020
New Revision: 368758
URL: https://svnweb.freebsd.org/changeset/base/368758

Log:
  MFC r368148: fix hastd(8)
  
  hastd(8) assumes it has no extra file descriptors opened
  and aborts otherwise, so call closefrom() early.
  
  PR:		227461

Modified:
  stable/12/sbin/hastd/hastd.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/hastd/hastd.c
==============================================================================
--- stable/12/sbin/hastd/hastd.c	Fri Dec 18 10:13:28 2020	(r368757)
+++ stable/12/sbin/hastd/hastd.c	Fri Dec 18 12:20:29 2020	(r368758)
@@ -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();
 
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012181220.0BICKUDV098902>