libs/libpam: port some uclibc xdr code to yppasswd_xdr.c
[openwrt/svn-archive/archive.git] / libs / libpam / patches / 001-no_nis.patch
1 --- a/modules/pam_access/pam_access.c
2 +++ b/modules/pam_access/pam_access.c
3 @@ -44,7 +44,7 @@
4 #include <arpa/inet.h>
5 #include <netdb.h>
6 #include <sys/socket.h>
7 -#ifdef HAVE_RPCSVC_YPCLNT_H
8 +#ifdef HAVE_RPCSVC_YPCLNT_H && USE_NIS
9 #include <rpcsvc/ypclnt.h>
10 #endif
11 #ifdef HAVE_LIBAUDIT
12 --- a/modules/pam_unix/pam_unix_passwd.c
13 +++ b/modules/pam_unix/pam_unix_passwd.c
14 @@ -74,18 +74,18 @@
15 #include "passverify.h"
16 #include "bigcrypt.h"
17
18 -#if (HAVE_YP_GET_DEFAULT_DOMAIN || HAVE_GETDOMAINNAME) && HAVE_YP_MASTER
19 +#if (HAVE_YP_GET_DEFAULT_DOMAIN || HAVE_GETDOMAINNAME) && HAVE_YP_MASTER && USE_NIS
20 # define HAVE_NIS
21 #endif
22
23 #ifdef HAVE_NIS
24 # include <rpc/rpc.h>
25
26 -# if HAVE_RPCSVC_YP_PROT_H
27 +# if HAVE_RPCSVC_YP_PROT_H && USE_NIS
28 # include <rpcsvc/yp_prot.h>
29 # endif
30
31 -# if HAVE_RPCSVC_YPCLNT_H
32 +# if HAVE_RPCSVC_YPCLNT_H && USE_NIS
33 # include <rpcsvc/ypclnt.h>
34 # endif
35
36 --- a/modules/pam_unix/support.c
37 +++ b/modules/pam_unix/support.c
38 @@ -19,7 +19,7 @@
39 #include <ctype.h>
40 #include <syslog.h>
41 #include <sys/resource.h>
42 -#ifdef HAVE_RPCSVC_YPCLNT_H
43 +#ifdef HAVE_RPCSVC_YPCLNT_H && USE_NIS
44 #include <rpcsvc/ypclnt.h>
45 #endif
46
47 @@ -285,7 +285,7 @@ int _unix_getpwnam(pam_handle_t *pamh, c
48 }
49 }
50
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;
55 int len = 0, i;
56 --- a/modules/pam_unix/yppasswd_xdr.c
57 +++ b/modules/pam_unix/yppasswd_xdr.c
58 @@ -13,6 +13,10 @@
59 #include "config.h"
60
61 #include <rpc/rpc.h>
62 +#ifdef USE_NIS
63 +#include <rpcsvc/yp_prot.h>
64 +#include <rpcsvc/ypclnt.h>
65 +#endif
66 #include "yppasswd.h"
67
68 bool_t