Skip to content

Commit

Permalink
libutil/zsecurity: make zmq security class private
Browse files Browse the repository at this point in the history
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
  • Loading branch information
garlick committed Nov 19, 2018
1 parent 08f2e31 commit e098c8b
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 17 deletions.
1 change: 1 addition & 0 deletions src/broker/broker.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 1 addition & 0 deletions src/broker/overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions src/broker/overlay.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/cmd/flux-keygen.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <flux/core.h>

#include "src/common/libutil/log.h"
#include "src/common/libutil/zsecurity.h"


#define OPTIONS "hfpd:"
Expand Down
7 changes: 0 additions & 7 deletions src/common/libflux/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ fluxcoreinclude_HEADERS = \
connector.h \
reactor.h \
msg_handler.h \
security.h \
message.h \
request.h \
keepalive.h \
Expand Down Expand Up @@ -90,7 +89,6 @@ libflux_la_SOURCES = \
handle.c \
reactor.c \
msg_handler.c \
security.c \
message.c \
request.c \
response.c \
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/common/libflux/flux.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion src/common/libflux/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <stdarg.h>
#include <stdio.h>
#include "types.h"
#include "security.h"

#ifdef __cplusplus
extern "C" {
Expand Down
11 changes: 9 additions & 2 deletions src/common/libutil/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 = \
Expand Down Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <dirent.h>
#include <czmq.h>

#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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -34,7 +34,7 @@
#include <libgen.h>
#include <czmq.h>

#include "security.h"
#include "zsecurity.h"

#include "src/common/libutil/log.h"
#include "src/common/libutil/oom.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdbool.h>

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e098c8b

Please sign in to comment.