diff --git a/configure.ac b/configure.ac index 318d46c4..abbfbf3f 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,11 @@ AC_PROG_RANLIB m4_ifndef([PKG_PROG_PKG_CONFIG], [AC_MSG_ERROR([PKG_PROG_PKG_CONFIG not found, please install pkgconf package before configuring.])]) +## +# Initialize pkg-config for PKG_CHECK_MODULES to avoid conditional issues +## +PKG_PROG_PKG_CONFIG + ## # Checks for ncurses ## @@ -75,8 +80,6 @@ AC_CHECK_FUNCS( \ ) AC_FUNC_STRERROR_R X_AC_CHECK_PTHREADS -X_AC_CHECK_COND_LIB(munge, munge_ctx_create) -X_AC_CHECK_COND_LIB(cap, cap_get_proc) X_AC_TCMALLOC X_AC_RDMA @@ -95,10 +98,32 @@ AC_SYS_LARGEFILE AC_ARG_ENABLE([diodmount], [AS_HELP_STRING([--disable-diodmount], [do not build diodmount])]) -AC_ARG_ENABLE([impersonation], - [AS_HELP_STRING([--enable-impersonation], [allow access=user])], - [], - [enable_impersonation=auto]) +AC_ARG_ENABLE([multiuser], + [AS_HELP_STRING([--disable-multiuser], [build without multi-user support])]) + +AC_ARG_ENABLE([auth], + [AS_HELP_STRING([--disable-auth], [build without authentication support])]) + +AC_ARG_WITH([ganesha-kmod], + [AS_HELP_STRING([--with-ganesha-kmod], [use nfs-ganesha-kmod syscalls for multi-user])]) + +AS_IF([test "x$with_ganesha_kmod" = "xyes"], [ + AC_DEFINE([USE_GANESHA_KMOD], [1], [Use nfs-ganesha-kmod syscalls]) +]) + +AS_IF([test "x$enable_auth" != "xno"], [ + PKG_CHECK_MODULES([MUNGE], [munge], [], [ + AC_MSG_ERROR([Install munge or configure with --disable-auth]) + ]) + AC_DEFINE([AUTH], [1], [Support MUNGE authentication]) +]) + +AS_IF([test "x$enable_multiuser" != "xno"], [ + PKG_CHECK_MODULES([CAP], [libcap], [], [ + AC_MSG_ERROR([Install libcap or configure with --disable-multiuser]) + ]) + AC_DEFINE([MULTIUSER], [1], [service files to multiple users]) +]) AC_ARG_ENABLE([config], [AS_HELP_STRING([--disable-config], [disable lua config file support])]) @@ -114,47 +139,9 @@ AS_IF([test "x$enable_config" != "xno"], [ AC_DEFINE([HAVE_CONFIG_FILE], [1], [lua config file support]) ]) -case "${host_os}" in - linux*) - case "${enable_impersonation}" in - no) - ;; - yes|linux|auto) - enable_impersonation=linux;; - *) - AC_MSG_FAILURE([unsupported impersonation model]);; - esac - ;; - freebsd*) - case "${enable_impersonation}" in - no|auto) - enable_impersonation=no;; - yes|ganesha) - enable_impersonation=ganesha;; - *) - AC_MSG_FAILURE([unsupported impersonation model]);; - esac - ;; - *) - case "${enable_impersonation}" in - no|auto) - enable_impersonation=no;; - *) - AC_MSG_FAILURE([unsupported impersonation model]);; - esac - ;; -esac - AM_CONDITIONAL([ENABLE_DIODMOUNT], [test "x${enable_diodmount}" != "xno"]) -AM_CONDITIONAL([USE_IMPERSONATION_LINUX], [test "x${enable_impersonation}" = "xlinux"]) -AM_CONDITIONAL([USE_IMPERSONATION_GANESHA], [test "x${enable_impersonation}" = "xganesha"]) - -if test "x${enable_impersonation}" = "xlinux"; then - AC_DEFINE([USE_IMPERSONATION_LINUX], [1], [Use Linux setfsuid]) -fi -if test "x${enable_impersonation}" = "xganesha"; then - AC_DEFINE([USE_IMPERSONATION_GANESHA], [1], [Use nfs-ganesha-kmod syscalls]) -fi +AM_CONDITIONAL([MULTIUSER], [test "x${enable_multiuser}" != "xno"]) +AM_CONDITIONAL([USE_GANESHA_KMOD], [test "x${with_ganesha_kmod}" = "xyes"]) ## # Check for systemd diff --git a/src/cmd/Makefile.am b/src/cmd/Makefile.am index c97ce25e..d1b59816 100644 --- a/src/cmd/Makefile.am +++ b/src/cmd/Makefile.am @@ -2,6 +2,8 @@ AM_CFLAGS = @WARNING_CFLAGS@ AM_CPPFLAGS = \ -I$(top_srcdir) \ + $(MUNGE_CFLAGS) \ + $(CAP_CFLAGS) \ $(LUA_INCLUDE) AM_CPPFLAGS += $(ncurses_CPPFLAGS) @@ -17,7 +19,7 @@ common_ldadd = \ $(top_builddir)/src/libnpfs/libnpfs.a \ $(top_builddir)/src/liblsd/liblsd.a \ $(top_builddir)/src/libdiod/libdiod.a \ - $(LIBPTHREAD) $(LUA_LIB) $(LIBMUNGE) $(LIBCAP) \ + $(LIBPTHREAD) $(LUA_LIB) $(MUNGE_LIBS) $(CAP_LIBS) \ $(LIBIBVERBS) $(LIBRDMACM) $(LIBTCMALLOC) $(ncurses_LIBS) common_sources = \ diff --git a/src/cmd/diod.c b/src/cmd/diod.c index 94345744..6a197c2e 100644 --- a/src/cmd/diod.c +++ b/src/cmd/diod.c @@ -18,7 +18,7 @@ #include #include #include -#if USE_IMPERSONATION_LINUX +#ifndef USE_GANESHA_KMOD #include #endif #include @@ -48,14 +48,14 @@ #include "src/libdiod/diod_ops.h" -#if USE_IMPERSONATION_GANESHA +#if USE_GANESHA_KMOD #include "src/libnpfs/ganesha-syscalls.h" #endif typedef enum { SRV_FILEDES, SRV_SOCKTEST, SRV_NORMAL } srvmode_t; static void _setrlimit (void); -static void _become_user (char *name, uid_t uid, int realtoo); +static void _become_user (char *name, uid_t uid); static void _service_run (srvmode_t mode, int rfdno, int wfdno); #ifndef NR_OPEN @@ -231,6 +231,12 @@ main(int argc, char **argv) msg_exit ("--runas-uid and allsquash cannot be used together"); if (mode == SRV_FILEDES && (rfdno == -1 || wfdno == -1)) msg_exit ("--rfdno,wfdno must be used together"); +#ifndef AUTH + if (diod_conf_get_auth_required ()) { + msg_exit ("diod was built without authentication support." + " Run with --no-auth."); + } +#endif diod_conf_validate_exports (); @@ -245,56 +251,49 @@ main(int argc, char **argv) exit (0); } -/* Switch to user/group, load the user's supplementary groups. - * Print message and exit on failure. +/* Look up name (which may be a stringified numerical uid) or if name is NULL, + * look up uid. Then drop root and load the credentials of the new user. + * It is a fatal error if the user cannot be found in the password file. + * This function is not safe to call after any threads have been spawned that + * could do user lookups. For example, call before np_srv_create (). */ static void -_become_user (char *name, uid_t uid, int realtoo) +_become_user (char *name, uid_t uid) { - int err; - struct passwd pw, *pwd; - int len = sysconf(_SC_GETPW_R_SIZE_MAX); - char *buf; + struct passwd *pw; int nsg; gid_t sg[64]; - char *endptr; - if (len == -1) - len = 4096; - if (!(buf = malloc(len))) - msg_exit ("out of memory"); - if (name) { + if (name) { // handle stringified uid + char *endptr; errno = 0; uid = strtoul (name, &endptr, 10); if (errno == 0 && *name != '\0' && *endptr == '\0') name = NULL; } if (name) { - if ((err = getpwnam_r (name, &pw, buf, len, &pwd)) != 0) - errn_exit (err, "error looking up user %s", name); - if (!pwd) + if (!(pw = getpwnam (name))) msg_exit ("error looking up user %s", name); - } else { - if ((err = getpwuid_r (uid, &pw, buf, len, &pwd)) != 0) - errn_exit (err, "error looking up uid %d", uid); - if (!pwd) + } + else { + if (!(pw = getpwuid (uid))) msg_exit ("error looking up uid %d", uid); } + if (pw->pw_uid == geteuid ()) + return; // nothing to do + if (geteuid () != 0) + msg_exit ("no permission to switch users"); + nsg = sizeof (sg) / sizeof(sg[0]); - if (getgrouplist(pwd->pw_name, pwd->pw_gid, sg, &nsg) == -1) - err_exit ("user is in too many groups"); -#if USE_IMPERSONATION_LINUX - if (syscall(SYS_setgroups, nsg, sg) < 0) - err_exit ("setgroups"); -#else + if (getgrouplist(pw->pw_name, pw->pw_gid, sg, &nsg) == -1) + err_exit ("user %s is in too many groups", pw->pw_name); if (setgroups (nsg, sg) < 0) err_exit ("setgroups"); -#endif - if (setregid (realtoo ? pwd->pw_gid : -1, pwd->pw_gid) < 0) - err_exit ("setreuid"); - if (setreuid (realtoo ? pwd->pw_uid : -1, pwd->pw_uid) < 0) - err_exit ("setreuid"); - free (buf); + if (setregid (pw->pw_gid, pw->pw_gid) < 0 + || setreuid (pw->pw_uid, pw->pw_uid) < 0) + err_exit ("could not switch to %d:%d", pw->pw_uid, pw->pw_gid); + + msg ("Dropped root, running as %s", pw->pw_name); } /* Remove any resource limits. @@ -464,7 +463,7 @@ _service_sigsetup (void) err_exit ("sigprocmask"); } -#if USE_IMPERSONATION_LINUX +#if defined(MULTIUSER) && !defined(USE_GANESHA_KMOD) /* POSIX setgroups(2) is per process but in Linux the underlying system call * is per-thread and the per-process bit is handled in glibc, so we can use * SYS_setgroups directly in the server thread pool when switching users. @@ -514,7 +513,23 @@ _test_setgroups (void) free (sg); return rc; } -#endif /* USE_IMPERSONATION_LINUX */ +#endif + +/* Look up user name of effective uid. + * The result is only valid until the next call, and this is not thread safe. + */ +static const char * +_geteuser (void) +{ + static char idstr[16]; + struct passwd *pw = getpwuid (geteuid ()); + + if (!pw) { + snprintf (idstr, sizeof (idstr), "%d", geteuid ()); + return idstr; + } + return pw->pw_name; +} static void _service_run (srvmode_t mode, int rfdno, int wfdno) @@ -522,7 +537,6 @@ _service_run (srvmode_t mode, int rfdno, int wfdno) List l = diod_conf_get_listen (); int nwthreads = diod_conf_get_nwthreads (); int flags = diod_conf_get_debuglevel (); - uid_t euid = geteuid (); int n; ss.mode = mode; @@ -544,60 +558,64 @@ _service_run (srvmode_t mode, int rfdno, int wfdno) break; } - /* manipulate squash/runas users if not root */ - if (euid != 0) { - if (diod_conf_get_allsquash ()) { - struct passwd *pw = getpwuid (euid); - char *su = diod_conf_get_squashuser (); - if (!pw) - msg_exit ("getpwuid on effective uid failed"); - if (strcmp (pw->pw_name, su) != 0) { - if (strcmp (su, DFLT_SQUASHUSER) != 0) - msg ("changing squashuser '%s' to '%s' " - "since you are not root", su, pw->pw_name); - diod_conf_set_squashuser (pw->pw_name); /* fixes issue 41 */ - } - } else { /* N.B. runasuser cannot be set in the config file */ - uid_t ruid = diod_conf_get_runasuid (); - if (diod_conf_opt_runasuid () && ruid != euid) - msg ("changing runasuid %d to %d " - "since you are not root", ruid, euid); - diod_conf_set_runasuid (euid); - } + /* allsquash */ + if (diod_conf_get_allsquash ()) { + /* If not root, and the squashuser has not been explicitly set, + * let's assume the user wants squashuser to default to the effective uid. + */ + if (geteuid () != 0 && !strcmp (diod_conf_get_squashuser (), DFLT_SQUASHUSER)) + diod_conf_set_squashuser ((char *)_geteuser ()); + /* _become_user() fails if not root and squashuser != effective uid. + */ + _become_user (diod_conf_get_squashuser (), -1); + msg ("Anyone can attach and access files as %s", _geteuser ()); } - /* drop root */ - if (euid == 0) { - if (diod_conf_get_allsquash ()) - _become_user (diod_conf_get_squashuser (), -1, 1); - else if (diod_conf_opt_runasuid ()) - _become_user (NULL, diod_conf_get_runasuid (), 1); + /* runasuid */ + else if (diod_conf_opt_runasuid () || geteuid () != 0) { + /* If not root, and not allsquash, and not runasuid (command line only), + * let's assume runasuid set to the effective uid. + * N.B. diod_attach () lets anyone connect unless runasuid is set + */ + if (getuid () != 0 && !diod_conf_opt_runasuid ()) + diod_conf_set_runasuid (geteuid ()); + /* _become_user() fails if not root and runasuser != effective uid + */ + _become_user (NULL, diod_conf_get_runasuid()); + const char *user = _geteuser (); + msg ("Only %s can attach and access files as %s", user, user); } - /* clear umask */ - umask (0); - - flags |= SRV_FLAGS_LOOSEFID; /* work around buggy clients */ - flags |= SRV_FLAGS_AUTHCONN; - //flags |= SRV_FLAGS_FLUSHSIG; /* XXX temporarily off */ - if (geteuid () == 0) { + /* multiuser */ + else { +#if MULTIUSER +#ifndef USE_GANESHA_KMOD flags |= SRV_FLAGS_SETFSID; flags |= SRV_FLAGS_DAC_BYPASS; -#if USE_IMPERSONATION_LINUX if (_test_setgroups ()) flags |= SRV_FLAGS_SETGROUPS; else { msg ("warning: supplemental group membership will be ignored." - " Some accesses might be inappropriately denied."); + " Some accesses might be inappropriately denied."); + } +#else + if (init_ganesha_syscalls() < 0) { + msg_exit ("diod cannot continue in multi-user mode without" + " nfs-ganesha-kmod loaded"); } -#elif USE_IMPERSONATION_GANESHA - if (init_ganesha_syscalls() < 0) - msg ("nfs-ganesha-kmod not loaded: changing user/group will fail"); /* SRV_FLAGS_SETGROUPS is ignored in user-freebsd.c */ +#endif + msg ("Anyone can attach and access files as themselves"); #else - msg ("warning: cannot change user/group (built with --disable-impersonation)"); + msg_exit ("diod was built without multi-user support." + " Run as a normal user or add --runasuser or --allsquash options."); #endif } + msg ("%s authentication is required", + diod_conf_get_auth_required () ? "MUNGE" : "No"); + + /* clear umask */ + umask (0); #if WITH_RDMA /* RDMA needs to be initialized after user transitions. @@ -618,6 +636,9 @@ _service_run (srvmode_t mode, int rfdno, int wfdno) err_exit ("prctl PR_SET_DUMPABLE failed"); #endif + flags |= SRV_FLAGS_LOOSEFID; /* work around buggy clients */ + flags |= SRV_FLAGS_AUTHCONN; + //flags |= SRV_FLAGS_FLUSHSIG; /* XXX temporarily off */ if (!diod_conf_get_userdb ()) flags |= SRV_FLAGS_NOUSERDB; if (!(ss.srv = np_srv_create (nwthreads, flags))) /* starts threads */ diff --git a/src/libdiod/Makefile.am b/src/libdiod/Makefile.am index 46d08094..5a2a3011 100644 --- a/src/libdiod/Makefile.am +++ b/src/libdiod/Makefile.am @@ -2,6 +2,8 @@ AM_CFLAGS = @WARNING_CFLAGS@ AM_CPPFLAGS = \ -I$(top_srcdir) \ + $(MUNGE_CFLAGS) \ + $(CAP_CFLAGS) \ $(LUA_INCLUDE) noinst_LIBRARIES = libdiod.a @@ -40,8 +42,8 @@ test_ldadd = \ $(builddir)/libdiod.a \ $(top_builddir)/src/libtap/libtap.a \ $(LUA_LIB) \ - $(LIBCAP) \ - $(LIBMUNGE) \ + $(CAP_LIBS) \ + $(MUNGE_LIBS) \ $(LIBPTHREAD) TESTS = \ diff --git a/src/libdiod/diod_auth.c b/src/libdiod/diod_auth.c index 267194fb..955bf342 100644 --- a/src/libdiod/diod_auth.c +++ b/src/libdiod/diod_auth.c @@ -39,8 +39,7 @@ #include #include #include -#if HAVE_LIBMUNGE -#define GPL_LICENSED 1 +#if AUTH #include #endif @@ -73,7 +72,7 @@ Npauth *diod_auth_functions = &_auth; struct diod_auth_struct { int magic; char *datastr; -#if HAVE_LIBMUNGE +#if AUTH munge_ctx_t mungectx; munge_err_t mungerr; uid_t mungeuid; @@ -95,7 +94,7 @@ _da_create (void) } da->magic = DIOD_AUTH_MAGIC; da->datastr = NULL; -#if HAVE_LIBMUNGE +#if AUTH if (!(da->mungectx = munge_ctx_create ())) { np_uerror (ENOMEM); free (da); @@ -118,7 +117,7 @@ _da_destroy (da_t da) da->magic = 0; if (da->datastr) free (da->datastr); -#if HAVE_LIBMUNGE +#if AUTH if (da->mungectx) munge_ctx_destroy (da->mungectx); #endif @@ -172,7 +171,7 @@ checkauth(Npfid *fid, Npfid *afid, char *aname) snprintf (a, sizeof(a), "checkauth(%s@%s:%s)", fid->user->uname, np_conn_get_client_id (fid->conn), aname ? aname : ""); -#if HAVE_LIBMUNGE +#if AUTH if (!da->datastr) { msg ("%s: munge cred missing", a); np_uerror (EPERM); @@ -267,7 +266,7 @@ int diod_auth (Npcfid *afid, u32 uid) { int ret = -1; -#if HAVE_LIBMUNGE +#if AUTH char *cred = NULL; munge_ctx_t ctx = NULL; diff --git a/src/libnpclient/Makefile.am b/src/libnpclient/Makefile.am index 483fa127..839c3a24 100644 --- a/src/libnpclient/Makefile.am +++ b/src/libnpclient/Makefile.am @@ -1,6 +1,7 @@ AM_CFLAGS = @WARNING_CFLAGS@ AM_CPPFLAGS = \ + $(CAP_CFLAGS) \ -I$(top_srcdir) noinst_LIBRARIES = libnpclient.a @@ -31,7 +32,7 @@ test_ldadd = \ $(top_builddir)/src/liblsd/liblsd.a \ $(top_builddir)/src/libtap/libtap.a \ $(LUA_LIB) \ - $(LIBCAP) \ + $(CAP_LIBS) \ $(LIBPTHREAD) TESTS = \ diff --git a/src/libnpfs/Makefile.am b/src/libnpfs/Makefile.am index 14ec3e2e..9787a00d 100644 --- a/src/libnpfs/Makefile.am +++ b/src/libnpfs/Makefile.am @@ -1,6 +1,7 @@ AM_CFLAGS = @WARNING_CFLAGS@ AM_CPPFLAGS = \ + $(CAP_CFLAGS) \ -I$(top_srcdir) noinst_LIBRARIES = libnpfs.a @@ -24,14 +25,14 @@ libnpfs_a_SOURCES = \ ctl.c \ xpthread.h -if USE_IMPERSONATION_LINUX -libnpfs_a_SOURCES += user-linux.c -else -if USE_IMPERSONATION_GANESHA +if MULTIUSER +if USE_GANESHA_KMOD libnpfs_a_SOURCES += user-freebsd.c else -libnpfs_a_SOURCES += user-stub.c +libnpfs_a_SOURCES += user-linux.c endif +else +libnpfs_a_SOURCES += user-stub.c endif if RDMA @@ -43,16 +44,20 @@ test_ldadd = \ $(top_builddir)/src/liblsd/liblsd.a \ $(top_builddir)/src/libtest/libtest.a \ $(top_builddir)/src/libtap/libtap.a \ - $(LIBCAP) \ + $(CAP_LIBS) \ $(LIBPTHREAD) TESTS = \ test_encoding.t \ test_fidpool.t \ - test_capability.t \ test_setfsuid.t \ test_setreuid.t +if MULTIUSER +TESTS += \ + test_capability.t +endif + check_PROGRAMS = $(TESTS) TEST_EXTENSIONS = .t T_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ @@ -64,8 +69,10 @@ test_encoding_t_LDADD = $(test_ldadd) test_fidpool_t_SOURCES = test/fidpool.c test_fidpool_t_LDADD = $(test_ldadd) +if MULTIUSER test_capability_t_SOURCES = test/capability.c test_capability_t_LDADD = $(test_ldadd) +endif test_setfsuid_t_SOURCES = test/setfsuid.c test_setfsuid_t_LDADD = $(test_ldadd) diff --git a/src/libnpfs/test/capability.c b/src/libnpfs/test/capability.c index 55e643c4..ef07709c 100644 --- a/src/libnpfs/test/capability.c +++ b/src/libnpfs/test/capability.c @@ -12,9 +12,7 @@ #if HAVE_CONFIG_H #include "config.h" #endif -#if HAVE_LIBCAP #include -#endif #include #include @@ -22,7 +20,6 @@ #include "src/libtest/state.h" #include "src/libtap/tap.h" -#if HAVE_LIBCAP typedef enum { S0, S1, S2, S3, S4, S5 } state_t; static void check_capability (const char *who, @@ -156,19 +153,15 @@ static void proc0 (void) check_capability ("task0", "CHOWN", CAP_CHOWN, CAP_CLEAR); } -#endif - int main(int argc, char *argv[]) { -#if HAVE_LIBCAP if (geteuid () != 0 || getenv ("FAKEROOTKEY") != NULL) plan (SKIP_ALL, "this test must run as root"); plan (NO_PLAN); + test_state_init (S0); proc0 (); // spawns proc1 and proc2 -#else - plan (SKIP_ALL, "libcap2-dev is not installed"); -#endif + done_testing (); exit (0); diff --git a/src/libnpfs/user-linux.c b/src/libnpfs/user-linux.c index dd9c4c1b..301c2095 100644 --- a/src/libnpfs/user-linux.c +++ b/src/libnpfs/user-linux.c @@ -23,16 +23,13 @@ #include #include #include -#if HAVE_LIBCAP #include -#endif #include #include "npfs.h" #include "xpthread.h" #include "npfsimpl.h" -#if HAVE_LIBCAP /* When handling requests on connections authenticated as root, we consider * it safe to disable DAC checks on the server and presume the client is * doing it. This is only done if the server sets SRV_FLAGS_DAC_BYPASS. @@ -79,7 +76,6 @@ _chg_privcap (Npsrv *srv, cap_flag_value_t val) } return ret; } -#endif /* Note: it is possible for setfsuid/setfsgid to fail silently, * e.g. if user doesn't have CAP_SETUID/CAP_SETGID. @@ -190,7 +186,6 @@ np_setfsid (Npreq *req, Npuser *u, u32 gid_override) wt->fsuid = u->uid; } } -#if HAVE_LIBCAP if ((srv->flags & SRV_FLAGS_DAC_BYPASS) && wt->fsuid != 0) { if (!wt->privcap && authuid == 0) { if (_chg_privcap (srv, CAP_SET) < 0) @@ -204,7 +199,6 @@ np_setfsid (Npreq *req, Npuser *u, u32 gid_override) dumpclrd = 1; } } -#endif ret = 0; done: if (dumpclrd && prctl (PR_SET_DUMPABLE, 1, 0, 0, 0) < 0) diff --git a/tests/kern/Makefile.am b/tests/kern/Makefile.am index 6e9f98a2..fa46587d 100644 --- a/tests/kern/Makefile.am +++ b/tests/kern/Makefile.am @@ -35,13 +35,15 @@ AM_CFLAGS = @WARNING_CFLAGS@ AM_CPPFLAGS = \ -I$(top_srcdir) \ + $(MUNGE_CFLAGS) \ + $(CAP_CFLAGS) \ $(LUA_INCLUDE) LDADD = $(top_builddir)/src/libdiod/libdiod.a \ $(top_builddir)/src/libnpfs/libnpfs.a \ $(top_builddir)/src/liblsd/liblsd.a \ - $(LIBPTHREAD) $(LUA_LIB) $(LIBMUNGE) $(LIBCAP) $(LIBTCMALLOC) + $(LIBPTHREAD) $(LUA_LIB) $(MUNGE_LIBS) $(CAP_LIBS) $(LIBTCMALLOC) common_sources = test.h diff --git a/tests/user/Makefile.am b/tests/user/Makefile.am index 61a2d37b..ab93a1b7 100644 --- a/tests/user/Makefile.am +++ b/tests/user/Makefile.am @@ -37,6 +37,8 @@ AM_CFLAGS = @WARNING_CFLAGS@ AM_CPPFLAGS = \ -I$(top_srcdir) \ + $(MUNGE_CFLAGS) \ + $(CAP_CFLAGS) \ $(LUA_INCLUDE) @@ -44,7 +46,7 @@ LDADD = $(top_builddir)/src/libdiod/libdiod.a \ $(top_builddir)/src/libnpclient/libnpclient.a \ $(top_builddir)/src/libnpfs/libnpfs.a \ $(top_builddir)/src/liblsd/liblsd.a \ - $(LIBPTHREAD) $(LUA_LIB) $(LIBMUNGE) $(LIBCAP) $(LIBTCMALLOC) + $(LIBPTHREAD) $(LUA_LIB) $(MUNGE_LIBS) $(CAP_LIBS) $(LIBTCMALLOC) common_sources =