From: Brian Aker Date: Tue, 13 Nov 2012 12:52:03 +0000 (-0500) Subject: First pass through fixing SASL. X-Git-Tag: 1.0.14~1 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=f006a1e25c398dd131668233b842b6be0b8200dd;p=awesomized%2Flibmemcached First pass through fixing SASL. --- diff --git a/clients/include.am b/clients/include.am index 98319e1e..7758e483 100644 --- a/clients/include.am +++ b/clients/include.am @@ -6,10 +6,6 @@ CLIENTS_LDADDS= CLIENTS_LDADDS+= clients/libutilities.la CLIENTS_LDADDS+= libmemcached/libmemcached.la -if HAVE_SASL -CLIENTS_LDADDS+= $(LIBSASL) -endif - bin_PROGRAMS+= clients/memcapable bin_PROGRAMS+= clients/memcat bin_PROGRAMS+= clients/memcp diff --git a/clients/memping.cc b/clients/memping.cc index 983447f1..39b4fbe6 100644 --- a/clients/memping.cc +++ b/clients/memping.cc @@ -144,6 +144,7 @@ void options_parse(int argc, char *argv[]) case OPT_USERNAME: opt_username= optarg; + opt_binary= true; break; case OPT_PASSWD: diff --git a/clients/memstat.cc b/clients/memstat.cc index e50f2453..ae6a3565 100644 --- a/clients/memstat.cc +++ b/clients/memstat.cc @@ -47,6 +47,8 @@ static bool opt_analyze= false; static char *opt_servers= NULL; static char *stat_args= NULL; static char *analyze_mode= NULL; +static char *opt_username; +static char *opt_passwd; static struct option long_options[]= { @@ -60,6 +62,8 @@ static struct option long_options[]= {(OPTIONSTRING)"server-version", no_argument, NULL, OPT_SERVER_VERSION}, {(OPTIONSTRING)"servers", required_argument, NULL, OPT_SERVERS}, {(OPTIONSTRING)"analyze", optional_argument, NULL, OPT_ANALYZE}, + {(OPTIONSTRING)"username", required_argument, NULL, OPT_USERNAME}, + {(OPTIONSTRING)"password", required_argument, NULL, OPT_PASSWD}, {0, 0, 0, 0}, }; @@ -124,6 +128,24 @@ int main(int argc, char *argv[]) memcached_return_t rc= memcached_server_push(memc, servers); memcached_server_list_free(servers); + if (opt_username and LIBMEMCACHED_WITH_SASL_SUPPORT == 0) + { + memcached_free(memc); + std::cerr << "--username was supplied, but binary was not built with SASL support." << std::endl; + return EXIT_FAILURE; + } + + if (opt_username) + { + memcached_return_t ret; + if (memcached_failed(ret= memcached_set_sasl_auth_data(memc, opt_username, opt_passwd))) + { + std::cerr << memcached_last_error_message(memc) << std::endl; + memcached_free(memc); + return EXIT_FAILURE; + } + } + if (rc != MEMCACHED_SUCCESS and rc != MEMCACHED_SOME_ERRORS) { printf("Failure to communicate with servers (%s)\n", @@ -394,6 +416,15 @@ static void options_parse(int argc, char *argv[]) close_stdio(); break; + case OPT_USERNAME: + opt_username= optarg; + opt_binary= true; + break; + + case OPT_PASSWD: + opt_passwd= optarg; + break; + case '?': /* getopt_long already printed an error message. */ exit(1); diff --git a/configure.ac b/configure.ac index 0d421155..451d139d 100644 --- a/configure.ac +++ b/configure.ac @@ -75,18 +75,17 @@ LIBMEMCACHED_PROTOCOL # Adding support for libtest m4_include([libtest/yatl.m4]) -m4_include([m4/memcached_sasl.m4]) -m4_include([m4/gearmand.m4]) -m4_include([m4/libgearman.m4]) +CHECK_FOR_GEARMAND +CHECK_FOR_LIBGEARMAND -AM_CONDITIONAL([BUILDING_LIBMEMCACHED], [true]) -AM_CONDITIONAL([HAVE_LIBMEMCACHED], [false]) -AM_CONDITIONAL([HAVE_LIBDRIZZLE], [false]) -AC_DEFINE([HAVE_LIBMEMCACHED], [1], [Enables libmemcached Support]) +AM_CONDITIONAL([BUILDING_LIBMEMCACHED],[true]) +AM_CONDITIONAL([HAVE_LIBMEMCACHED],[false]) +AM_CONDITIONAL([HAVE_LIBDRIZZLE],[false]) +AC_DEFINE([HAVE_LIBMEMCACHED],[1],[Enables libmemcached Support]) -AM_CONDITIONAL([BUILDING_GEARMAN], [false]) +AM_CONDITIONAL([BUILDING_GEARMAN],[false]) -dnl Specialty checks +# Specialty checks AX_CXX_CINTTYPES CONFIG_EXTRA DETECT_BYTEORDER @@ -207,30 +206,19 @@ AC_C_RESTRICT AX_CXX_GCC_ABI_DEMANGLE -AX_SASL_CHECK AX_LIBEVENT -# -# The sasl functions should only be visible if we build with sasl support -# -AS_IF([test "x$ac_enable_sasl" = "xyes"], - [LIBMEMCACHED_WITH_SASL_SUPPORT="#define LIBMEMCACHED_WITH_SASL_SUPPORT 1"], - [LIBMEMCACHED_WITH_SASL_SUPPORT="#define LIBMEMCACHED_WITH_SASL_SUPPORT 0"]) -AC_SUBST([LIBMEMCACHED_WITH_SASL_SUPPORT]) - AC_CHECK_LIB([rt],[clock_gettime], - [RT_LIB="-lrt" - AC_SUBST(RT_LIB) - AC_DEFINE([HAVE_CLOCK_GETTIME], [ 1 ], [Have clock_gettime])], - [AC_DEFINE([HAVE_CLOCK_GETTIME], [ 0 ], [Have clock_gettime])]) + [AC_SUBST([RT_LIB],[-lrt]) + AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Have clock_gettime])], + [AC_DEFINE([HAVE_CLOCK_GETTIME],[0],[Have clock_gettime])]) # Check for the ability to call dlopen AS_IF([test "x$enable_static" = "xyes"], [AC_CHECK_LIB([dl],[dlopen], - [DL_LIB="-ldl" - AC_SUBST([DL_LIB]) - AC_DEFINE([HAVE_LIBDL],[1],[Have dlopen])])], - [AC_DEFINE([HAVE_LIBDL], [0], [Have dlopen])]) + [AC_SUBST([DL_LIB],[-ldl]) + AC_DEFINE([HAVE_LIBDL],[1],[Have dlopen])])], + [AC_DEFINE([HAVE_LIBDL], [0], [Have dlopen])]) AC_CHECK_LIB([m],[floor]) AC_CHECK_FUNCS([sigignore]) @@ -249,12 +237,12 @@ AC_DEFINE([GEARMAND_BLOBSLAP_WORKER],[0],[Support for Gearman Blobslap worker]) AC_DEFINE([HAVE_LIBPQ],[0],[Support for Postgres]) AC_DEFINE([HAVE_LIBCURL],[0],[Support for libcurl]) -dnl Check for the requirements for running memcached with less privileges -dnl than the default privilege set. On Solaris we need setppriv and priv.h -dnl If you want to add support for other platforms you should check for -dnl your requirements, define HAVE_DROP_PRIVILEGES, and make sure you add -dnl the source file containing the implementation into memcached_SOURCE -dnl in Makefile.am +# Check for the requirements for running memcached with less privileges +# than the default privilege set. On Solaris we need setppriv and priv.h +# If you want to add support for other platforms you should check for +# your requirements, define HAVE_DROP_PRIVILEGES, and make sure you add +# the source file containing the implementation into memcached_SOURCE +# in Makefile.am AC_CHECK_FUNCS([setppriv], [AC_CHECK_HEADER([priv.h], [AC_DEFINE([HAVE_DROP_PRIVILEGES], @@ -276,8 +264,20 @@ SOCKET_SEND_FLAGS AX_UUID_GENERATE_TIME_SAFE -AX_PTHREAD(, [AC_MSG_ERROR([could not find libpthread])]) -AX_PTHREAD_TIMEDJOIN_NP +AC_DEFUN([CHECK_FOR_PTHREAD_AND_SASL], + [AX_PTHREAD(, [AC_MSG_ERROR([could not find libpthread])]) + AX_PTHREAD_TIMEDJOIN_NP + + # The sasl functions should only be visible if we build with sasl support + # + AX_SASL_OPTION + AS_IF([test "x$ac_enable_sasl" = xyes], + [LIBMEMCACHED_WITH_SASL_SUPPORT="#define LIBMEMCACHED_WITH_SASL_SUPPORT 1"], + [LIBMEMCACHED_WITH_SASL_SUPPORT="#define LIBMEMCACHED_WITH_SASL_SUPPORT 0"]) + AC_SUBST([LIBMEMCACHED_WITH_SASL_SUPPORT]) + ]) +CHECK_FOR_PTHREAD_AND_SASL + # backtrace() does not work with static builds. AS_IF([test "x$enable_static" = "xyes"], @@ -313,7 +313,7 @@ echo " * LIB Flags: $LIB" echo " * Assertions enabled: $ax_enable_assert" echo " * Debug enabled: $ax_enable_debug" echo " * Warnings as failure: $ac_cv_warnings_as_errors" -echo " * SASL support: $ac_enable_sasl" +echo " * SASL support: $ax_sasl_option" echo " * make -j: $enable_jobserver" echo " * VCS checkout: $ac_cv_vcs_checkout" echo "" diff --git a/libmemcached/connect.cc b/libmemcached/connect.cc index da6cf802..7efdd8fe 100644 --- a/libmemcached/connect.cc +++ b/libmemcached/connect.cc @@ -734,6 +734,7 @@ static memcached_return_t _memcached_connect(org::libmemcached::Instance* server if (server->fd != INVALID_SOCKET and server->root->sasl.callbacks) { rc= memcached_sasl_authenticate_connection(server); + fprintf(stderr, "%s:%d %s\n", __FILE__, __LINE__, memcached_strerror(NULL, rc)); if (memcached_failed(rc) and server->fd != INVALID_SOCKET) { WATCHPOINT_ASSERT(server->fd != INVALID_SOCKET); diff --git a/libmemcached/include.am b/libmemcached/include.am index 13304e62..20be40f9 100644 --- a/libmemcached/include.am +++ b/libmemcached/include.am @@ -118,10 +118,9 @@ libmemcached_libmemcached_la_LDFLAGS+= -version-info ${MEMCACHED_LIBRARY_VERSION libmemcached_libmemcached_la_LDFLAGS+= $(DL_LIB) if HAVE_SASL -libmemcached_libmemcached_la_CXXFLAGS+= $(LIBSASL_CPPFLAGS) -libmemcached_libmemcached_la_CXXFLAGS+= $(PTHREAD_CFLAGS) -libmemcached_libmemcached_la_LIBADD+= $(PTHREAD_LIBS) -libmemcached_libmemcached_la_LIBADD+= $(LIBSASL_LDFLAGS) +libmemcached_libmemcached_la_CXXFLAGS+= @PTHREAD_CFLAGS@ +libmemcached_libmemcached_la_LIBADD+= @PTHREAD_LIBS@ +libmemcached_libmemcached_la_LIBADD+= @SASL_LDFLAGS@ endif if HAVE_DTRACE diff --git a/libmemcached/sasl.cc b/libmemcached/sasl.cc index 67a31bbd..721ff791 100644 --- a/libmemcached/sasl.cc +++ b/libmemcached/sasl.cc @@ -2,7 +2,7 @@ * * Libmemcached library * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ + * Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/ * Copyright (C) 2006-2009 Brian Aker All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,7 +35,7 @@ * */ -#include +#include "libmemcached/common.h" #include #if defined(LIBMEMCACHED_WITH_SASL_SUPPORT) && LIBMEMCACHED_WITH_SASL_SUPPORT @@ -65,7 +65,7 @@ sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr) * @param raddr remote address (out) * @return true on success false otherwise (errno contains more info) */ -static memcached_return_t resolve_names(memcached_instance_st& server, char *laddr, size_t laddr_length, char *raddr, size_t raddr_length) +static memcached_return_t resolve_names(org::libmemcached::Instance& server, char *laddr, size_t laddr_length, char *raddr, size_t raddr_length) { char host[NI_MAXHOST]; char port[NI_MAXSERV]; @@ -148,15 +148,15 @@ memcached_return_t memcached_sasl_authenticate_connection(org::libmemcached::Ins */ protocol_binary_request_no_extras request= { }; - initialize_binary_request(ptr, request.message.header); + initialize_binary_request(server, request.message.header); request.message.header.request.opcode= PROTOCOL_BINARY_CMD_SASL_LIST_MECHS; - if (memcached_io_write(server, request.bytes, - sizeof(request.bytes), 1) != sizeof(request.bytes)) + if (memcached_io_write(server, request.bytes, sizeof(request.bytes), true) != sizeof(request.bytes)) { return MEMCACHED_WRITE_FAILURE; } + assert_msg(server->fd != INVALID_SOCKET, "Programmer error, invalid socket"); memcached_server_response_increment(server); @@ -177,6 +177,7 @@ memcached_return_t memcached_sasl_authenticate_connection(org::libmemcached::Ins return rc; } + assert_msg(server->fd != INVALID_SOCKET, "Programmer error, invalid socket"); /* set ip addresses */ char laddr[NI_MAXHOST + NI_MAXSERV]; @@ -242,19 +243,23 @@ memcached_return_t memcached_sasl_authenticate_connection(org::libmemcached::Ins { data, len } }; + assert_msg(server->fd != INVALID_SOCKET, "Programmer error, invalid socket"); if (memcached_io_writev(server, vector, 3, true) == false) { rc= MEMCACHED_WRITE_FAILURE; break; } + assert_msg(server->fd != INVALID_SOCKET, "Programmer error, invalid socket"); memcached_server_response_increment(server); /* read the response */ + assert_msg(server->fd != INVALID_SOCKET, "Programmer error, invalid socket"); rc= memcached_response(server, NULL, 0, NULL); if (rc != MEMCACHED_AUTH_CONTINUE) { break; } + assert_msg(server->fd != INVALID_SOCKET, "Programmer error, invalid socket"); ret= sasl_client_step(conn, memcached_result_value(&server->root->result), (unsigned int)memcached_result_length(&server->root->result), diff --git a/libtest/memcached.cc b/libtest/memcached.cc index b59dc22f..d2ce941e 100644 --- a/libtest/memcached.cc +++ b/libtest/memcached.cc @@ -89,7 +89,7 @@ public: virtual const char *sasl() const { - return NULL; + return "-S"; } const std::string& password() const @@ -210,7 +210,7 @@ bool Memcached::build(size_t argc, const char *argv[]) add_option("-M"); #endif - if (sasl()) + if (_username.size()) { add_option(sasl()); } diff --git a/libtest/server_container.cc b/libtest/server_container.cc index 113f085c..05997238 100644 --- a/libtest/server_container.cc +++ b/libtest/server_container.cc @@ -241,7 +241,7 @@ bool server_startup_st::start_server(const std::string& server_type, in_port_t t } else if (server_type.compare("memcached-sasl") == 0) { - if (MEMCACHED_SASL_BINARY) + if (MEMCACHED_BINARY) { if (HAVE_LIBMEMCACHED) { diff --git a/m4/ax_sasl.m4 b/m4/ax_sasl.m4 index b2b91de7..48b05c74 100644 --- a/m4/ax_sasl.m4 +++ b/m4/ax_sasl.m4 @@ -5,10 +5,11 @@ # SYNOPSIS # # AX_SASL +# AX_SASL_CHECK # # DESCRIPTION # -# Check for sasl version one or two support. +# Check to see if libsasl is requested and available. # # LICENSE # @@ -19,37 +20,34 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 1 +#serial 2 -AC_DEFUN([AX_SASL_OPTION],[ - AC_REQUIRE([AX_SASL_CHECK]) - AC_ARG_ENABLE([sasl], +AC_DEFUN([AX_SASL_OPTION], + [AC_ARG_ENABLE([sasl], [AS_HELP_STRING([--disable-sasl], [Build with sasl support @<:@default=on@:>@])], [ac_enable_sasl="$enableval"], - [ac_enable_sasl="yes"]) - - AS_IF([test "x$ac_enable_sasl" = "xyes"], - [ac_enable_sasl="yes"], - [ac_enable_sasl="no"]) - - AS_IF([test "x$ac_enable_sasl" = "xyes"], [ - AC_DEFINE([HAVE_LIBSASL], [ 1 ], [Have libsasl2]) - ], [ - AC_DEFINE([HAVE_LIBSASL], [ 0 ], [Have libsasl2]) + [ac_enable_sasl=yes]) + + ax_sasl_option=no + AS_IF([test "x${ac_enable_sasl}" = xyes], + [AX_SASL_CHECK + echo "$ax_sasl_check" + AS_IF([test "x${ax_sasl_check}" = xyes], + [ax_sasl_option=yes], + [AC_MSG_WARN([request to add sasl support failed, please see config.log])]) ]) - AM_CONDITIONAL(HAVE_SASL, test "x${ac_enable_sasl}" = "xyes") - + AC_MSG_CHECKING([checking to see if enabling sasl]) + AC_MSG_RESULT(["$ax_sasl_option"]) + AM_CONDITIONAL([HAVE_SASL],[test "x${ax_sasl_option}" = xyes]) ]) -AC_DEFUN([AX_SASL_CHECK],[ - - AX_CHECK_LIBRARY([LIBSASL], [sasl/sasl.h], [sasl2],[ - LIBSASL_LDFLAGS="-lsasl2" - ax_cv_sasl=yes - ], [ - ax_cv_sasl=no +AC_DEFUN([AX_SASL_CHECK], + [ax_sasl_check=no + AX_CHECK_LIBRARY([LIBSASL],[sasl/sasl.h],[sasl2], + [ax_sasl_check=yes + AC_SUBST([SASL_LDFLAGS],[[-lsasl2]]) ]) - - AM_CONDITIONAL(HAVE_SASL, test "x${ac_enable_sasl}" = "xyes") + AC_MSG_CHECKING([checking to see if sasl works]) + AC_MSG_RESULT(["$ax_sasl_check"]) ]) diff --git a/m4/gearmand.m4 b/m4/gearmand.m4 index 7765acec..8b1659dc 100644 --- a/m4/gearmand.m4 +++ b/m4/gearmand.m4 @@ -1,11 +1,9 @@ -AX_WITH_PROG(GEARMAND_BINARY,gearmand) -AS_IF([test -f "$ac_cv_path_GEARMAND_BINARY"], - [ - AC_DEFINE([HAVE_GEARMAND_BINARY], [1], [If Gearmand binary is available]) - AC_DEFINE_UNQUOTED([GEARMAND_BINARY], "$ac_cv_path_GEARMAND_BINARY", [Name of the gearmand binary used in make test]) - ], - [ - AC_DEFINE([HAVE_GEARMAND_BINARY], [0], [If Gearmand binary is available]) - AC_DEFINE([GEARMAND_BINARY], [0], [Name of the gearmand binary used in make test]) - ]) - +# serial 1 +AC_DEFUN([CHECK_FOR_GEARMAND], + [AX_WITH_PROG([GEARMAND_BINARY],[gearmand]) + AS_IF([test -f "$ac_cv_path_GEARMAND_BINARY"], + [AC_DEFINE([HAVE_GEARMAND_BINARY],[1],[If Gearmand binary is available]) + AC_DEFINE_UNQUOTED([GEARMAND_BINARY], "$ac_cv_path_GEARMAND_BINARY", [Name of the gearmand binary used in make test])], + [AC_DEFINE([HAVE_GEARMAND_BINARY],[0],[If Gearmand binary is available]) + AC_DEFINE([GEARMAND_BINARY],[0],[Name of the gearmand binary used in make test])]) + ]) diff --git a/m4/libgearman.m4 b/m4/libgearman.m4 index a7bf493e..0501ed3e 100644 --- a/m4/libgearman.m4 +++ b/m4/libgearman.m4 @@ -1,9 +1,10 @@ -AX_CHECK_LIBRARY([LIBGEARMAN], [libgearman/gearmand.h], [gearman], - [ - AM_CONDITIONAL(HAVE_LIBGEARMAN, true) - AC_DEFINE([HAVE_LIBGEARMAN], [1], [Enables libgearman Support]) - ], - [ - AM_CONDITIONAL(HAVE_LIBGEARMAN, false) - AC_DEFINE([HAVE_LIBGEARMAN], [0], [Enables libgearman Support]) - ]) +# serial 1 +AC_DEFUN([CHECK_FOR_LIBGEARMAND], + [AX_CHECK_LIBRARY([LIBGEARMAN], [libgearman/gearmand.h], [gearman], + [ax_check_for_libgearman=yes], + [ax_check_for_libgearman=no]) + AS_IF([test "$ax_check_for_libgearman" = xyes], + [AC_DEFINE([HAVE_LIBGEARMAN],[1],[Enables libgearman Support])], + [AC_DEFINE([HAVE_LIBGEARMAN],[0],[Enables libgearman Support])]) + AM_CONDITIONAL(HAVE_LIBGEARMAN,[test "$ax_check_for_libgearman" = xyes]) + ]) diff --git a/m4/memcached_sasl.m4 b/m4/memcached_sasl.m4 deleted file mode 100644 index a43e4533..00000000 --- a/m4/memcached_sasl.m4 +++ /dev/null @@ -1,10 +0,0 @@ -AX_WITH_PROG(MEMCACHED_SASL_BINARY,memcached_sasl) -AS_IF([test -f "$ac_cv_path_MEMCACHED_SASL_BINARY"], - [ - AC_DEFINE([HAVE_MEMCACHED_SASL_BINARY], [1], [Name of the memcached_sasl binary used in make test]) - AC_DEFINE_UNQUOTED([MEMCACHED_SASL_BINARY], "$ac_cv_path_MEMCACHED_SASL_BINARY", [Name of the memcached_sasl binary used in make test]) - ], - [ - AC_DEFINE([HAVE_MEMCACHED_SASL_BINARY], [0], [Name of the memcached_sasl binary used in make test]) - AC_DEFINE([MEMCACHED_SASL_BINARY], [0], [Name of the memcached_sasl binary used in make test]) - ]) diff --git a/tests/include.am b/tests/include.am index 3a8c8efa..8f064c65 100644 --- a/tests/include.am +++ b/tests/include.am @@ -89,9 +89,6 @@ test: check test-mem: tests/libmemcached-1.0/testapp @tests/libmemcached-1.0/testapp -test-sasl: tests/sasl - @tests/sasl - test-atom: tests/atomsmasher @tests/atomsmasher @@ -113,9 +110,6 @@ pahole-mem: tests/testapp gdb-mem: tests/libmemcached-1.0/testapp @$(DEBUG_COMMAND) tests/libmemcached-1.0/testapp -gdb-sasl: tests/sasl - @$(DEBUG_COMMAND) tests/sasl - gdb-atom: tests/atomsmasher @$(DEBUG_COMMAND) tests/atomsmasher diff --git a/tests/libmemcached-1.0/include.am b/tests/libmemcached-1.0/include.am index 6ffc2986..9b023a5a 100644 --- a/tests/libmemcached-1.0/include.am +++ b/tests/libmemcached-1.0/include.am @@ -47,12 +47,12 @@ tests_libmemcached_1_0_internals_SOURCES= tests_libmemcached_1_0_internals_SOURCES+= tests/libmemcached-1.0/internals.cc tests_libmemcached_1_0_internals_SOURCES+= tests/libmemcached-1.0/string.cc tests_libmemcached_1_0_internals_CXXFLAGS+= $(AM_CXXFLAGS) -tests_libmemcached_1_0_internals_CXXFLAGS+= ${PTHREAD_CFLAGS} +tests_libmemcached_1_0_internals_CXXFLAGS+= @PTHREAD_CFLAGS@ tests_libmemcached_1_0_internals_DEPENDENCIES+= libmemcachedinternal/libmemcachedinternal.la tests_libmemcached_1_0_internals_DEPENDENCIES+= libtest/libtest.la tests_libmemcached_1_0_internals_DEPENDENCIES+= libmemcachedinternal/libmemcachedutilinternal.la tests_libmemcached_1_0_internals_LDADD+= libmemcachedinternal/libmemcachedinternal.la -tests_libmemcached_1_0_internals_LDADD+= ${PTHREAD_LIBS} +tests_libmemcached_1_0_internals_LDADD+= @PTHREAD_LIBS@ tests_libmemcached_1_0_internals_LDADD+= libmemcachedinternal/libmemcachedutilinternal.la tests_libmemcached_1_0_internals_LDADD+= libtest/libtest.la check_PROGRAMS+= tests/libmemcached-1.0/internals @@ -66,7 +66,7 @@ tests_libmemcached_1_0_testapp_DEPENDENCIES= tests_libmemcached_1_0_testapp_LDADD= tests_libmemcached_1_0_testapp_CXXFLAGS+= $(AM_CXXFLAGS) -tests_libmemcached_1_0_testapp_CXXFLAGS+= ${PTHREAD_CFLAGS} +tests_libmemcached_1_0_testapp_CXXFLAGS+= @PTHREAD_CFLAGS@ tests_libmemcached_1_0_testapp_CFLAGS+= $(AM_CFLAGS) tests_libmemcached_1_0_testapp_CFLAGS+= $(NO_CONVERSION) tests_libmemcached_1_0_testapp_CFLAGS+= $(NO_STRICT_ALIASING) @@ -102,8 +102,8 @@ tests_libmemcached_1_0_testapp_DEPENDENCIES+= libtest/libtest.la tests_libmemcached_1_0_testapp_DEPENDENCIES+= libhashkit/libhashkit.la tests_libmemcached_1_0_testapp_DEPENDENCIES+= libmemcached/libmemcachedutil.la -tests_libmemcached_1_0_testapp_LDADD+= $(LIBUUID_LDFLAGS) -tests_libmemcached_1_0_testapp_LDADD+= ${PTHREAD_LIBS} +tests_libmemcached_1_0_testapp_LDADD+= @LIBUUID_LDFLAGS@ +tests_libmemcached_1_0_testapp_LDADD+= @PTHREAD_LIBS@ tests_libmemcached_1_0_testapp_LDADD+= libmemcached/libmemcached.la tests_libmemcached_1_0_testapp_LDADD+= libmemcached/libmemcachedutil.la tests_libmemcached_1_0_testapp_LDADD+= libtest/libtest.la @@ -118,7 +118,7 @@ tests_libmemcached_1_0_testsocket_SOURCES= tests_libmemcached_1_0_testsocket_DEPENDENCIES= tests_libmemcached_1_0_testsocket_LDADD= -tests_libmemcached_1_0_testsocket_CXXFLAGS+= ${PTHREAD_CFLAGS} +tests_libmemcached_1_0_testsocket_CXXFLAGS+= @PTHREAD_CFLAGS@ tests_libmemcached_1_0_testsocket_CXXFLAGS+= $(AM_CXXFLAGS) tests_libmemcached_1_0_testsocket_CFLAGS+= $(AM_CFLAGS) tests_libmemcached_1_0_testsocket_CFLAGS+= $(NO_CONVERSION) @@ -158,8 +158,8 @@ tests_libmemcached_1_0_testsocket_DEPENDENCIES+= libtest/libtest.la tests_libmemcached_1_0_testsocket_DEPENDENCIES+= libhashkit/libhashkit.la tests_libmemcached_1_0_testsocket_DEPENDENCIES+= libmemcached/libmemcachedutil.la -tests_libmemcached_1_0_testsocket_LDADD+= $(LIBUUID_LDFLAGS) -tests_libmemcached_1_0_testsocket_LDADD+= ${PTHREAD_LIBS} +tests_libmemcached_1_0_testsocket_LDADD+= @LIBUUID_LDFLAGS@ +tests_libmemcached_1_0_testsocket_LDADD+= @PTHREAD_LIBS@ tests_libmemcached_1_0_testsocket_LDADD+= libmemcached/libmemcached.la tests_libmemcached_1_0_testsocket_LDADD+= libmemcached/libmemcachedutil.la tests_libmemcached_1_0_testsocket_LDADD+= libtest/libtest.la @@ -181,7 +181,7 @@ tests_libmemcached_1_0_sasl_CXXFLAGS= tests_libmemcached_1_0_sasl_CFLAGS= tests_libmemcached_1_0_sasl_CXXFLAGS+= $(AM_CXXFLAGS) -tests_libmemcached_1_0_sasl_CXXFLAGS+= ${PTHREAD_CFLAGS} +tests_libmemcached_1_0_sasl_CXXFLAGS+= @PTHREAD_CFLAGS@ tests_libmemcached_1_0_sasl_CFLAGS+= $(AM_CFLAGS) tests_libmemcached_1_0_sasl_CFLAGS+= $(NO_CONVERSION) tests_libmemcached_1_0_sasl_CFLAGS+= $(NO_STRICT_ALIASING) @@ -206,7 +206,7 @@ tests_libmemcached_1_0_sasl_SOURCES+= tests/libmemcached-1.0/generate.cc tests_libmemcached_1_0_sasl_DEPENDENCIES+= libmemcached/libmemcached.la tests_libmemcached_1_0_sasl_DEPENDENCIES+= libtest/libtest.la -tests_libmemcached_1_0_sasl_LDADD+= ${PTHREAD_LIBS} +tests_libmemcached_1_0_sasl_LDADD+= @PTHREAD_LIBS@ tests_libmemcached_1_0_sasl_LDADD+= libmemcached/libmemcached.la tests_libmemcached_1_0_sasl_LDADD+= libmemcached/libmemcachedutil.la tests_libmemcached_1_0_sasl_LDADD+= libtest/libtest.la @@ -215,6 +215,12 @@ tests_libmemcached_1_0_sasl_LDADD+= libhashkit/libhashkit.la check_PROGRAMS+= tests/libmemcached-1.0/sasl noinst_PROGRAMS+= tests/libmemcached-1.0/sasl +test-sasl: tests/libmemcached-1.0/sasl + @tests/libmemcached-1.0/sasl + +gdb-sasl: tests/libmemcached-1.0/sasl + @$(DEBUG_COMMAND) tests/libmemcached-1.0/sasl + tests_atomsmasher_SOURCES= tests_atomsmasher_DEPENDENCIES= tests_atomsmasher_LDADD= diff --git a/tests/libmemcached_world.h b/tests/libmemcached_world.h index e6f782f7..8b3ba641 100644 --- a/tests/libmemcached_world.h +++ b/tests/libmemcached_world.h @@ -49,7 +49,7 @@ static void *world_create(libtest::server_startup_st& servers, test_return_t& er return NULL; } - if ((servers.sasl()) and ((LIBMEMCACHED_WITH_SASL_SUPPORT == 0) or (MEMCACHED_SASL_BINARY == 0))) + if ((servers.sasl()) and ((LIBMEMCACHED_WITH_SASL_SUPPORT == 0))) { error= TEST_SKIPPED; return NULL;