Skip to content

Commit 35a78ad

Browse files
singsangssongjhpark816
authored andcommitted
FEATURE: Implement a SASL auxprop plugin for Zookeeper-based ACL
1 parent 1f07b7a commit 35a78ad

File tree

5 files changed

+463
-9
lines changed

5 files changed

+463
-9
lines changed

Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ noinst_LIBRARIES = libarcuszk.a
133133
libarcuszk_a_SOURCES = arcus_zk.c arcus_zk.h \
134134
arcus_hb.c arcus_hb.h \
135135
cluster_config.c cluster_config.h
136+
if ENABLE_SASL
137+
libarcuszk_a_SOURCES += sasl_auxprop.c sasl_auxprop.h
138+
endif
136139
# Do not use AM_CFLAGS which includes -pedantic.
137140
# We do not want that flag when compiling arcus_zk.c.
138141
libarcuszk_a_CFLAGS = @PROFILER_FLAGS@ @ARCUSZK_CFLAGS@

memcached.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15927,10 +15927,6 @@ int main (int argc, char **argv)
1592715927
}
1592815928
}
1592915929

15930-
#ifdef SASL_ENABLED
15931-
init_sasl();
15932-
#endif /* SASL */
15933-
1593415930
/* daemonize if requested */
1593515931
/* if we want to ensure our ability to dump core, don't chdir to / */
1593615932
if (do_daemonize) {
@@ -15945,6 +15941,12 @@ int main (int argc, char **argv)
1594515941
}
1594615942
}
1594715943

15944+
#ifdef SASL_ENABLED
15945+
if (settings.require_sasl) {
15946+
init_sasl();
15947+
}
15948+
#endif
15949+
1594815950
/* lock paged memory if needed */
1594915951
if (lock_memory) {
1595015952
#ifdef HAVE_MLOCKALL
@@ -16145,10 +16147,6 @@ int main (int argc, char **argv)
1614516147
}
1614616148
#endif
1614716149

16148-
#ifdef SASL_ENABLED
16149-
shutdown_sasl();
16150-
#endif /* SASL */
16151-
1615216150
/* 3) close listen sockes not to accept new connections */
1615316151
close_listen_sockets();
1615416152
mc_logger->log(EXTENSION_LOG_INFO, NULL, "Listen sockets closed.\n");
@@ -16192,6 +16190,12 @@ int main (int argc, char **argv)
1619216190
#ifdef DETECT_LONG_QUERY
1619316191
lqdetect_final(); /* finalize long query detection */
1619416192
#endif
16193+
#ifdef SASL_ENABLED
16194+
if (settings.require_sasl) {
16195+
shutdown_sasl();
16196+
}
16197+
#endif
16198+
1619516199
mc_engine.v1->destroy(mc_engine.v0);
1619616200
mc_logger->log(EXTENSION_LOG_INFO, NULL, "Memcached engine destroyed.\n");
1619716201

0 commit comments

Comments
 (0)