aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/libtirpc/libtirpc/0002-configure.ac-Allow-for-disabling-auth-DES.patch
blob: 098f4c4d6e04af5a95745462ae72394e7360562f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
From 538365a9319a100cd0aa8bf344b86e4c48426069 Mon Sep 17 00:00:00 2001
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Date: Sun, 1 Mar 2015 13:40:25 +0100
Subject: [PATCH 2/2] configure.ac: Allow for disabling auth DES
To: libtirpc-devel@lists.sourceforge.net
Cc: Steve Dickson <SteveD@redhat.com>

DES encryption might not be available.

Upstream-Status: Submitted

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
 Makefile.am      | 12 ++++++++----
 configure.ac     | 12 ++++++++++++
 libtirpc.pc.in   |  2 +-
 src/Makefile.am  |  6 +++++-
 src/rpc_soc.c    |  2 ++
 tirpc/rpc/auth.h |  9 +++++++++
 tirpc/rpc/rpc.h  |  2 ++
 7 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9b812eb..e588ae0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,17 +27,21 @@ nobase_include_HEADERS = tirpc/netconfig.h \
 			 tirpc/rpc/pmap_prot.h \
 			 tirpc/rpc/pmap_clnt.h \
 			 tirpc/rpc/nettype.h \
-			 tirpc/rpc/des.h \
-			 tirpc/rpc/des_crypt.h \
 			 tirpc/rpc/clnt_stat.h \
 			 tirpc/rpc/clnt_soc.h \
 			 tirpc/rpc/clnt.h \
 			 tirpc/rpc/auth_unix.h \
 			 tirpc/rpc/auth_kerb.h \
 			 tirpc/rpc/auth.h \
-			 tirpc/rpc/auth_gss.h \
+			 tirpc/rpc/auth_gss.h
+
+if AUTHDES
+nobase_include_HEADERS += \
+			 tirpc/rpc/des.h \
+			 tirpc/rpc/des_crypt.h \
 			 tirpc/rpc/auth_des.h
-    
+endif
+
 pkgconfigdir=$(libdir)/pkgconfig
 pkgconfig_DATA = libtirpc.pc
 
diff --git a/configure.ac b/configure.ac
index d006ac9..6d623cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,5 +49,17 @@ if test "x$enable_nis" != xno; then
 fi
 AM_CONDITIONAL([YP], [test "x$enable_nis" != xno])
 
+AC_ARG_ENABLE([authdes],
+	[AC_HELP_STRING([--disable-authdes],
+		[Disable DES authentication @<:@default=no@:>@])],
+	[],[enable_authdes=yes])
+AM_CONDITIONAL([AUTHDES], [test "x$enable_authdes" != xno])
+if test "x$enable_authdes" != xno; then
+	AC_DEFINE([AUTHDES], [1],
+		[Define to 1 if DES authentication is enabled])
+	CFLAG_AUTHDES="-D_HAS_AUTH_DES=1"
+	AC_SUBST([CFLAG_AUTHDES])
+fi
+
 AC_CONFIG_FILES([Makefile src/Makefile man/Makefile doc/Makefile])
 AC_OUTPUT(libtirpc.pc)
diff --git a/libtirpc.pc.in b/libtirpc.pc.in
index 38034c5..ebbc66f 100644
--- a/libtirpc.pc.in
+++ b/libtirpc.pc.in
@@ -8,4 +8,5 @@ Description: Transport Independent RPC L
 Requires:
 Version: @PACKAGE_VERSION@
 Libs: -L@libdir@ -ltirpc
+Libs.private: -lpthread
-Cflags: -I@includedir@/tirpc
+Cflags: -I@includedir@/tirpc @CFLAG_AUTHDES@
diff --git a/src/Makefile.am b/src/Makefile.am
index 7861057..121a500 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -51,7 +51,7 @@ libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c bindresvport.c cln
         rpc_callmsg.c rpc_generic.c rpc_soc.c rpcb_clnt.c rpcb_prot.c \
         rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c svc_auth_none.c \
         svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \
-        auth_des.c authdes_prot.c debug.c
+        debug.c
 
 ## XDR
 libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c
@@ -67,6 +67,10 @@ if YP
     libtirpc_la_SOURCES += auth_time.c
 endif
 
