From e098c8bb6e7447e239ff720c351f4351730b381f Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Mon, 19 Nov 2018 09:08:37 -0800 Subject: [PATCH] libutil/zsecurity: make zmq security class private Problem: the flux_sec_t "class" is only used by the broker and flux-keygen, and should be removed from the public API. Relocate to libutil/zsecurity. Fixes #1843 --- src/broker/broker.c | 1 + src/broker/overlay.c | 1 + src/broker/overlay.h | 1 + src/cmd/flux-keygen.c | 1 + src/common/libflux/Makefile.am | 7 ------- src/common/libflux/flux.h | 1 - src/common/libflux/message.h | 1 - src/common/libutil/Makefile.am | 11 +++++++++-- .../test/security.c => libutil/test/zsecurity.c} | 2 +- .../{libflux/security.c => libutil/zsecurity.c} | 4 ++-- .../{libflux/security.h => libutil/zsecurity.h} | 6 +++--- 11 files changed, 19 insertions(+), 17 deletions(-) rename src/common/{libflux/test/security.c => libutil/test/zsecurity.c} (99%) rename src/common/{libflux/security.c => libutil/zsecurity.c} (99%) rename src/common/{libflux/security.h => libutil/zsecurity.h} (98%) diff --git a/src/broker/broker.c b/src/broker/broker.c index 2b1fed20c6da..3845ad04021c 100644 --- a/src/broker/broker.c +++ b/src/broker/broker.c @@ -64,6 +64,7 @@ #include "src/common/libutil/ipaddr.h" #include "src/common/libutil/kary.h" #include "src/common/libutil/monotime.h" +#include "src/common/libutil/zsecurity.h" #include "src/common/libpmi/pmi.h" #include "src/common/libpmi/pmi_strerror.h" diff --git a/src/broker/overlay.c b/src/broker/overlay.c index d5fbf0848c3f..3f563432a011 100644 --- a/src/broker/overlay.c +++ b/src/broker/overlay.c @@ -37,6 +37,7 @@ #include "src/common/libutil/iterators.h" #include "src/common/libutil/kary.h" #include "src/common/libutil/cleanup.h" +#include "src/common/libutil/zsecurity.h" #include "heartbeat.h" #include "overlay.h" diff --git a/src/broker/overlay.h b/src/broker/overlay.h index ded520c7fc29..ac97a9eab4d9 100644 --- a/src/broker/overlay.h +++ b/src/broker/overlay.h @@ -2,6 +2,7 @@ #define _BROKER_OVERLAY_H #include "attr.h" +#include "src/common/libutil/zsecurity.h" typedef struct overlay_struct overlay_t; typedef void (*overlay_cb_f)(overlay_t *ov, void *sock, void *arg); diff --git a/src/cmd/flux-keygen.c b/src/cmd/flux-keygen.c index 742214d14313..ec1ed21e43e3 100644 --- a/src/cmd/flux-keygen.c +++ b/src/cmd/flux-keygen.c @@ -29,6 +29,7 @@ #include #include "src/common/libutil/log.h" +#include "src/common/libutil/zsecurity.h" #define OPTIONS "hfpd:" diff --git a/src/common/libflux/Makefile.am b/src/common/libflux/Makefile.am index af2abef38d71..ed0e2a8d899c 100644 --- a/src/common/libflux/Makefile.am +++ b/src/common/libflux/Makefile.am @@ -58,7 +58,6 @@ fluxcoreinclude_HEADERS = \ connector.h \ reactor.h \ msg_handler.h \ - security.h \ message.h \ request.h \ keepalive.h \ @@ -90,7 +89,6 @@ libflux_la_SOURCES = \ handle.c \ reactor.c \ msg_handler.c \ - security.c \ message.c \ request.c \ response.c \ @@ -130,7 +128,6 @@ TESTS = test_message.t \ test_response.t \ test_event.t \ test_tagpool.t \ - test_security.t \ test_future.t \ test_composite_future.t \ test_reactor.t \ @@ -199,10 +196,6 @@ test_reactor_t_SOURCES = test/reactor.c test_reactor_t_CPPFLAGS = $(test_cppflags) test_reactor_t_LDADD = $(test_ldadd) $(LIBDL) -test_security_t_SOURCES = test/security.c -test_security_t_CPPFLAGS = $(test_cppflags) -test_security_t_LDADD = $(test_ldadd) $(LIBDL) - test_future_t_SOURCES = test/future.c test_future_t_CPPFLAGS = $(test_cppflags) test_future_t_LDADD = $(test_ldadd) $(LIBDL) diff --git a/src/common/libflux/flux.h b/src/common/libflux/flux.h index 0c9a0ca4396a..9c8a7660ac18 100644 --- a/src/common/libflux/flux.h +++ b/src/common/libflux/flux.h @@ -30,7 +30,6 @@ #include "reactor.h" #include "msg_handler.h" #include "connector.h" -#include "security.h" #include "message.h" #include "request.h" #include "response.h" diff --git a/src/common/libflux/message.h b/src/common/libflux/message.h index b490284b3ea7..de7cdbbb6dac 100644 --- a/src/common/libflux/message.h +++ b/src/common/libflux/message.h @@ -30,7 +30,6 @@ #include #include #include "types.h" -#include "security.h" #ifdef __cplusplus extern "C" { diff --git a/src/common/libutil/Makefile.am b/src/common/libutil/Makefile.am index 301ee20c776d..ee1682c6b474 100644 --- a/src/common/libutil/Makefile.am +++ b/src/common/libutil/Makefile.am @@ -86,7 +86,9 @@ libutil_la_SOURCES = \ aux.c \ aux.h \ fdutils.c \ - fdutils.h + fdutils.h \ + zsecurity.c \ + zsecurity.h EXTRA_DIST = veb_mach.c @@ -112,7 +114,8 @@ TESTS = test_nodeset.t \ test_ipaddr.t \ test_fluid.t \ test_aux.t \ - test_fdutils.t + test_fdutils.t \ + test_zsecurity.t test_ldadd = \ @@ -224,3 +227,7 @@ test_aux_t_LDADD = $(test_ldadd) test_fdutils_t_SOURCES = test/fdutils.c test_fdutils_t_CPPFLAGS = $(test_cppflags) test_fdutils_t_LDADD = $(test_ldadd) + +test_zsecurity_t_SOURCES = test/zsecurity.c +test_zsecurity_t_CPPFLAGS = $(test_cppflags) +test_zsecurity_t_LDADD = $(test_ldadd) diff --git a/src/common/libflux/test/security.c b/src/common/libutil/test/zsecurity.c similarity index 99% rename from src/common/libflux/test/security.c rename to src/common/libutil/test/zsecurity.c index 858537239963..680f9b8e1728 100644 --- a/src/common/libflux/test/security.c +++ b/src/common/libutil/test/zsecurity.c @@ -12,7 +12,7 @@ #include #include -#include "src/common/libflux/security.h" +#include "src/common/libutil/zsecurity.h" #include "src/common/libtap/tap.h" #include "src/common/libutil/unlink_recursive.h" diff --git a/src/common/libflux/security.c b/src/common/libutil/zsecurity.c similarity index 99% rename from src/common/libflux/security.c rename to src/common/libutil/zsecurity.c index 77c8775077df..6c3f9189390a 100644 --- a/src/common/libflux/security.c +++ b/src/common/libutil/zsecurity.c @@ -22,7 +22,7 @@ * See also: http://www.gnu.org/licenses/ \*****************************************************************************/ -/* security.c - flux security functions */ +/* zsecurity.c - flux zeromq security functions */ #if HAVE_CONFIG_H #include "config.h" @@ -34,7 +34,7 @@ #include #include -#include "security.h" +#include "zsecurity.h" #include "src/common/libutil/log.h" #include "src/common/libutil/oom.h" diff --git a/src/common/libflux/security.h b/src/common/libutil/zsecurity.h similarity index 98% rename from src/common/libflux/security.h rename to src/common/libutil/zsecurity.h index 15e47ba67b1b..80a161d2e7a9 100644 --- a/src/common/libflux/security.h +++ b/src/common/libutil/zsecurity.h @@ -22,8 +22,8 @@ * See also: http://www.gnu.org/licenses/ \*****************************************************************************/ -#ifndef _FLUX_CORE_SECURITY_H -#define _FLUX_CORE_SECURITY_H +#ifndef _UTIL_ZSECURITY_H +#define _UTIL_ZSECURITY_H #include @@ -127,7 +127,7 @@ const char *flux_sec_confstr (flux_sec_t *c); } #endif -#endif /* _FLUX_CORE_SECURITY_H */ +#endif /* !_UTIL_ZSECURITY_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab