[SCM] Resolv Wrapper Repository - branch master updated

Andreas Schneider asn at samba.org
Tue Aug 28 09:49:24 UTC 2018


The branch, master has been updated
       via  6a50539 cmake: Do not misuse CMAKE_REQUIRED_LIBRARIES
       via  789d744 ctest: Move to new dashboard
       via  0c517c1 rwrap: Update header
       via  779bb4b Update LICENSE
       via  d1c812e Rename COPYING to LICENSE
       via  1935ab3 cpack: Do not package build dirs in source tarball
       via  2134d30 cmake: Replace deprecated get_target_property()
       via  479de39 rwrap: Only report a notice when a search doesn't have a result
       via  f068cda rwrap: Only warn if we can't open the dns hosts file
       via  e192b69 rwrap: Add NOTICE as log level
       via  c7777b9 rwrap: Do an early return if log level doesn't match
       via  c87f179 rwrap: Always enable logging
      from  442facb Bump version to 1.1.5

https://git.samba.org/?p=resolv_wrapper.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 6a505393df5546311562784526bf12b5c4ced39f
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Aug 28 11:44:38 2018 +0200

    cmake: Do not misuse CMAKE_REQUIRED_LIBRARIES
    
    This will lead to issues detecting features.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 789d7442237bff98a87489ab9a93e1f51348cbd5
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Jul 5 10:17:02 2018 +0200

    ctest: Move to new dashboard
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 0c517c1389205e5ce95cc9f4260dba56332b306f
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jun 22 09:12:01 2018 +0200

    rwrap: Update header
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 779bb4bbef992c6f84be31757f49b1031e1935f1
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jun 22 09:11:33 2018 +0200

    Update LICENSE
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit d1c812e4a9cd2917b81e9eae9232cb407341a22e
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jun 22 09:09:38 2018 +0200

    Rename COPYING to LICENSE
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 1935ab38dca67a123cbf061b0a2946dbbf58f0af
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jun 22 09:06:59 2018 +0200

    cpack: Do not package build dirs in source tarball
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 2134d30b7a8d92090828704f691332f4df685f61
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jun 22 09:08:28 2018 +0200

    cmake: Replace deprecated get_target_property()
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 479de398ab791c24a6d22be04c3c01938d370f15
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Jul 18 10:23:20 2017 +0200

    rwrap: Only report a notice when a search doesn't have a result
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit f068cda262ea8cc17f3867190f9d29abeb93e9a8
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Jul 18 10:22:38 2017 +0200

    rwrap: Only warn if we can't open the dns hosts file
    
    It is possible that it hasn't been created yet. At least in Samba when
    we start the test environment.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit e192b69a723905aba796a061913fd3ab52926e9a
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Jul 18 10:16:21 2017 +0200

    rwrap: Add NOTICE as log level
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit c7777b96c52a4d87543a6ffdf941bae1a44b12b5
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Jul 18 10:12:39 2017 +0200

    rwrap: Do an early return if log level doesn't match
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit c87f179b8ec238820c913ca0cf8d852603e8f0b7
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Jul 18 10:11:22 2017 +0200

    rwrap: Always enable logging
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 CPackConfig.cmake     |  4 +--
 CTestConfig.cmake     |  6 ++---
 ConfigureChecks.cmake | 31 ++++++++++-------------
 COPYING => LICENSE    |  4 ++-
 src/CMakeLists.txt    |  7 +-----
 src/resolv_wrapper.c  | 68 ++++++++++++++++++++++++++-------------------------
 6 files changed, 57 insertions(+), 63 deletions(-)
 rename COPYING => LICENSE (90%)


Changeset truncated at 500 lines:

diff --git a/CPackConfig.cmake b/CPackConfig.cmake
index 0d9bd8d..36086cf 100644
--- a/CPackConfig.cmake
+++ b/CPackConfig.cmake
@@ -7,7 +7,7 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The resolv wrapper")
 set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README")
 set(CPACK_PACKAGE_VENDOR "The Samba Team")
 set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
 
 
 ### versions
@@ -19,7 +19,7 @@ set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSIO
 
 ### source generator
 set(CPACK_SOURCE_GENERATOR "TGZ")
-set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]svn/;/[.]git/;.gitignore;/build/;/obj/;tags;cscope.*")
+set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]svn/;/[.]git/;.gitignore;/build*;/obj*;tags;cscope.*")
 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
 
 if (WIN32)
diff --git a/CTestConfig.cmake b/CTestConfig.cmake
index 53beb9e..a9e82f8 100644
--- a/CTestConfig.cmake
+++ b/CTestConfig.cmake
@@ -1,9 +1,9 @@
 set(UPDATE_TYPE "true")
 
