diff options
author | dougb <dougb@FreeBSD.org> | 2011-09-03 07:13:45 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2011-09-03 07:13:45 +0000 |
commit | f18a6196d77d71d90e7f726cfc30101abb2958e1 (patch) | |
tree | df1f07c78f187c54ea276c24753c42174127668e /contrib/bind9/bin/named/unix/os.c | |
parent | fbc49b949e99a3bf0c24ca3f9e542ae398b89dca (diff) | |
parent | 9c893fc637e8791d7faedec39c0993533a1fbb6e (diff) | |
download | FreeBSD-src-f18a6196d77d71d90e7f726cfc30101abb2958e1.zip FreeBSD-src-f18a6196d77d71d90e7f726cfc30101abb2958e1.tar.gz |
Upgrade to BIND version 9.8.1. Release notes at:
https://deepthought.isc.org/article/AA-00446/81/
or
/usr/src/contrib/bind9/
Approved by: re (kib)
Diffstat (limited to 'contrib/bind9/bin/named/unix/os.c')
-rw-r--r-- | contrib/bind9/bin/named/unix/os.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/contrib/bind9/bin/named/unix/os.c b/contrib/bind9/bin/named/unix/os.c index 53e9e45..5fd6547 100644 --- a/contrib/bind9/bin/named/unix/os.c +++ b/contrib/bind9/bin/named/unix/os.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: os.c,v 1.104 2010-11-17 23:47:08 tbox Exp $ */ +/* $Id: os.c,v 1.104.38.3 2011-03-02 00:04:01 marka Exp $ */ /*! \file */ @@ -790,6 +790,9 @@ ns_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user) { free(f); if (switch_user && runas_pw != NULL) { +#ifndef HAVE_LINUXTHREADS + gid_t oldgid = getgid(); +#endif /* Set UID/GID to the one we'll be running with eventually */ setperms(runas_pw->pw_uid, runas_pw->pw_gid); @@ -797,7 +800,7 @@ ns_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user) { #ifndef HAVE_LINUXTHREADS /* Restore UID/GID to root */ - setperms(0, 0); + setperms(0, oldgid); #endif /* HAVE_LINUXTHREADS */ if (fd == -1) { @@ -950,7 +953,7 @@ ns_os_shutdownmsg(char *command, isc_buffer_t *text) { isc_buffer_availablelength(text), "pid: %ld", (long)pid); /* Only send a message if it is complete. */ - if (n < isc_buffer_availablelength(text)) + if (n > 0 && n < isc_buffer_availablelength(text)) isc_buffer_add(text, n); } |