Submitted By: Kevin Day <kevin at kevux dot org> (yerp)
Date: 2005-10-10
Initial Package Version: 0.80
Upstream Status: Not Submitted
Description: Fixes compilation problem under uClibc.

--- Linux-PAM-0.80/modules/pam_access/pam_access.c.orig	2005-10-11 04:33:18.000000000 +0000
+++ Linux-PAM-0.80/modules/pam_access/pam_access.c	2005-10-11 04:34:53.000000000 +0000
@@ -41,7 +41,9 @@
 #include <errno.h>
 #include <ctype.h>
 #include <sys/utsname.h>
+#ifdef USE_NIS
 #include <rpcsvc/ypclnt.h>
+#endif
 
 #ifndef BROKEN_NETWORK_MATCH
 # include <netdb.h>
@@ -270,7 +272,7 @@
 }
 
 /* netgroup_match - match group against machine or user */
-
+#ifdef USE_NIS
 static int netgroup_match(const char *group, const char *machine, const char *user)
 {
     static char *mydomain = NULL;
@@ -279,6 +281,7 @@
 	yp_get_default_domain(&mydomain);
     return (innetgr(group, machine, user, mydomain));
 }
+#endif
 
 /* user_match - match a username against one token */
 
@@ -301,8 +304,12 @@
 	if (fake_item.from == NULL)
 	  return NO;
 	return (user_match (pamh, tok, item) && from_match (pamh, at + 1, &fake_item));
+#ifdef USE_NIS
     } else if (tok[0] == '@') /* netgroup */
 	return (netgroup_match(tok + 1, (char *) 0, string));
+#else
+    }
+#endif
     else if (string_match (pamh, tok, string)) /* ALL or exact match */
 	return YES;
     else if (_pammodutil_user_in_group_nam_nam (pamh, item->user->pw_name, tok))
@@ -330,9 +337,13 @@
      * if it matches the head of the string.
      */
 
+#ifdef USE_NIS
     if (tok[0] == '@') {			/* netgroup */
 	return (netgroup_match(tok + 1, string, (char *) 0));
     } else if (string_match (pamh, tok, string)) /* ALL or exact match */
+#else
+    if (string_match (pamh, tok, string)) /* ALL or exact match */
+#endif
       return YES;
     else if (tok[0] == '.') {			/* domain: match last fields */
 	if ((str_len = strlen(string)) > (tok_len = strlen(tok))
--- Linux-PAM-0.80/modules/pam_unix/yppasswd_xdr.c.orig	2005-10-11 04:35:28.000000000 +0000
+++ Linux-PAM-0.80/modules/pam_unix/yppasswd_xdr.c	2005-10-11 04:35:48.000000000 +0000
@@ -13,8 +13,10 @@
 #include <security/_pam_aconf.h>
 
 #include <rpc/rpc.h>
+#ifdef USE_NIS
 #include <rpcsvc/yp_prot.h>
 #include <rpcsvc/ypclnt.h>
+#endif
 #include "yppasswd.h"
 
 bool_t
--- Linux-PAM-0.80/modules/pam_unix/pam_unix_passwd.c.orig	2005-10-11 04:35:59.000000000 +0000
+++ Linux-PAM-0.80/modules/pam_unix/pam_unix_passwd.c	2005-10-11 04:41:00.000000000 +0000
@@ -54,8 +54,10 @@
 #include <sys/time.h>
 #include <sys/stat.h>
 #include <rpc/rpc.h>
+#ifdef USE_NIS
 #include <rpcsvc/yp_prot.h>
 #include <rpcsvc/ypclnt.h>
+#endif
 
 #include <signal.h>
 #include <errno.h>
@@ -190,6 +192,7 @@
 	return x;
 }
 
+#ifdef USE_NIS
 static char *getNISserver(pam_handle_t *pamh)
 {
 	char *master;
@@ -219,6 +222,7 @@
 	}
 	return master;
 }
+#endif
 
 #ifdef WITH_SELINUX
 
@@ -756,6 +760,7 @@
 		goto done;
 	}
 
+#ifdef USE_NIS
 	if (on(UNIX_NIS, ctrl) && _unix_comesfromsource(pamh, forwho, 0, 1)) {
 	    if ((master=getNISserver(pamh)) != NULL) {
 		struct timeval timeout;
@@ -825,6 +830,7 @@
 		    retval = PAM_TRY_AGAIN;
 	    }
 	}
+#endif
 
 	if (_unix_comesfromsource(pamh, forwho, 1, 0)) {
 #ifdef USE_LCKPWDF
--- Linux-PAM-0.80/modules/pam_unix/support.c.orig	2005-10-11 04:42:15.000000000 +0000
+++ Linux-PAM-0.80/modules/pam_unix/support.c	2005-10-11 04:43:24.000000000 +0000
@@ -19,7 +19,9 @@
 #include <errno.h>
 #include <signal.h>
 #include <ctype.h>
+#ifdef USE_NIS
 #include <rpcsvc/ypclnt.h>
+#endif
 
 #include <security/_pam_macros.h>
 #include <security/pam_modules.h>
@@ -323,6 +325,7 @@
 		}
 	}
 
+#ifdef USE_NIS
 	if (!matched && nis) {
 		char *userinfo = NULL, *domain = NULL;
 		int len = 0, i;
@@ -341,6 +344,7 @@
 			}
 		}
 	}
+#endif
 
 	if (matched && (ret != NULL)) {
 		*ret = NULL;