-set(CTEST_PROJECT_NAME "resolvwrapper")
+set(CTEST_PROJECT_NAME "resolv_wrapper")
 set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
 
 set(CTEST_DROP_METHOD "https")
-set(CTEST_DROP_SITE "mock.cryptomilk.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=resolvwrapper")
+set(CTEST_DROP_SITE "test.cmocka.org")
+set(CTEST_DROP_LOCATION "/submit.php?project=${CTEST_PROJECT_NAME}")
 set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 44de342..fec66d0 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -52,16 +52,12 @@ check_include_file(resolv.h HAVE_RESOLV_H)
 check_include_file(arpa/nameser.h HAVE_ARPA_NAMESER_H)
 
 # FUNCTIONS
-set(CMAKE_REQUIRED_LIBRARIES)
-
 find_library(RESOLV_LIRBRARY resolv)
-
 if (RESOLV_LIRBRARY)
     check_library_exists(${RESOLV_LIRBRARY} res_send "" RES_SEND_IN_LIBRESOLV)
     check_library_exists(${RESOLV_LIRBRARY} __res_send "" __RES_SEND_IN_LIBRESOLV)
     if (RES_SEND_IN_LIBRESOLV OR __RES_SEND_IN_LIBRESOLV)
         set(HAVE_LIBRESOLV TRUE)
-        set(CMAKE_REQUIRED_LIBRARIES ${RESOLV_LIRBRARY})
     endif()
 endif()
 
@@ -100,26 +96,25 @@ check_symbol_exists(ns_name_compress "sys/types.h;arpa/nameser.h" HAVE_NS_NAME_C
 if (UNIX)
     if (NOT LINUX)
         # libsocket (Solaris)
-        check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET)
-        if (HAVE_LIBSOCKET)
-          set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} socket)
-        endif (HAVE_LIBSOCKET)
+        find_library(SOCKET_LIBRARY socket)
+        if (SOCKET_LIBRARY)
+            check_library_exists(${SOCKET_LIBRARY} getaddrinfo "" HAVE_LIBSOCKET)
+        endif()
 
         # libnsl/inet_pton (Solaris)
-        check_library_exists(nsl inet_pton "" HAVE_LIBNSL)
-        if (HAVE_LIBNSL)
-            set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} nsl)
-        endif (HAVE_LIBNSL)
+        find_library(NSL_LIBRARY nsl)
+        if (NSL_LIBRARY)
+            check_library_exists(${NSL_LIBRARY} inet_pton "" HAVE_LIBNSL)
+        endif()
     endif (NOT LINUX)
 
     check_function_exists(getaddrinfo HAVE_GETADDRINFO)
 endif (UNIX)
 
