X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=clients%2Fmemcp.cc;h=2a73390bad50eb771c069cd45aa9864e3653b9e6;hb=0ae14bed70947882f5ee9423dfcb20eeda7acdd9;hp=3869242b171c8cff803dda17624d4c3b0606bee2;hpb=67456d74f5bd4f354a360d70da503dc58cbe5971;p=m6w6%2Flibmemcached diff --git a/clients/memcp.cc b/clients/memcp.cc index 3869242b..2a73390b 100644 --- a/clients/memcp.cc +++ b/clients/memcp.cc @@ -11,6 +11,7 @@ #include "config.h" +#include #include #include #include @@ -114,8 +115,17 @@ int main(int argc, char *argv[]) memcached_server_list_free(servers); memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, (uint64_t)opt_binary); - if (!initialize_sasl(memc, opt_username, opt_passwd)) + + 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 (initialize_sasl(memc, opt_username, opt_passwd) == false) { + std::cerr << "Failed to initialize SASL support." << std::endl; memcached_free(memc); return EXIT_FAILURE; }