]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
undo wrong branch
authorMark Andrews <marka@isc.org>
Fri, 13 Dec 2002 02:51:41 +0000 (02:51 +0000)
committerMark Andrews <marka@isc.org>
Fri, 13 Dec 2002 02:51:41 +0000 (02:51 +0000)
bin/named/unix/os.c
lib/dns/Makefile.in
lib/dns/sec/dst/dst_api.c
lib/dns/sec/dst/gssapi_link.c
lib/dns/sec/dst/openssl_link.c
lib/dns/sec/dst/openssldh_link.c
lib/dns/sec/dst/openssldsa_link.c
lib/dns/sec/dst/opensslrsa_link.c

index 0e5f57f6772d992ffbd3d33b3989216959358970..9eef889e02f624351e43c2ba6f2beed704473443 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: os.c,v 1.61 2002/12/13 02:37:33 marka Exp $ */
+/* $Id: os.c,v 1.62 2002/12/13 02:51:39 marka Exp $ */
 
 #include <config.h>
 #include <stdarg.h>
@@ -357,10 +357,6 @@ void
 ns_os_chroot(const char *root) {
        char strbuf[ISC_STRERRORSIZE];
        if (root != NULL) {
-               isc_uint32_t dummy;
-
-               isc_random_get(&dummy);
-
                if (chroot(root) < 0) {
                        isc__strerror(errno, strbuf, sizeof(strbuf));
                        ns_main_earlyfatal("chroot(): %s", strbuf);
index 412bbde8b278677ed8221d97ad5df822fa07ec73..ad91dde5e9ae2a9039766e241a0f712b37e7e9d1 100644 (file)
@@ -13,7 +13,7 @@
 # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: Makefile.in,v 1.135 2002/12/13 02:37:34 marka Exp $
+# $Id: Makefile.in,v 1.136 2002/12/13 02:51:40 marka Exp $
 
 srcdir =       @srcdir@
 VPATH =                @srcdir@
@@ -34,13 +34,13 @@ LIBS =              @LIBS@
 
 # Alphabetically
 
-DSTOBJS =      sec/dst/dst_api.@O@ sec/dst/dst_lib.@O@ sec/dst/dst_parse.@O@ \
-               sec/dst/dst_result.@O@ sec/dst/hmac_link.@O@ sec/dst/key.@O@
-
-OPENSSLOBJS =  sec/dst/openssl_link.@O@ sec/dst/openssldh_link.@O@ \
-               sec/dst/openssldsa_link.@O@ sec/dst/opensslrsa_link.@O@
-
-GSSAPIOBJS =   sec/dst/gssapi_link.@O@ sec/dst/gssapictx.@O@
+DSTOBJS =      sec/dst/dst_api.@O@ \
+               sec/dst/dst_lib.@O@ sec/dst/dst_parse.@O@ \
+               sec/dst/dst_result.@O@ sec/dst/gssapi_link.@O@ \
+               sec/dst/gssapictx.@O@ sec/dst/hmac_link.@O@ \
+               sec/dst/key.@O@ sec/dst/openssl_link.@O@ \
+               sec/dst/openssldh_link.@O@ sec/dst/openssldsa_link.@O@ \
+               sec/dst/opensslrsa_link.@O@
 
 # Alphabetically
 OBJS =         acl.@O@ adb.@O@ byaddr.@O@ \
@@ -56,7 +56,7 @@ OBJS =                acl.@O@ adb.@O@ byaddr.@O@ \
                stats.@O@ tcpmsg.@O@ time.@O@ timer.@O@ tkey.@O@ \
                tsig.@O@ ttl.@O@ validator.@O@ \
                version.@O@ view.@O@ xfrin.@O@ zone.@O@ zonekey.@O@ zt.@O@ \
-               ${OTHEROBJS} ${DSTOBJS} ${OPENSSLOBJS} ${GSSAPIOBJS}
+               ${OTHEROBJS} ${DSTOBJS}
 
 # Alphabetically
 SRCS =         acl.c adb.c byaddr.c \
@@ -100,26 +100,6 @@ libdns.la: ${OBJS}
                -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \
                ${OBJS} ${LIBS}
 
-libdstcypto.@SA@: ${OPENSSLOBJS}
-       ${AR} ${ARFLAGS} $@ ${OPENSSLOBJS}
-       ${RANLIB} $@
-
-libdstcypto.la: ${OPENSSLOBJS}
-       ${LIBTOOL} --mode=link \
-               ${CC} ${ALL_CFLAGS} -o $@ -rpath ${libdir} \
-               -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \
-               ${OPENSSLOBJS} ${LIBS}
-
-libdstgssapi.@SA@: ${GSSAPIOBJS}
-       ${AR} ${ARFLAGS} $@ ${GSSAPIOBJS}
-       ${RANLIB} $@
-
-libdstgssapi.la: ${GSSAPIOBJS}
-       ${LIBTOOL} --mode=link \
-               ${CC} ${ALL_CFLAGS} -o $@ -rpath ${libdir} \
-               -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \
-               ${GSSAPIOBJS} ${LIBS}
-
 timestamp: libdns.@A@
        touch timestamp
 
index f9a4567971b0ecb9868ad655f5eb080f6a73beaf..d00fc518b3ee7468fc242f99fe3eabe94f030853 100644 (file)
@@ -19,7 +19,7 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: dst_api.c,v 1.105 2002/12/13 02:37:34 marka Exp $
+ * $Id: dst_api.c,v 1.106 2002/12/13 02:51:40 marka Exp $
  */
 
 #include <config.h>
@@ -103,14 +103,6 @@ static isc_result_t        addsuffix(char *filename, unsigned int len,
                        goto out;               \
        } while (0)
 
-#define RETERR2(x)                             \
-       do {                                    \
-               result = (x);                   \
-               if (result != ISC_R_SUCCESS &&  \
-                   result != ISC_R_NOTIMPLEMENTED)     \
-                       goto out;               \
-       } while (0)
-
 #define CHECKALG(alg)                          \
        do {                                    \
                isc_result_t _r;                \
@@ -127,7 +119,22 @@ dst_lib_init(isc_mem_t *mctx, isc_entropy_t *ectx, unsigned int eflags) {
        REQUIRE(dst_initialized == ISC_FALSE);
 
        dst__memory_pool = NULL;
+
+#ifdef OPENSSL
+       UNUSED(mctx);
+       /*
+        * When using --with-openssl, there seems to be no good way of not
+        * leaking memory due to the openssl error handling mechanism.
+        * Avoid assertions by using a local memory context and not checking
+        * for leaks on exit.
+        */
+       result = isc_mem_create(0, 0, &dst__memory_pool);
+       if (result != ISC_R_SUCCESS)
+               return (result);
+       isc_mem_setdestroycheck(dst__memory_pool, ISC_FALSE);
+#else
        isc_mem_attach(mctx, &dst__memory_pool);
+#endif
        isc_entropy_attach(ectx, &dst_entropy_pool);
        dst_entropy_flags = eflags;
 
@@ -135,12 +142,16 @@ dst_lib_init(isc_mem_t *mctx, isc_entropy_t *ectx, unsigned int eflags) {
 
        memset(dst_t_func, 0, sizeof(dst_t_func));
        RETERR(dst__hmacmd5_init(&dst_t_func[DST_ALG_HMACMD5]));
-       RETERR2(dst__openssl_init());
-       RETERR2(dst__opensslrsa_init(&dst_t_func[DST_ALG_RSAMD5]));
-       RETERR2(dst__opensslrsa_init(&dst_t_func[DST_ALG_RSASHA1]));
-       RETERR2(dst__openssldsa_init(&dst_t_func[DST_ALG_DSA]));
-       RETERR2(dst__openssldh_init(&dst_t_func[DST_ALG_DH]));
-       RETERR2(dst__gssapi_init(&dst_t_func[DST_ALG_GSSAPI]));
+#ifdef OPENSSL
+       RETERR(dst__openssl_init());
+       RETERR(dst__opensslrsa_init(&dst_t_func[DST_ALG_RSAMD5]));
+       RETERR(dst__opensslrsa_init(&dst_t_func[DST_ALG_RSASHA1]));
+       RETERR(dst__openssldsa_init(&dst_t_func[DST_ALG_DSA]));
+       RETERR(dst__openssldh_init(&dst_t_func[DST_ALG_DH]));
+#endif
+#ifdef GSSAPI
+       RETERR(dst__gssapi_init(&dst_t_func[DST_ALG_GSSAPI]));
+#endif
        dst_initialized = ISC_TRUE;
        return (ISC_R_SUCCESS);
 
@@ -158,11 +169,14 @@ dst_lib_destroy(void) {
        for (i = 0; i < DST_MAX_ALGS; i++)
                if (dst_t_func[i] != NULL && dst_t_func[i]->cleanup != NULL)
                        dst_t_func[i]->cleanup();
+#ifdef OPENSSL
        dst__openssl_destroy();
+#endif
        if (dst__memory_pool != NULL)
                isc_mem_detach(&dst__memory_pool);
        if (dst_entropy_pool != NULL)
                isc_entropy_detach(&dst_entropy_pool);
+
 }
 
 isc_boolean_t
index 873811ba747f9cad9b2d369803d7cdcaa8fb9e56..8b19b40779de35686bdba6130383845f98834c85 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 /*
- * $Id: gssapi_link.c,v 1.11 2002/12/13 02:37:34 marka Exp $
+ * $Id: gssapi_link.c,v 1.12 2002/12/13 02:51:40 marka Exp $
  */
 
 #ifdef GSSAPI
@@ -216,17 +216,5 @@ dst__gssapi_init(dst_func_t **funcp) {
 }
 
 #else
-
-#include <config.h>
-#include <stdlib.h>
-#include <isc/util.h>
-#include "dst_internal.h"
-
-isc_result_t
-dst__gssapi_init(dst_func_t **funcp) {
-       REQUIRE(funcp != NULL);
-       UNUSED(funcp);
-       return (ISC_R_NOTIMPLEMENTED);
-}
-
+int  gssapi_link_unneeded = 1;
 #endif
index c7449d320463902118d495b176304612f37a557e..f284ca287e0d0543ac9a18ad0eeec3fb821d8038 100644 (file)
@@ -19,7 +19,7 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: openssl_link.c,v 1.52 2002/12/13 02:37:35 marka Exp $
+ * $Id: openssl_link.c,v 1.53 2002/12/13 02:51:40 marka Exp $
  */
 #ifdef OPENSSL
 
@@ -56,7 +56,6 @@ static int nlocks;
 static ENGINE *e;
 #endif
 
-static isc_mem_t *openssl__memory_pool = NULL;
 
 static int
 entropy_get(unsigned char *buf, int num) {
@@ -103,22 +102,22 @@ id_callback(void) {
 
 static void *
 mem_alloc(size_t size) {
-       INSIST(openssl__memory_pool != NULL);
-       return (isc_mem_allocate(openssl__memory_pool, size));
+       INSIST(dst__memory_pool != NULL);
+       return (isc_mem_allocate(dst__memory_pool, size));
 }
 
 static void
 mem_free(void *ptr) {
-       INSIST(openssl__memory_pool != NULL);
+       INSIST(dst__memory_pool != NULL);
        if (ptr != NULL)
-               isc_mem_free(openssl__memory_pool, ptr);
+               isc_mem_free(dst__memory_pool, ptr);
 }
 
 static void *
 mem_realloc(void *ptr, size_t size) {
        void *p;
 
-       INSIST(openssl__memory_pool != NULL);
+       INSIST(dst__memory_pool != NULL);
        p = NULL;
        if (size > 0) {
                p = mem_alloc(size);
@@ -131,14 +130,9 @@ mem_realloc(void *ptr, size_t size) {
 }
 
 isc_result_t
-dst__openssl_init(void) {
+dst__openssl_init() {
        isc_result_t result;
 
-        result = isc_mem_create(0, 0, &openssl__memory_pool);
-        if (result != ISC_R_SUCCESS)
-                return (result);
-        isc_mem_setdestroycheck(openssl__memory_pool, ISC_FALSE);
-
        CRYPTO_set_mem_functions(mem_alloc, mem_realloc, mem_free);
        nlocks = CRYPTO_num_locks();
        locks = mem_alloc(sizeof(isc_mutex_t) * nlocks);
@@ -185,7 +179,7 @@ dst__openssl_init(void) {
 }
 
 void
-dst__openssl_destroy(void) {
+dst__openssl_destroy() {
        ERR_clear_error();
 #ifdef USE_ENGINE
        if (e != NULL)
@@ -197,8 +191,6 @@ dst__openssl_destroy(void) {
        }
        if (rm != NULL)
                mem_free(rm);
-       if (openssl__memory_pool != NULL)
-               isc_mem_detach(&openssl__memory_pool);
 }
 
 isc_result_t
@@ -220,23 +212,7 @@ dst__openssl_toresult(isc_result_t fallback) {
 #else /* OPENSSL */
 
 #include <isc/util.h>
-#include "dst_internal.h"
-#include "dst_openssl.h"
-
-isc_result_t
-dst__openssl_init(void) {
-       return (ISC_R_NOTIMPLEMENTED);
-}
 
-void
-dst__openssl_destroy(void) {
-       /* empty */
-}
-
-isc_result_t
-dst__openssl_toresult(isc_result_t fallback) {
-       UNUSED(fallback);
-       return (ISC_R_NOTIMPLEMENTED);
-}
+EMPTY_TRANSLATION_UNIT
 
 #endif /* OPENSSL */
index 2615447f47282db39649c588ccb04d38979ea841..55ff695844ee49b98b71913f2192a37ac95ede04 100644 (file)
@@ -19,7 +19,7 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: openssldh_link.c,v 1.49 2002/12/13 02:37:35 marka Exp $
+ * $Id: openssldh_link.c,v 1.50 2002/12/13 02:51:40 marka Exp $
  */
 
 #ifdef OPENSSL
@@ -602,17 +602,8 @@ dst__openssldh_init(dst_func_t **funcp) {
 
 #else /* OPENSSL */
 
-#include <config.h>
 #include <isc/util.h>
-#include <stdlib.h>            /* NULL */
-#include "dst_internal.h"
 
-isc_result_t
-dst__openssldh_init(dst_func_t **funcp) {
-       REQUIRE(funcp != NULL);
-       UNUSED(funcp);
-       
-       return (ISC_R_NOTIMPLEMENTED);
-}
+EMPTY_TRANSLATION_UNIT
 
 #endif /* OPENSSL */
index dfd14beb23b6c0453aba7499d14eb1dadc46118c..4f3a443f36ddfef28dd0862f10687bd76f1d268f 100644 (file)
@@ -17,7 +17,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: openssldsa_link.c,v 1.12 2002/12/13 02:37:35 marka Exp $ */
+/* $Id: openssldsa_link.c,v 1.13 2002/12/13 02:51:41 marka Exp $ */
 
 #ifdef OPENSSL
 
@@ -437,17 +437,8 @@ dst__openssldsa_init(dst_func_t **funcp) {
 
 #else /* OPENSSL */
 
-#include <config.h>
-#include <stdlib.h>
 #include <isc/util.h>
-#include "dst_internal.h"
 
-isc_result_t
-dst__openssldsa_init(dst_func_t **funcp) {
-       REQUIRE(funcp != NULL);
-       UNUSED(funcp);
-
-       return (ISC_R_NOTIMPLEMENTED);
-}
+EMPTY_TRANSLATION_UNIT
 
 #endif /* OPENSSL */
index 2d3646b96dca4fec2eabe68b1a54881209bf3a7e..2214fc3e27e84f3233345c9062c3230a6cc517b0 100644 (file)
@@ -17,7 +17,7 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: opensslrsa_link.c,v 1.24 2002/12/13 02:37:35 marka Exp $
+ * $Id: opensslrsa_link.c,v 1.25 2002/12/13 02:51:41 marka Exp $
  */
 #ifdef OPENSSL
 
@@ -521,17 +521,8 @@ dst__opensslrsa_init(dst_func_t **funcp) {
 
 #else /* OPENSSL */
 
-#include <config.h>
-#include <stdlib.h>
 #include <isc/util.h>
-#include "dst_internal.h"
 
-isc_result_t
-dst__opensslrsa_init(dst_func_t **funcp) {
-       REQUIRE(funcp != NULL);
-       UNUSED(funcp);
-
-       return (ISC_R_NOTIMPLEMENTED);
-}
+EMPTY_TRANSLATION_UNIT
 
 #endif /* OPENSSL */