+if AUTHDES
+    libtirpc_la_SOURCES += auth_des.c authdes_prot.c
+endif
+
 ## libtirpc_a_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
 ## libtirpc_a_SOURCES += netname.c netnamer.c rpcdname.c \
 ## libtirpc_a_SOURCES += rtime.c \
diff --git a/src/rpc_soc.c b/src/rpc_soc.c
index e146ed4..c3d0e6e 100644
--- a/src/rpc_soc.c
+++ b/src/rpc_soc.c
@@ -520,6 +520,7 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
 	    (resultproc_t) rpc_wrap_bcast, "udp");
 }
 
+#ifdef _HAS_AUTH_DES
 /*
  * Create the client des authentication object. Obsoleted by
  * authdes_seccreate().
@@ -551,6 +552,7 @@ fallback:
 	dummy = authdes_seccreate(servername, window, NULL, ckey);
 	return (dummy);
 }
+#endif /* _HAS_AUTH_DES */
 
 /*
  * Create a client handle for a unix connection. Obsoleted by clnt_vc_create()
diff --git a/tirpc/rpc/auth.h b/tirpc/rpc/auth.h
index 7c8f813..4493a4d 100644
--- a/tirpc/rpc/auth.h
+++ b/tirpc/rpc/auth.h
@@ -164,9 +164,11 @@ union des_block {
 	char c[8];
 };
 typedef union des_block des_block;
+#ifdef _HAS_AUTH_DES
 __BEGIN_DECLS
 extern bool_t xdr_des_block(XDR *, des_block *);
 __END_DECLS
+#endif /* _HAS_AUTH_DES */
 
 /*
  * Authentication info.  Opaque to client.
@@ -305,6 +307,8 @@ extern AUTH *authunix_create(char *, uid_t, uid_t, int, uid_t *);
 extern AUTH *authunix_create_default(void);	/* takes no parameters */
 extern AUTH *authnone_create(void);		/* takes no parameters */
 __END_DECLS
+
+#ifdef _HAS_AUTH_DES
 /*
  * DES style authentication
  * AUTH *authsecdes_create(servername, window, timehost, ckey)
@@ -318,6 +322,7 @@ extern AUTH *authdes_create (char *, u_int, struct sockaddr *, des_block *);
 extern AUTH *authdes_seccreate (const char *, const u_int, const  char *,
     const  des_block *);
 __END_DECLS
+#endif /* _HAS_AUTH_DES */
 
 __BEGIN_DECLS
 extern bool_t xdr_opaque_auth		(XDR *, struct opaque_auth *);
@@ -335,7 +340,9 @@ extern int host2netname(char *, const char *, const char *);
 extern int user2netname(char *, const uid_t, const char *);
 extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *);
 extern int netname2host(char *, char *, const int);
+#ifdef _HAS_AUTH_DES
 extern void passwd2des ( char *, char * );
+#endif /* _HAS_AUTH_DES */
 __END_DECLS
 
 /*
@@ -346,7 +353,9 @@ __END_DECLS
 __BEGIN_DECLS
 extern int key_decryptsession(const char *, des_block *);
 extern int key_encryptsession(const char *, des_block *);
+#ifdef _HAS_AUTH_DES
 extern int key_gendes(des_block *);
+#endif /* _HAS_AUTH_DES */
 extern int key_setsecret(const char *);
 extern int key_secretkey_is_set(void);
 __END_DECLS
diff --git a/tirpc/rpc/rpc.h b/tirpc/rpc/rpc.h
index 6c0222e..a7231a0 100644
--- a/tirpc/rpc/rpc.h
+++ b/tirpc/rpc/rpc.h
@@ -52,11 +52,13 @@
 #include <rpc/rpc_msg.h>	/* protocol for rpc messages */
 #include <rpc/auth_unix.h>	/* protocol for unix style cred */
 
+#ifdef _HAS_AUTH_DES
 /*
  *  Uncomment-out the next line if you are building the rpc library with
  *  DES Authentication (see the README file in the secure_rpc/ directory).
  */
 #include <rpc/auth_des.h>	/* protocol for des style cred */
+#endif /* _HAS_AUTH_DES */
 
 #ifdef HAVE_RPCSEC_GSS
 #include <rpc/auth_gss.h>   /* RPCSEC_GSS */
-- 
2.1.4