From 2037cd51a2b787c492d60c9235b85868f03ed9ba Mon Sep 17 00:00:00 2001 From: Thorsten Kukuk Date: Tue, 30 Jun 2009 10:28:53 +0000 Subject: Relevant BUGIDs: Purpose of commit: bugfix Commit summary: --------------- This makes Linux-PAM compile able with uClibc or on embedded systems without full libc/libnsl. 2009-06-29 Thorsten Kukuk * modules/pam_unix/yppasswd_xdr.c: Remove unnecessary header files. * modules/pam_unix/support.c (_unix_getpwnam): Only compile in NIS support if all necessary functions exist. * modules/pam_unix/pam_unix_passwd.c (getNISserver): Add debug option, handle correct if OS has no NIS support. * modules/pam_access/pam_access.c (netgroup_match): Check if yp_get_default_domain and innetgr are available at compile time. * configure.in: Check for functions: innetgr, getdomainname check for headers: rpcsvc/ypclnt.h, rpcsvc/yp_prot.h. --- modules/pam_unix/support.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modules/pam_unix/support.c') diff --git a/modules/pam_unix/support.c b/modules/pam_unix/support.c index 050e0dc1..2a47d157 100644 --- a/modules/pam_unix/support.c +++ b/modules/pam_unix/support.c @@ -19,7 +19,9 @@ #include #include #include +#ifdef HAVE_RPCSVC_YPCLNT_H #include +#endif #include #include @@ -275,6 +277,7 @@ int _unix_getpwnam(pam_handle_t *pamh, const char *name, } } +#if defined(HAVE_YP_GET_DEFAULT_DOMAIN) && defined (HAVE_YP_BIND) && defined (HAVE_YP_MATCH) && defined (HAVE_YP_UNBIND) if (!matched && nis) { char *userinfo = NULL, *domain = NULL; int len = 0, i; @@ -293,6 +296,10 @@ int _unix_getpwnam(pam_handle_t *pamh, const char *name, } } } +#else + /* we don't have NIS support, make compiler happy. */ + nis = 0; +#endif if (matched && (ret != NULL)) { *ret = NULL; -- cgit v1.2.3