3da827
diff -up rpcbind-0.2.0/configure.ac.orig rpcbind-0.2.0/configure.ac
3da827
--- rpcbind-0.2.0/configure.ac.orig	2015-05-04 08:09:47.390954657 -0400
3da827
+++ rpcbind-0.2.0/configure.ac	2015-05-04 08:10:23.707550057 -0400
3da827
@@ -27,6 +27,13 @@ AC_ARG_WITH([rpcuser],
3da827
   ,, [with_rpcuser=root])
3da827
 AC_SUBST([rpcuser], [$with_rpcuser])
3da827
  
3da827
+AC_ARG_WITH([nss_modules],
3da827
+  AS_HELP_STRING([--with-nss-modules=NSS_MODULES]
3da827
+  , [Sets the nss module search list to the given space-delimited string.
3da827
+     For example --with-nss-modules="files altfiles" @<:@default=files@:>@])
3da827
+  ,, [with_nss_modules=files])
3da827
+AC_SUBST([nss_modules], [$with_nss_modules])
3da827
+
3da827
 PKG_CHECK_MODULES([TIRPC], [libtirpc])
3da827
 
3da827
 AS_IF([test x$enable_libwrap = xyes], [
3da827
diff -up rpcbind-0.2.0/Makefile.am.orig rpcbind-0.2.0/Makefile.am
3da827
--- rpcbind-0.2.0/Makefile.am.orig	2015-05-04 08:09:47.386954591 -0400
3da827
+++ rpcbind-0.2.0/Makefile.am	2015-05-04 08:10:23.707550057 -0400
3da827
@@ -6,6 +6,7 @@ AM_CPPFLAGS = \
3da827
 	-DINET6 \
3da827
 	-DRPCBIND_STATEDIR="\"$(statedir)\"" \
3da827
 	-DRPCBIND_USER="\"$(rpcuser)\"" \
3da827
+	-DNSS_MODULES="\"$(nss_modules)\"" \
3da827
 	-D_GNU_SOURCE \
3da827
 	$(TIRPC_CFLAGS)
3da827
 
3da827
diff -up rpcbind-0.2.0/src/rpcbind.c.orig rpcbind-0.2.0/src/rpcbind.c
3da827
--- rpcbind-0.2.0/src/rpcbind.c.orig	2015-05-04 08:09:47.387954608 -0400
3da827
+++ rpcbind-0.2.0/src/rpcbind.c	2015-05-04 08:10:23.707550057 -0400
3da827
@@ -86,6 +86,12 @@ char *rpcbinduser = RPCBIND_USER;
3da827
 char *rpcbinduser = NULL;
3da827
 #endif
3da827
 
3da827
+#ifdef NSS_MODULES
3da827
+char *nss_modules = NSS_MODULES;
3da827
+#else
3da827
+char *nss_modules = "files";
3da827
+#endif
3da827
+
3da827
 /* who to suid to if -s is given */
3da827
 #define RUN_AS  "daemon"
3da827
 
3da827
@@ -160,7 +166,7 @@ main(int argc, char *argv[])
3da827
 	 * Make sure we use the local service file 
3da827
 	 * for service lookkups
3da827
 	 */
3da827
-	__nss_configure_lookup("services", "files");
3da827
+	__nss_configure_lookup("services", nss_modules);
3da827
 
3da827
 	nc_handle = setnetconfig(); 	/* open netconfig file */
3da827
 	if (nc_handle == NULL) {
3da827
@@ -226,7 +232,7 @@ main(int argc, char *argv[])
3da827
 		 * Make sure we use the local password file
3da827
 		 * for these lookups.
3da827
 		 */
3da827
-		__nss_configure_lookup("passwd", "files");
3da827
+		__nss_configure_lookup("passwd", nss_modules);
3da827
 
3da827
 		if((p = getpwnam(id)) == NULL) {
3da827
 			syslog(LOG_ERR, "cannot get uid of '%s': %m", id);