--- a/modules/pam_access/pam_access.c +++ b/modules/pam_access/pam_access.c @@ -44,7 +44,7 @@ #include #include #include -#ifdef HAVE_RPCSVC_YPCLNT_H +#ifdef HAVE_RPCSVC_YPCLNT_H && USE_NIS #include #endif #ifdef HAVE_LIBAUDIT --- a/modules/pam_unix/pam_unix_passwd.c +++ b/modules/pam_unix/pam_unix_passwd.c @@ -55,10 +55,10 @@ #include #include #include -#ifdef HAVE_RPCSVC_YP_PROT_H +#ifdef HAVE_RPCSVC_YP_PROT_H && USE_NIS #include #endif -#ifdef HAVE_RPCSVC_YPCLNT_H +#ifdef HAVE_RPCSVC_YPCLNT_H && USE_NIS #include #endif @@ -104,7 +104,7 @@ extern int getrpcport(const char *host, static char *getNISserver(pam_handle_t *pamh, unsigned int ctrl) { -#if (defined(HAVE_YP_GET_DEFAULT_DOMAIN) || defined(HAVE_GETDOMAINNAME)) && defined(HAVE_YP_MASTER) +#if (defined(HAVE_YP_GET_DEFAULT_DOMAIN) || defined(HAVE_GETDOMAINNAME)) && defined(HAVE_YP_MASTER) && defined(USE_NIS) char *master; char *domainname; int port, err; --- a/modules/pam_unix/support.c +++ b/modules/pam_unix/support.c @@ -19,7 +19,7 @@ #include #include #include -#ifdef HAVE_RPCSVC_YPCLNT_H +#ifdef HAVE_RPCSVC_YPCLNT_H && USE_NIS #include #endif @@ -285,7 +285,7 @@ int _unix_getpwnam(pam_handle_t *pamh, c } } -#if defined(HAVE_YP_GET_DEFAULT_DOMAIN) && defined (HAVE_YP_BIND) && defined (HAVE_YP_MATCH) && defined (HAVE_YP_UNBIND) +#if defined(HAVE_YP_GET_DEFAULT_DOMAIN) && defined (HAVE_YP_BIND) && defined (HAVE_YP_MATCH) && defined (HAVE_YP_UNBIND) && (USE_NIS) if (!matched && nis) { char *userinfo = NULL, *domain = NULL; int len = 0, i; --- a/modules/pam_unix/yppasswd_xdr.c +++ b/modules/pam_unix/yppasswd_xdr.c @@ -13,6 +13,10 @@ #include "config.h" #include +#ifdef USE_NIS +#include +#include +#endif #include "yppasswd.h" bool_t