Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
da76a804
Commit
da76a804
authored
Aug 10, 2000
by
Brian Wellington
Browse files
382. [bug] named -u failed on Debian Linux.
parent
cd7ffa4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGES
View file @
da76a804
382. [bug] named -u failed on Debian Linux.
381. [bug] Check for IPV6_RECVPKTINFO and use it instead of
IPV6_PKTINFO if found. [RT #229]
...
...
bin/named/unix/os.c
View file @
da76a804
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: os.c,v 1.
29
2000/08/
01 01:12:21 tale
Exp $ */
/* $Id: os.c,v 1.
30
2000/08/
10 00:31:58 bwelling
Exp $ */
#include
<config.h>
...
...
@@ -61,7 +61,10 @@ static isc_boolean_t done_setuid = ISC_FALSE;
#ifdef HAVE_LINUX_PRCTL_H
#include
<sys/prctl.h>
/* Required for prctl(). */
#ifndef PR_SET_KEEPCAPS
#define PR_SET_KEEPCAPS 8
#endif
#endif
/* HAVE_LINUX_PRCTL_H */
#ifndef SYS_capset
#define SYS_capset __NR_capset
...
...
@@ -108,14 +111,10 @@ linux_initialprivs(void) {
*/
caps
|=
(
1
<<
CAP_SYS_CHROOT
);
#if
def
ined(
HAVE_LINUX_PRCTL_H
) && defined(PR_SET_KEEPCAPS)
#ifdef
HAVE_LINUX_PRCTL_H
/*
* If the kernel supports keeping capabilities after setuid(), we
* also want the setuid capability.
*
* There's no point turning this on if we don't have PR_SET_KEEPCAPS,
* because changing user ids only works right with linuxthreads if
* we can do it early (before creating threads).
* also want the setuid capability. We don't know until we've tried.
*/
caps
|=
(
1
<<
CAP_SETUID
);
#endif
...
...
@@ -151,7 +150,7 @@ linux_minprivs(void) {
linux_setcaps
(
caps
);
}
#if
def
ined(
HAVE_LINUX_PRCTL_H
) && defined(PR_SET_KEEPCAPS)
#ifdef
HAVE_LINUX_PRCTL_H
static
void
linux_keepcaps
(
void
)
{
/*
...
...
@@ -310,7 +309,7 @@ ns_os_changeuser(void) {
void
ns_os_minprivs
(
void
)
{
#ifdef HAVE_LINUX_CAPABILITY_H
#if
def
ined(
HAVE_LINUX_PRCTL_H
) && defined(PR_SET_KEEPCAPS)
#ifdef
HAVE_LINUX_PRCTL_H
linux_keepcaps
();
ns_os_changeuser
();
#endif
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment