diff options
author | Justin Mitchell <jumitche@redhat.com> | 2017-10-26 08:46:43 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2017-10-26 08:50:08 -0400 |
commit | f821eb7f9624f047a12fbf5c9dce23994eeb50e8 (patch) | |
tree | dc7cf0bc359fb6c7b599aa86a33d6f9a17024a81 /support | |
parent | 1ea6d9231f839b968adb44eaf98b363f436cb1d5 (diff) | |
download | nfs-utils-f821eb7f9624f047a12fbf5c9dce23994eeb50e8.tar.gz nfs-utils-f821eb7f9624f047a12fbf5c9dce23994eeb50e8.tar.xz nfs-utils-f821eb7f9624f047a12fbf5c9dce23994eeb50e8.zip |
nfs-utils: integrate libnfsidmap code with rest of nfs-utils
Modify libnfsidmap to use the now shared conffile code,
adjust the build structure to generate everything correctly,
and modify the other utils to use the merged version of libnfsidmap
instead of testing for an external dependancy.
Signed-off-by: Justin Mitchell <jumitche@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support')
-rw-r--r-- | support/Makefile.am | 8 | ||||
-rw-r--r-- | support/nfsidmap/Makefile.am | 8 | ||||
-rw-r--r-- | support/nfsidmap/libnfsidmap.c | 5 | ||||
-rw-r--r-- | support/nfsidmap/libnfsidmap.pc | 11 | ||||
-rw-r--r-- | support/nfsidmap/nss.c | 2 | ||||
-rw-r--r-- | support/nfsidmap/static.c | 5 | ||||
-rw-r--r-- | support/nfsidmap/umich_ldap.c | 2 |
7 files changed, 29 insertions, 12 deletions
diff --git a/support/Makefile.am b/support/Makefile.am index cb37733..8365d3b 100644 --- a/support/Makefile.am +++ b/support/Makefile.am @@ -1,6 +1,12 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = export include misc nfs nsm +OPTDIRS = + +if CONFIG_NFSV4 +OPTDIRS += nfsidmap +endif + +SUBDIRS = export include misc nfs nsm $(OPTDIRS) MAINTAINERCLEANFILES = Makefile.in diff --git a/support/nfsidmap/Makefile.am b/support/nfsidmap/Makefile.am index 85f19c8..32eb8cf 100644 --- a/support/nfsidmap/Makefile.am +++ b/support/nfsidmap/Makefile.am @@ -1,4 +1,4 @@ -ACLOCAL_AMFLAGS = -I m4 +pkgplugindir=$(libdir)/libnfsidmap if ENABLE_LDAP UMICH_LDAP_LIB = umich_ldap.la @@ -11,7 +11,7 @@ else GUMS_MAPPING_LIB = endif lib_LTLIBRARIES = libnfsidmap.la -pkglib_LTLIBRARIES = nsswitch.la static.la $(UMICH_LDAP_LIB) $(GUMS_MAPPING_LIB) +pkgplugin_LTLIBRARIES = nsswitch.la static.la $(UMICH_LDAP_LIB) $(GUMS_MAPPING_LIB) # Library versioning notes from: # http://sources.redhat.com/autobook/autobook/autobook_91.html @@ -25,9 +25,9 @@ pkglib_LTLIBRARIES = nsswitch.la static.la $(UMICH_LDAP_LIB) $(GUMS_MAPPING_LIB) # <age> The number of previous additional interfaces supported # by this library. -libnfsidmap_la_SOURCES = libnfsidmap.c cfg.c strlcpy.c cfg.h nfsidmap_internal.h queue.h +libnfsidmap_la_SOURCES = libnfsidmap.c nfsidmap_internal.h libnfsidmap_la_LDFLAGS = -version-info 3:0:3 -libnfsidmap_la_LIBADD = -ldl +libnfsidmap_la_LIBADD = -ldl ../../support/nfs/libnfsconf.la nsswitch_la_SOURCES = nss.c nsswitch_la_LDFLAGS = -module -avoid-version diff --git a/support/nfsidmap/libnfsidmap.c b/support/nfsidmap/libnfsidmap.c index d484101..aa368b7 100644 --- a/support/nfsidmap/libnfsidmap.c +++ b/support/nfsidmap/libnfsidmap.c @@ -59,7 +59,7 @@ #include "nfsidmap.h" #include "nfsidmap_internal.h" -#include "cfg.h" +#include "conffile.h" static char *default_domain; static struct conf_list *local_realms; @@ -340,6 +340,7 @@ int nfs4_init_name_mapping(char *conffile) char *nobody_user, *nobody_group; char *nostrip; char *reformatgroup; + char *conf_path; /* XXX: need to be able to reload configurations... */ if (nfs4_plugins) /* already succesfully initialized */ @@ -348,7 +349,7 @@ int nfs4_init_name_mapping(char *conffile) conf_path = conffile; else conf_path = PATH_IDMAPDCONF; - conf_init(); + conf_init(conf_path); default_domain = conf_get_str("General", "Domain"); if (default_domain == NULL) { dflt = 1; diff --git a/support/nfsidmap/libnfsidmap.pc b/support/nfsidmap/libnfsidmap.pc new file mode 100644 index 0000000..5ec28ae --- /dev/null +++ b/support/nfsidmap/libnfsidmap.pc @@ -0,0 +1,11 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib64 +includedir=${prefix}/include + +Name: libnfsidmap +Description: Library that handles mapping between names and ids for NFSv4. +Requires: +Version: 2.1.1 +Libs: -L${exec_prefix}/lib64 -lnfsidmap +Cflags: -I${prefix}/include diff --git a/support/nfsidmap/nss.c b/support/nfsidmap/nss.c index 82799ce..48215ff 100644 --- a/support/nfsidmap/nss.c +++ b/support/nfsidmap/nss.c @@ -48,7 +48,7 @@ #include <ctype.h> #include "nfsidmap.h" #include "nfsidmap_internal.h" -#include "cfg.h" +#include "conffile.h" #include <syslog.h> /* diff --git a/support/nfsidmap/static.c b/support/nfsidmap/static.c index 9f587af..37b293b 100644 --- a/support/nfsidmap/static.c +++ b/support/nfsidmap/static.c @@ -41,8 +41,7 @@ #include <errno.h> #include <err.h> -#include "queue.h" -#include "cfg.h" +#include "conffile.h" #include "nfsidmap.h" #include "nfsidmap_internal.h" @@ -317,7 +316,7 @@ static int static_init() { LIST_INIT (&uid_mappings[i]); //get all principals for which we have mappings - princ_list = conf_get_tag_list("Static"); + princ_list = conf_get_tag_list("Static", NULL); if (!princ_list) { return -ENOENT; diff --git a/support/nfsidmap/umich_ldap.c b/support/nfsidmap/umich_ldap.c index 886fa0c..664f282 100644 --- a/support/nfsidmap/umich_ldap.c +++ b/support/nfsidmap/umich_ldap.c @@ -48,7 +48,7 @@ #include <ldap.h> #include "nfsidmap.h" #include "nfsidmap_internal.h" -#include "cfg.h" +#include "conffile.h" /* attribute/objectclass default mappings */ #define DEFAULT_UMICH_OBJCLASS_REMOTE_PERSON "NFSv4RemotePerson" |