]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3276. [bug] win32: isc_socket_dup is not implemented. [RT #27696]
authorMark Andrews <marka@isc.org>
Mon, 6 Feb 2012 04:23:44 +0000 (04:23 +0000)
committerMark Andrews <marka@isc.org>
Mon, 6 Feb 2012 04:23:44 +0000 (04:23 +0000)
3276.   [bug]           win32: ns_os_openfile failed to return NULL on
                        safe_open failure. [RT #27696]

CHANGES
bin/named/main.c
bin/named/win32/os.c
lib/isc/win32/socket.c

diff --git a/CHANGES b/CHANGES
index d7631d73bea73065c1a4ea788e8d924a36517243..d9741258408384f9f0d0b49c133a476c097b30bd 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+3276.  [bug]           win32: isc_socket_dup is not implemented. [RT #27696]
+
+3276.  [bug]           win32: ns_os_openfile failed to return NULL on
+                       safe_open failure. [RT #27696]
+
 3271.  [port]          darwin: mksymtbl is not always stable, loop several
                        times before giving up.  mksymtbl was using non
                        portable perl to covert 64 bit hex strings. [RT #27653]
index cdd16bb7d04fc89c9dcf9e58f0838dafeb0d12ac..7540a1a07c8a16c478bc5831252b42647886692d 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: main.c,v 1.185 2011/11/09 18:44:03 each Exp $ */
+/* $Id: main.c,v 1.185.64.1 2012/02/06 04:23:44 marka Exp $ */
 
 /*! \file */
 
@@ -590,8 +590,12 @@ create_managers(void) {
 #else
        ns_g_cpus = 1;
 #endif
+#ifdef WIN32
+       ns_g_udpdisp = 1;
+#else
        if (ns_g_udpdisp == 0 || ns_g_udpdisp > ns_g_cpus)
                ns_g_udpdisp = ns_g_cpus;
+#endif
        isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER,
                      ISC_LOG_INFO, "using %u UDP listener%s per interface",
                      ns_g_udpdisp, ns_g_udpdisp == 1 ? "" : "s");
index 39151ed1477dc29d9f4e8dd38d30e6a78691736e..7c93492d649c49b9db06119646300db131e83ca4 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: os.c,v 1.37 2009/08/05 18:43:37 each Exp $ */
+/* $Id: os.c,v 1.37.746.1 2012/02/06 04:23:43 marka Exp $ */
 
 #include <config.h>
 #include <stdarg.h>
@@ -218,6 +218,7 @@ ns_os_openfile(const char *filename, int mode, isc_boolean_t switch_user) {
                isc__strerror(errno, strbuf, sizeof(strbuf));
                ns_main_earlywarning("could not open file '%s': %s",
                                     filename, strbuf);
+               return (NULL);
        }
 
        fp = fdopen(fd, "w");
index 8bb5b3273b026418f7568155e334c6f57289ae12..1f54306abd3581a016c8c6d899e40b215b45540e 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: socket.c,v 1.93 2011/11/29 01:03:47 marka Exp $ */
+/* $Id: socket.c,v 1.93.52.1 2012/02/06 04:23:43 marka Exp $ */
 
 /* This code uses functions which are only available on Server 2003 and
  * higher, and Windows XP and higher.
@@ -1649,12 +1649,17 @@ socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
        REQUIRE(socketp != NULL && *socketp == NULL);
        REQUIRE(type != isc_sockettype_fdwatch);
 
+       if (dup_socket != NULL)
+               return (ISC_R_NOTIMPLEMENTED);
+
        result = allocate_socket(manager, type, &sock);
        if (result != ISC_R_SUCCESS)
                return (result);
 
        sock->pf = pf;
+#if 0
        if (dup_socket == NULL) {
+#endif
                switch (type) {
                case isc_sockettype_udp:
                        sock->fd = socket(pf, SOCK_DGRAM, IPPROTO_UDP);
@@ -1680,6 +1685,7 @@ socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
                        sock->fd = socket(pf, SOCK_STREAM, IPPROTO_TCP);
                        break;
                }
+#if 0
        } else {
                /*
                 * XXX: dup() is deprecated in windows, use _dup()
@@ -1690,6 +1696,7 @@ socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
                sock->dupped = 1;
                sock->bound = dup_socket->bound;
        }
+#endif
 
        if (sock->fd == INVALID_SOCKET) {
                socket_errno = WSAGetLastError();
@@ -1826,8 +1833,12 @@ isc__socket_dup(isc_socket_t *sock, isc_socket_t **socketp) {
        REQUIRE(VALID_SOCKET(sock));
        REQUIRE(socketp != NULL && *socketp == NULL);
 
+#if 1
+       return (ISC_R_NOTIMPLEMENTED);
+#else
        return (socket_create(sock->manager, sock->pf, sock->type,
                              socketp, sock));
+#endif
 }
 
 isc_result_t