]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
misc fixes for VS 2015 CTP #39267
authorFrancis Dupont <fdupont@isc.org>
Fri, 17 Apr 2015 00:57:02 +0000 (02:57 +0200)
committerFrancis Dupont <fdupont@isc.org>
Fri, 17 Apr 2015 00:57:02 +0000 (02:57 +0200)
14 files changed:
CHANGES
bin/dig/include/dig/dig.h
bin/named/client.c
bin/named/win32/os.c
lib/dns/include/dns/zone.h
lib/dns/opensslrsa_link.c
lib/dns/pkcs11rsa_link.c
lib/dns/zone.c
lib/isc/win32/socket.c
lib/isc/win32/time.c
lib/isccc/cc.c
lib/lwres/lwres_gabn.c
lib/lwres/lwres_grbn.c
util/copyrights

diff --git a/CHANGES b/CHANGES
index dc9bd37e3556b76b60a729b35c4700c656fe0c4f..407a869eec9621a6406b459ad18f36784d3aeb0e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4103.  [port]          Misc fixes for Microsoft Visual Studio
+                       2015 CTP6. [RT #39267]
+
 4102.  [bug]           Fix a use after free bug introduced in change
                        #4094.  [RT #39281]
 
index 7bfc1bb12938fd2b4c1a9d0c007f48102d6d8941..d08260e5c9d43271f22d5f1a381ca5174a0b951a 100644 (file)
@@ -305,7 +305,7 @@ extern int idnoptions;
  * Routines in dighost.c.
  */
 isc_result_t
-get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr);
+get_address(char *host, in_port_t myport, isc_sockaddr_t *sockaddr);
 
 int
 getaddresses(dig_lookup_t *lookup, const char *host, isc_result_t *resultp);
index e6a6efa82f8ae4c0a4af657ceeb4b1e0538a23ef..62ef45c64908041caf00c27757977336653dae40 100644 (file)
@@ -1472,7 +1472,7 @@ ns_client_addopt(ns_client_t *client, dns_message_t *message,
 
                INSIST(count < DNS_EDNSOPTIONS);
                ednsopts[count].code = DNS_OPT_NSID;
-               ednsopts[count].length = strlen(nsidp);
+               ednsopts[count].length = (isc_uint16_t)strlen(nsidp);
                ednsopts[count].value = (unsigned char *)nsidp;
                count++;
        }
