1 --- a/modules/pam_access/pam_access.c
2 +++ b/modules/pam_access/pam_access.c
6 #include <sys/socket.h>
7 -#ifdef HAVE_RPCSVC_YPCLNT_H
8 +#ifdef HAVE_RPCSVC_YPCLNT_H && USE_NIS
9 #include <rpcsvc/ypclnt.h>
12 --- a/modules/pam_unix/pam_unix_passwd.c
13 +++ b/modules/pam_unix/pam_unix_passwd.c
18 -#ifdef HAVE_RPCSVC_YP_PROT_H
19 +#ifdef HAVE_RPCSVC_YP_PROT_H && USE_NIS
20 #include <rpcsvc/yp_prot.h>
22 -#ifdef HAVE_RPCSVC_YPCLNT_H
23 +#ifdef HAVE_RPCSVC_YPCLNT_H && USE_NIS
24 #include <rpcsvc/ypclnt.h>
27 @@ -104,7 +104,7 @@ extern int getrpcport(const char *host,
29 static char *getNISserver(pam_handle_t *pamh, unsigned int ctrl)
31 -#if (defined(HAVE_YP_GET_DEFAULT_DOMAIN) || defined(HAVE_GETDOMAINNAME)) && defined(HAVE_YP_MASTER)
32 +#if (defined(HAVE_YP_GET_DEFAULT_DOMAIN) || defined(HAVE_GETDOMAINNAME)) && defined(HAVE_YP_MASTER) && defined(USE_NIS)
36 --- a/modules/pam_unix/support.c
37 +++ b/modules/pam_unix/support.c
41 #include <sys/resource.h>
42 -#ifdef HAVE_RPCSVC_YPCLNT_H
43 +#ifdef HAVE_RPCSVC_YPCLNT_H && USE_NIS
44 #include <rpcsvc/ypclnt.h>
47 @@ -285,7 +285,7 @@ int _unix_getpwnam(pam_handle_t *pamh, c
51 -#if defined(HAVE_YP_GET_DEFAULT_DOMAIN) && defined (HAVE_YP_BIND) && defined (HAVE_YP_MATCH) && defined (HAVE_YP_UNBIND)
52 +#if defined(HAVE_YP_GET_DEFAULT_DOMAIN) && defined (HAVE_YP_BIND) && defined (HAVE_YP_MATCH) && defined (HAVE_YP_UNBIND) && (USE_NIS)
53 if (!matched && nis) {
54 char *userinfo = NULL, *domain = NULL;
56 --- a/modules/pam_unix/yppasswd_xdr.c
57 +++ b/modules/pam_unix/yppasswd_xdr.c
63 +#include <rpcsvc/yp_prot.h>
64 +#include <rpcsvc/ypclnt.h>