Blame SOURCES/rpcbind-0.2.0-nss-altfiles.patch

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