index 4e17e7b9fb6bc76b04deb4d7d95a3069d5f7bf54..45ed5501b59bb6bc9d70cdddc39b119739636331 100644 (file)
@@ -212,7 +212,7 @@ cleanup_pidfile(void) {
 
 static void
 cleanup_lockfile(void) {
-       if (singletonfile != -1) {
+       if (singletonfd != -1) {
                close(singletonfd);
                singletonfd = -1;
        }
@@ -254,7 +254,7 @@ ns_os_openfile(const char *filename, int mode, isc_boolean_t switch_user) {
 
 void
 ns_os_writepidfile(const char *filename, isc_boolean_t first_time) {
-       FILE *lockfile;
+       FILE *pidlockfile;
        pid_t pid;
        char strbuf[ISC_STRERRORSIZE];
        void (*report)(const char *, ...);
@@ -277,9 +277,9 @@ ns_os_writepidfile(const char *filename, isc_boolean_t first_time) {
                return;
        }
 
-       lockfile = ns_os_openfile(filename, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH,
-                                 ISC_FALSE);
-       if (lockfile == NULL) {
+       pidlockfile = ns_os_openfile(filename, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH,
+                                    ISC_FALSE);
+       if (pidlockfile == NULL) {
                free(pidfile);
                pidfile = NULL;
                return;
@@ -287,23 +287,24 @@ ns_os_writepidfile(const char *filename, isc_boolean_t first_time) {
 
        pid = getpid();
 
-       if (fprintf(lockfile, "%ld\n", (long)pid) < 0) {
+       if (fprintf(pidlockfile, "%ld\n", (long)pid) < 0) {
                (*report)("fprintf() to pid file '%s' failed", filename);
-               (void)fclose(lockfile);
+               (void)fclose(pidlockfile);
                cleanup_pidfile();
                return;
        }
-       if (fflush(lockfile) == EOF) {
+       if (fflush(pidlockfile) == EOF) {
                (*report)("fflush() to pid file '%s' failed", filename);
-               (void)fclose(lockfile);
+               (void)fclose(pidlockfile);
                cleanup_pidfile();
                return;
        }
-       (void)fclose(lockfile);
+       (void)fclose(pidlockfile);
 }
 
 isc_boolean_t
 ns_os_issingleton(const char *filename) {
+       char strbuf[ISC_STRERRORSIZE];
        OVERLAPPED o;
 
        if (singletonfd != -1)
index 5674f427b45d1ec328fa3f0919b285368cfe853d..058a47ddbe3a1912cc43f8eb722eba63c57d1e88 100644 (file)
@@ -1305,11 +1305,11 @@ dns_zone_getmaxxfrout(dns_zone_t *zone);
  */
 
 isc_result_t
-dns_zone_setjournal(dns_zone_t *zone, const char *journal);
+dns_zone_setjournal(dns_zone_t *zone, const char *myjournal);
 /*%<
  * Sets the filename used for journaling updates / IXFR transfers.
  * The default journal name is set by dns_zone_setfile() to be
- * "file.jnl".  If 'journal' is NULL, the zone will have no
+ * "file.jnl".  If 'myjournal' is NULL, the zone will have no
  * journal name.
  *
  * Requires:
index 667907a9557fb70ba73fbccc84e63720c79d0193..7740103ca052f168b8459a4e5cf9cc11d5e77f64 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2009, 2011-2014  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2009, 2011-2015  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 2000-2003  Internet Software Consortium.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -1127,14 +1127,16 @@ opensslrsa_tofile(const dst_key_t *key, const char *directory) {
 
        if (key->engine != NULL) {
                priv.elements[i].tag = TAG_RSA_ENGINE;
-               priv.elements[i].length = strlen(key->engine) + 1;
+               priv.elements[i].length =
+                       (unsigned short)strlen(key->engine) + 1;
                priv.elements[i].data = (unsigned char *)key->engine;
                i++;
        }
 
        if (key->label != NULL) {
                priv.elements[i].tag = TAG_RSA_LABEL;
-               priv.elements[i].length = strlen(key->label) + 1;
+               priv.elements[i].length =
+                       (unsigned short)strlen(key->label) + 1;
                priv.elements[i].data = (unsigned char *)key->label;
                i++;
        }
index 17030716711c80a056be2207aabd3f895663074c..a028925b6c2ee3e47969ef706be247b88a0e6ca8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2014, 2015  Internet Systems Consortium, Inc. ("ISC")
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -1013,14 +1013,16 @@ pkcs11rsa_tofile(const dst_key_t *key, const char *directory) {
 
        if (key->engine != NULL) {
                priv.elements[i].tag = TAG_RSA_ENGINE;
-               priv.elements[i].length = strlen(key->engine) + 1;
+               priv.elements[i].length =
+                       (unsigned short)strlen(key->engine) + 1;
                priv.elements[i].data = (unsigned char *)key->engine;
                i++;
        }
 
        if (key->label != NULL) {
                priv.elements[i].tag = TAG_RSA_LABEL;
-               priv.elements[i].length = strlen(key->label) + 1;
+               priv.elements[i].length =
+                       (unsigned short)strlen(key->label) + 1;
                priv.elements[i].data = (unsigned char *)key->label;
                i++;
        }
index e674ac9cf95ac716b0340553c1fd53d88170f032..a953521c6afea59845e4eeccbc18fbf68cf11b05 100644 (file)
@@ -1645,13 +1645,13 @@ default_journal(dns_zone_t *zone) {
 }
 
 isc_result_t
-dns_zone_setjournal(dns_zone_t *zone, const char *journal) {
+dns_zone_setjournal(dns_zone_t *zone, const char *myjournal) {
        isc_result_t result = ISC_R_SUCCESS;
 
        REQUIRE(DNS_ZONE_VALID(zone));
 
        LOCK_ZONE(zone);
-       result = dns_zone_setstring(zone, &zone->journal, journal);
+       result = dns_zone_setstring(zone, &zone->journal, myjournal);
        UNLOCK_ZONE(zone);
 
        return (result);
index c8564b43e45f8b09aeed46f63fd12bfefc115af4..903755b349ddfcfca01162cd164ffad4adedb70f 100644 (file)
@@ -1402,7 +1402,7 @@ startio_send(isc_socket_t *sock, isc_socketevent_t *dev, int *nbytes,
        char strbuf[ISC_STRERRORSIZE];
        IoCompletionInfo *lpo;
        int status;
-       struct msghdr *msghdr;
+       struct msghdr *mh;
 
        lpo = (IoCompletionInfo *)HeapAlloc(hHeapHandle,
                                            HEAP_ZERO_MEMORY,
@@ -1410,13 +1410,13 @@ startio_send(isc_socket_t *sock, isc_socketevent_t *dev, int *nbytes,
        RUNTIME_CHECK(lpo != NULL);
        lpo->request_type = SOCKET_SEND;
        lpo->dev = dev;
-       msghdr = &lpo->messagehdr;
-       memset(msghdr, 0, sizeof(struct msghdr));
+       mh = &lpo->messagehdr;
+       memset(mh, 0, sizeof(struct msghdr));
        ISC_LIST_INIT(lpo->bufferlist);
 
-       build_msghdr_send(sock, dev, msghdr, cmsg, sock->iov, lpo);
+       build_msghdr_send(sock, dev, mh, cmsg, sock->iov, lpo);
 
-       *nbytes = internal_sendmsg(sock, lpo, msghdr, 0, send_errno);
+       *nbytes = internal_sendmsg(sock, lpo, mh, 0, send_errno);
 
        if (*nbytes <= 0) {
                /*
index 3f145a5d21c575aced438f9b225b58944b675630..e478edcb82a0c87f7afe26ab8fabed7f570f773f 100644 (file)
@@ -83,14 +83,14 @@ isc_interval_iszero(const isc_interval_t *i) {
 
 void
 isc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds) {
-       SYSTEMTIME epoch = { 1970, 1, 4, 1, 0, 0, 0, 0 };
+       SYSTEMTIME epoch1970 = { 1970, 1, 4, 1, 0, 0, 0, 0 };
        FILETIME temp;
        ULARGE_INTEGER i1;
 
        REQUIRE(t != NULL);
        REQUIRE(nanoseconds < NS_PER_S);
 
-       SystemTimeToFileTime(&epoch, &temp);
+       SystemTimeToFileTime(&epoch1970, &temp);
 
        i1.LowPart = temp.dwLowDateTime;
        i1.HighPart = temp.dwHighDateTime;
@@ -227,12 +227,12 @@ isc_time_microdiff(const isc_time_t *t1, const isc_time_t *t2) {
 
 isc_uint32_t
 isc_time_seconds(const isc_time_t *t) {
-       SYSTEMTIME epoch = { 1970, 1, 4, 1, 0, 0, 0, 0 };
+       SYSTEMTIME epoch1970 = { 1970, 1, 4, 1, 0, 0, 0, 0 };
        FILETIME temp;
        ULARGE_INTEGER i1, i2;
        LONGLONG i3;
 
-       SystemTimeToFileTime(&epoch, &temp);
+       SystemTimeToFileTime(&epoch1970, &temp);
 
        i1.LowPart  = t->absolute.dwLowDateTime;
        i1.HighPart = t->absolute.dwHighDateTime;
index 89a9f877ab26180649a06b90ecd99d3519db2de8..8b8cc3a380bb76f913dab1da9cd3d2337c2cfad9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright (C) 2004-2007, 2012-2014  Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (C) 2004-2007, 2012-2015  Internet Systems Consortium, Inc. ("ISC")
  * Portions Copyright (C) 2001-2003  Internet Software Consortium.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -224,7 +224,7 @@ table_towire(isccc_sexpr_t *alist, isc_buffer_t **buffer) {
                result = isc_buffer_reserve(buffer, 1 + len);
                if (result != ISC_R_SUCCESS)
                        return (ISC_R_NOSPACE);
-               isc_buffer_putuint8(*buffer, len);
+               isc_buffer_putuint8(*buffer, (isc_uint8_t)len);
                isc_buffer_putmem(*buffer, (const unsigned char *) ks, len);
                /*
                 * Emit the value.
index d770579cb4165458c754a795167da1ef2c97fe5b..26170b6c6f895f158b5f69b922543fa6fe9ba8e0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2005, 2007, 2013  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2007, 2013, 2015  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 2000, 2001  Internet Software Consortium.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -133,7 +133,7 @@ lwres_gabnrequest_render(lwres_context_t *ctx, lwres_gabnrequest_t *req,
        REQUIRE(pkt != NULL);
        REQUIRE(b != NULL);
 
-       datalen = strlen(req->name);
+       datalen = (lwres_uint16_t) strlen(req->name);
 
        payload_length = 4 + 4 + 2 + req->namelen + 1;
 
index a8ff2342bd7e548652aec492316bd1c3a69ec250..993579c38bcda491766ec48c434081a23e077746 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2005, 2007, 2013  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2007, 2013, 2015  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 2000, 2001  Internet Software Consortium.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -52,7 +52,7 @@ lwres_grbnrequest_render(lwres_context_t *ctx, lwres_grbnrequest_t *req,
        REQUIRE(pkt != NULL);
        REQUIRE(b != NULL);
 
-       datalen = strlen(req->name);
+       datalen = (lwres_uint16_t) strlen(req->name);
 
        payload_length = 4 + 2 + 2 + 2 + req->namelen + 1;
 
index 2f6438d88b3e44bd4d4056685529185dcc0fbf09..862afbfc3e2ebd75f30b071614080222d63ef19f 100644 (file)
 ./lib/dns/openssldsa_link.c                    C.NAI   1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014
 ./lib/dns/opensslecdsa_link.c                  C       2012,2013,2014
 ./lib/dns/opensslgost_link.c                   C       2010,2011,2012,2013,2014
-./lib/dns/opensslrsa_link.c                    C       2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014
+./lib/dns/opensslrsa_link.c                    C       2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015
 ./lib/dns/order.c                              C       2002,2004,2005,2007
 ./lib/dns/peer.c                               C       2000,2001,2003,2004,2005,2006,2007,2008,2009,2012,2013,2014
 ./lib/dns/pkcs11.c                             C       2014
 ./lib/dns/pkcs11dsa_link.c                     C       2014
 ./lib/dns/pkcs11ecdsa_link.c                   C       2014
 ./lib/dns/pkcs11gost_link.c                    C       2014
-./lib/dns/pkcs11rsa_link.c                     C       2014
+./lib/dns/pkcs11rsa_link.c                     C       2014,2015
 ./lib/dns/portlist.c                           C       2003,2004,2005,2006,2007,2014
 ./lib/dns/private.c                            C       2009,2011,2012,2015
 ./lib/dns/rbt.c                                        C       1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2011,2012,2013,2014,2015
 ./lib/isccc/alist.c                            C.NOM   2001,2004,2005,2007
 ./lib/isccc/api                                        X       2001,2006,2008,2009,2010,2011,2012,2013,2014
 ./lib/isccc/base64.c                           C.NOM   2001,2004,2005,2007,2013
-./lib/isccc/cc.c                               C.NOM   2001,2002,2003,2004,2005,2006,2007,2012,2013,2014
+./lib/isccc/cc.c                               C.NOM   2001,2002,2003,2004,2005,2006,2007,2012,2013,2014,2015
 ./lib/isccc/ccmsg.c                            C.NOM   2001,2004,2005,2007
 ./lib/isccc/include/Makefile.in                        MAKE    2001,2004,2007,2012
 ./lib/isccc/include/isccc/Makefile.in          MAKE    2001,2004,2007,2012
 ./lib/lwres/lwinetntop.c                       C       1996,1997,1998,1999,2000,2001,2003,2004,2005,2007
 ./lib/lwres/lwinetpton.c                       C       1996,1997,1998,1999,2000,2001,2004,2005,2007,2011,2012,2013,2014
 ./lib/lwres/lwpacket.c                         C       2000,2001,2004,2005,2007
-./lib/lwres/lwres_gabn.c                       C       2000,2001,2004,2005,2007,2013
+./lib/lwres/lwres_gabn.c                       C       2000,2001,2004,2005,2007,2013,2015
 ./lib/lwres/lwres_gnba.c                       C       2000,2001,2002,2004,2005,2007,2013
-./lib/lwres/lwres_grbn.c                       C       2000,2001,2004,2005,2007,2013
+./lib/lwres/lwres_grbn.c                       C       2000,2001,2004,2005,2007,2013,2015
 ./lib/lwres/lwres_noop.c                       C       2000,2001,2004,2005,2007,2013
 ./lib/lwres/lwresutil.c                                C       2000,2001,2004,2005,2007,2014
 ./lib/lwres/man/Makefile.in                    MAKE    2001,2004,2007,2012