-check_library_exists(dl dlopen "" HAVE_LIBDL)
-if (HAVE_LIBDL)
-    find_library(DLFCN_LIBRARY dl)
-    set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${DLFCN_LIBRARY})
-endif (HAVE_LIBDL)
+find_library(DLFCN_LIBRARY dl)
+if (DLFCN_LIBRARY)
+    check_library_exists(${DLFCN_LIBRARY} dlopen "" HAVE_LIBDL)
+endif()
 
 # IPV6
 check_c_source_compiles("
@@ -177,4 +172,4 @@ int main(void) {
 # ENDIAN
 test_big_endian(WORDS_BIGENDIAN)
 
-set(RWRAP_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CACHE INTERNAL "resolv_wrapper required system libraries")
+set(RWRAP_REQUIRED_LIBRARIES ${RESOLV_LIRBRARY} ${DLFCN_LIBRARY} ${SOCKET_LIBRARY} ${NSL_LIBRARY} CACHE INTERNAL "resolv_wrapper required system libraries")
diff --git a/COPYING b/LICENSE
similarity index 90%
rename from COPYING
rename to LICENSE
index 6914df0..994abe6 100644
--- a/COPYING
+++ b/LICENSE
@@ -1,5 +1,7 @@
-Copyright (c) Andreas Schneider 2014 <asn at samba.org>
+BSD 3-Clause License
 
+Copyright (c) 2014-2018, Andreas Schneider <asn at samba.org>
+Copyright (c) 2014-2016, Jakub Hrozek <jakub.hrozek at posteo.se>
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index de9f6d0..e95903f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -21,9 +21,4 @@ install(
   ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
 )
 
-# This needs to be at the end
-if (POLICY CMP0026)
-    cmake_policy(SET CMP0026 OLD)
-endif()
-get_target_property(RWRAP_LOCATION resolv_wrapper LOCATION)
-set(RESOLV_WRAPPER_LOCATION ${RWRAP_LOCATION} PARENT_SCOPE)
+set(RESOLV_WRAPPER_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}resolv_wrapper${CMAKE_SHARED_LIBRARY_SUFFIX}" PARENT_SCOPE)
diff --git a/src/resolv_wrapper.c b/src/resolv_wrapper.c
index c6f06e3..5a243b1 100644
--- a/src/resolv_wrapper.c
+++ b/src/resolv_wrapper.c
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2014      Andreas Schneider <asn at samba.org>
- * Copyright (c) 2014      Jakub Hrozek <jakub.hrozek at posteo.se>
+ * Copyright (c) 2014-2018 Andreas Schneider <asn at samba.org>
+ * Copyright (c) 2014-2016 Jakub Hrozek <jakub.hrozek at posteo.se>
  *
  * All rights reserved.
  *
@@ -78,14 +78,11 @@
 enum rwrap_dbglvl_e {
 	RWRAP_LOG_ERROR = 0,
 	RWRAP_LOG_WARN,
+	RWRAP_LOG_NOTICE,
 	RWRAP_LOG_DEBUG,
 	RWRAP_LOG_TRACE
 };
 
-#ifdef NDEBUG
-# define RWRAP_LOG(...)
-#else /* NDEBUG */
-
 static void rwrap_log(enum rwrap_dbglvl_e dbglvl, const char *func, const char *format, ...) PRINTF_ATTRIBUTE(3, 4);
 # define RWRAP_LOG(dbglvl, ...) rwrap_log((dbglvl), __func__, __VA_ARGS__)
 
@@ -98,42 +95,46 @@ static void rwrap_log(enum rwrap_dbglvl_e dbglvl,
 	const char *d;
 	unsigned int lvl = 0;
 	int pid = getpid();
+	const char *prefix = NULL;
 
 	d = getenv("RESOLV_WRAPPER_DEBUGLEVEL");
 	if (d != NULL) {
 		lvl = atoi(d);
 	}
 
+	if (lvl < dbglvl) {
+		return;
+	}
+
 	va_start(va, format);
 	vsnprintf(buffer, sizeof(buffer), format, va);
 	va_end(va);
 
-	if (lvl >= dbglvl) {
-		switch (dbglvl) {
-			case RWRAP_LOG_ERROR:
-				fprintf(stderr,
-					"RWRAP_ERROR(%d) - %s: %s\n",
-					pid, func, buffer);
-				break;
-			case RWRAP_LOG_WARN:
-				fprintf(stderr,
-					"RWRAP_WARN(%d) - %s: %s\n",
-					pid, func, buffer);
-				break;
-			case RWRAP_LOG_DEBUG:
-				fprintf(stderr,
-					"RWRAP_DEBUG(%d) - %s: %s\n",
-					pid, func, buffer);
-				break;
-			case RWRAP_LOG_TRACE:
-				fprintf(stderr,
-					"RWRAP_TRACE(%d) - %s: %s\n",
-					pid, func, buffer);
-				break;
-		}
+	switch (dbglvl) {
+		case RWRAP_LOG_ERROR:
+			prefix = "RWRAP_ERROR";
+			break;
+		case RWRAP_LOG_WARN:
+			prefix = "RWRAP_WARN";
+			break;
+		case RWRAP_LOG_NOTICE:
+			prefix = "RWRAP_NOTICE";
+			break;
+		case RWRAP_LOG_DEBUG:
+			prefix = "RWRAP_DEBUG";
+			break;
+		case RWRAP_LOG_TRACE:
+			prefix = "RWRAP_TRACE";
+			break;
 	}
+
+	fprintf(stderr,
+		"%s(%d) - %s: %s\n",
+		prefix,
+		pid,
+		func,
+		buffer);
 }
-#endif /* NDEBUG RWRAP_LOG */
 
 #ifndef SAFE_FREE
 #define SAFE_FREE(x) do { if ((x) != NULL) {free(x); (x)=NULL;} } while(0)
@@ -852,7 +853,7 @@ static int rwrap_get_record(const char *hostfile, unsigned recursion,
 
 	fp = fopen(hostfile, "r");
 	if (fp == NULL) {
-		RWRAP_LOG(RWRAP_LOG_ERROR,
+		RWRAP_LOG(RWRAP_LOG_WARN,
 			  "Opening %s failed: %s",
 			  hostfile, strerror(errno));
 		return -1;
@@ -1195,8 +1196,9 @@ static int rwrap_res_fake_hosts(const char *hostfile,
 		resp_size = rwrap_fake_empty(type, rrs->key, answer, anslen);
 		break;
 	default:
-		RWRAP_LOG(RWRAP_LOG_ERROR,
-				"Error searching for [%s]\n", query_name);
+		RWRAP_LOG(RWRAP_LOG_NOTICE,
+			  "Searching for [%s] did not return any results\n",
+			  query_name);
 		free(query_name);
 		return -1;
 	}


-- 
Resolv Wrapper Repository



More information about the samba-cvs mailing list