mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
1848. [bug] Improve SMF integration. [RT #13238]
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: os.c,v 1.71 2004/10/07 02:33:31 marka Exp $ */
|
||||
/* $Id: os.c,v 1.72 2005/04/05 00:58:16 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
#include <stdarg.h>
|
||||
@@ -46,6 +46,9 @@
|
||||
|
||||
#include <named/main.h>
|
||||
#include <named/os.h>
|
||||
#ifdef HAVE_LIBSCF
|
||||
#include <named/ns_smf_globals.h>
|
||||
#endif
|
||||
|
||||
static char *pidfile = NULL;
|
||||
static int devnullfd = -1;
|
||||
@@ -417,6 +420,9 @@ all_digits(const char *s) {
|
||||
void
|
||||
ns_os_chroot(const char *root) {
|
||||
char strbuf[ISC_STRERRORSIZE];
|
||||
#ifdef HAVE_LIBSCF
|
||||
ns_smf_chroot = 0;
|
||||
#endif
|
||||
if (root != NULL) {
|
||||
if (chroot(root) < 0) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
@@ -426,6 +432,10 @@ ns_os_chroot(const char *root) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
ns_main_earlyfatal("chdir(/): %s", strbuf);
|
||||
}
|
||||
#ifdef HAVE_LIBSCF
|
||||
/* Set ns_smf_chroot flag on successful chroot. */
|
||||
ns_smf_chroot = 1;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user