mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 15:45:25 +00:00
check for <sys/prctl.h>, not <linux/prctl.h> [RT #679]
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: os.c,v 1.38 2001/01/09 21:40:38 bwelling Exp $ */
|
/* $Id: os.c,v 1.39 2001/02/24 23:05:09 bwelling Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
@@ -45,14 +45,14 @@ static char *pidfile = NULL;
|
|||||||
* If there's no <linux/capability.h>, we don't care about <linux/prctl.h>
|
* If there's no <linux/capability.h>, we don't care about <linux/prctl.h>
|
||||||
*/
|
*/
|
||||||
#ifndef HAVE_LINUX_CAPABILITY_H
|
#ifndef HAVE_LINUX_CAPABILITY_H
|
||||||
#undef HAVE_LINUX_PRCTL_H
|
#undef HAVE_SYS_PRCTL_H
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Linux defines:
|
* Linux defines:
|
||||||
* (T) HAVE_LINUXTHREADS
|
* (T) HAVE_LINUXTHREADS
|
||||||
* (C) HAVE_LINUX_CAPABILITY_H
|
* (C) HAVE_LINUX_CAPABILITY_H
|
||||||
* (P) HAVE_LINUX_PRCTL_H
|
* (P) HAVE_SYS_PRCTL_H
|
||||||
* The possible cases are:
|
* The possible cases are:
|
||||||
* none: setuid() normally
|
* none: setuid() normally
|
||||||
* T: no setuid()
|
* T: no setuid()
|
||||||
@@ -108,7 +108,7 @@ static isc_boolean_t non_root_caps = ISC_FALSE;
|
|||||||
#include <sys/syscall.h> /* Required for syscall(). */
|
#include <sys/syscall.h> /* Required for syscall(). */
|
||||||
#include <linux/capability.h> /* Required for _LINUX_CAPABILITY_VERSION. */
|
#include <linux/capability.h> /* Required for _LINUX_CAPABILITY_VERSION. */
|
||||||
|
|
||||||
#ifdef HAVE_LINUX_PRCTL_H
|
#ifdef HAVE_SYS_PRCTL_H
|
||||||
#include <sys/prctl.h> /* Required for prctl(). */
|
#include <sys/prctl.h> /* Required for prctl(). */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -121,7 +121,7 @@ static isc_boolean_t non_root_caps = ISC_FALSE;
|
|||||||
#define PR_SET_KEEPCAPS 8
|
#define PR_SET_KEEPCAPS 8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAVE_LINUX_PRCTL_H */
|
#endif /* HAVE_SYS_PRCTL_H */
|
||||||
|
|
||||||
#ifndef SYS_capset
|
#ifndef SYS_capset
|
||||||
#define SYS_capset __NR_capset
|
#define SYS_capset __NR_capset
|
||||||
@@ -168,7 +168,7 @@ linux_initialprivs(void) {
|
|||||||
*/
|
*/
|
||||||
caps |= (1 << CAP_SYS_CHROOT);
|
caps |= (1 << CAP_SYS_CHROOT);
|
||||||
|
|
||||||
#if defined(HAVE_LINUX_PRCTL_H) || !defined(HAVE_LINUXTHREADS)
|
#if defined(HAVE_SYS_PRCTL_H) || !defined(HAVE_LINUXTHREADS)
|
||||||
/*
|
/*
|
||||||
* We can setuid() only if either the kernel supports keeping
|
* We can setuid() only if either the kernel supports keeping
|
||||||
* capabilities after setuid() (which we don't know until we've
|
* capabilities after setuid() (which we don't know until we've
|
||||||
@@ -228,7 +228,7 @@ linux_minprivs(void) {
|
|||||||
linux_setcaps(caps);
|
linux_setcaps(caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LINUX_PRCTL_H
|
#ifdef HAVE_SYS_PRCTL_H
|
||||||
static void
|
static void
|
||||||
linux_keepcaps(void) {
|
linux_keepcaps(void) {
|
||||||
/*
|
/*
|
||||||
@@ -393,7 +393,7 @@ ns_os_changeuser(void) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
ns_os_minprivs(void) {
|
ns_os_minprivs(void) {
|
||||||
#ifdef HAVE_LINUX_PRCTL_H
|
#ifdef HAVE_SYS_PRCTL_H
|
||||||
linux_keepcaps();
|
linux_keepcaps();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: config.h.in,v 1.41 2001/01/18 22:21:24 bwelling Exp $ */
|
/* $Id: config.h.in,v 1.42 2001/02/24 23:05:07 bwelling Exp $ */
|
||||||
|
|
||||||
/***
|
/***
|
||||||
*** This file is not to be included by any public header files, because
|
*** This file is not to be included by any public header files, because
|
||||||
@@ -138,8 +138,11 @@ int sigwait(const unsigned int *set, int *sig);
|
|||||||
/* Define if you have the <linux/capability.h> header file. */
|
/* Define if you have the <linux/capability.h> header file. */
|
||||||
#undef HAVE_LINUX_CAPABILITY_H
|
#undef HAVE_LINUX_CAPABILITY_H
|
||||||
|
|
||||||
/* Define if you have the <linux/prctl.h> header file. */
|
/* Define if you have the <sys/prctl.h> header file. */
|
||||||
#undef HAVE_LINUX_PRCTL_H
|
#undef HAVE_SYS_PRCTL_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/select.h> header file. */
|
||||||
|
#undef HAVE_SYS_SELECT_H
|
||||||
|
|
||||||
/* Define if you have the <sys/sockio.h> header file. */
|
/* Define if you have the <sys/sockio.h> header file. */
|
||||||
#undef HAVE_SYS_SOCKIO_H
|
#undef HAVE_SYS_SOCKIO_H
|
||||||
|
@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
|
|||||||
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
|
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
|
||||||
AC_DIVERT_POP()dnl
|
AC_DIVERT_POP()dnl
|
||||||
|
|
||||||
AC_REVISION($Revision: 1.232 $)
|
AC_REVISION($Revision: 1.233 $)
|
||||||
|
|
||||||
AC_INIT(lib/dns/name.c)
|
AC_INIT(lib/dns/name.c)
|
||||||
AC_PREREQ(2.13)
|
AC_PREREQ(2.13)
|
||||||
@@ -1210,7 +1210,7 @@ AC_SUBST(ISC_PLATFORM_LONGLONGEQUALLONG)
|
|||||||
#
|
#
|
||||||
AC_CHECK_FUNC(chroot, AC_DEFINE(HAVE_CHROOT))
|
AC_CHECK_FUNC(chroot, AC_DEFINE(HAVE_CHROOT))
|
||||||
AC_CHECK_HEADERS(linux/capability.h)
|
AC_CHECK_HEADERS(linux/capability.h)
|
||||||
AC_CHECK_HEADERS(linux/prctl.h)
|
AC_CHECK_HEADERS(sys/prctl.h)
|
||||||
|
|
||||||
#
|
#
|
||||||
# BSD/OS, and perhaps some others, don't define rlim_t.
|
# BSD/OS, and perhaps some others, don't define rlim_t.
|
||||||
|
Reference in New Issue
Block a user