summaryrefslogtreecommitdiff
path: root/sasl_defs.c
diff options
context:
space:
mode:
authorDustin Sallings <dustin@spy.net>2009-05-10 00:50:47 -0700
committerTrond Norbye <Trond.Norbye@sun.com>2009-10-25 21:19:14 +0100
commitf1307c4d9cadb94076a99cc2f88a00f7e0b4161f (patch)
tree2f7f1096abce3f8c986854b3681770dc8f6d7da4 /sasl_defs.c
parentda3d85a5d0fa9aaf927371ed70dce2366956a173 (diff)
downloadmemcached-f1307c4d9cadb94076a99cc2f88a00f7e0b4161f.tar.gz
SASL auth support.
Diffstat (limited to 'sasl_defs.c')
-rw-r--r--sasl_defs.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sasl_defs.c b/sasl_defs.c
new file mode 100644
index 0000000..7e803d4
--- /dev/null
+++ b/sasl_defs.c
@@ -0,0 +1,20 @@
+#include "memcached.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+static sasl_callback_t sasl_callbacks[] = {
+ {
+ SASL_CB_LIST_END, NULL, NULL
+ }
+};
+
+void init_sasl(void) {
+ if (sasl_server_init(sasl_callbacks, "memcached") != SASL_OK) {
+ fprintf(stderr, "Error initializing sasl.\n");
+ exit(EXIT_FAILURE);
+ } else {
+ if (settings.verbose) {
+ fprintf(stderr, "Initialized SASL.\n");
+ }
+ }
+}