summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2015-04-29 11:11:30 -0400
committerSteve Dickson <steved@redhat.com>2015-04-29 17:05:33 -0400
commit4ba9ce277dd6c747e17d1e746c0b58b180bc0b11 (patch)
tree11b428e49970e967c1b4ec47a9b32885e407a4bb
parent5d4970d31678ea208e92876a16dd03d1ac58d699 (diff)
downloadti-rpc-4ba9ce277dd6c747e17d1e746c0b58b180bc0b11.tar.gz
configure.ac: Allow for disabling auth DES
DES encryption might not be available. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--Makefile.am12
-rw-r--r--configure.ac7
-rw-r--r--libtirpc.pc.in2
-rw-r--r--src/Makefile.am1
-rw-r--r--src/rpc_soc.c2
-rw-r--r--tirpc/rpc/auth.h10
-rw-r--r--tirpc/rpc/rpc.h2
7 files changed, 28 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am
index aa270f6..2bf725c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -28,17 +28,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 80dec85..fe35afa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,6 +20,12 @@ AC_ARG_ENABLE(authdes,
[AC_HELP_STRING([--disable-authdes], [Disable DES authentication @<:@default=no@:>@])],
[],[enable_authdes=yes])
AM_CONDITIONAL(AUTHDES, test x$enable_authdes = xyes)
+if test x$enable_authdes = xyes; then
+ AC_DEFINE([HAVE_AUTHDES], [1],
+ [Define to 1 if DES authentication is enabled])
+ CFLAG_AUTHDES="-DHAVE_AUTHDES=1"
+ AC_SUBST([CFLAG_AUTHDES])
+fi
AC_ARG_ENABLE(ipv6,
[AC_HELP_STRING([--disable-ipv6], [Disable IPv6 support @<:@default=no@:>@])],
@@ -42,4 +48,3 @@ AC_CHECK_FUNCS([getrpcbyname getrpcbynumber])
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
@@ -9,4 +9,4 @@ 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 5f01ea5..af0e42f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -68,7 +68,6 @@ endif
## DES authentication
if AUTHDES
libtirpc_la_SOURCES += auth_des.c authdes_prot.c
- libtirpc_la_CFLAGS += -DHAVE_AUTHDES
endif
diff --git a/src/rpc_soc.c b/src/rpc_soc.c
index 6574323..1e2f4d6 100644
--- a/src/rpc_soc.c
+++ b/src/rpc_soc.c
@@ -520,7 +520,7 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
(resultproc_t) rpc_wrap_bcast, "udp");
}
-#if HAVE_AUTHDES
+#ifdef HAVE_AUTHDES
/*
* Create the client des authentication object. Obsoleted by
* authdes_seccreate().
diff --git a/tirpc/rpc/auth.h b/tirpc/rpc/auth.h
index 434d35c..1b6c699 100644
--- a/tirpc/rpc/auth.h
+++ b/tirpc/rpc/auth.h
@@ -163,6 +163,8 @@ union des_block {
char c[8];
};
typedef union des_block des_block;
+
+#ifdef HAVE_AUTHDES
#ifdef __cplusplus
extern "C" {
#endif
@@ -170,6 +172,7 @@ extern bool_t xdr_des_block(XDR *, des_block *);
#ifdef __cplusplus
}
#endif
+#endif /* HAVE_AUTHDES */
/*
* Authentication info. Opaque to client.
@@ -316,6 +319,8 @@ extern AUTH *authnone_create(void); /* takes no parameters */
#ifdef __cplusplus
}
#endif
+
+#ifdef HAVE_AUTHDES
/*
* DES style authentication
* AUTH *authsecdes_create(servername, window, timehost, ckey)
@@ -333,6 +338,7 @@ extern AUTH *authdes_seccreate (const char *, const u_int, const char *,
#ifdef __cplusplus
}
#endif
+#endif /* HAVE_AUTHDES */
#ifdef __cplusplus
extern "C" {
@@ -356,7 +362,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 HAVE_AUTHDES
extern void passwd2des ( char *, char * );
+#endif /* HAVE_AUTHDES */
#ifdef __cplusplus
}
#endif
@@ -371,7 +379,9 @@ extern "C" {
#endif
extern int key_decryptsession(const char *, des_block *);
extern int key_encryptsession(const char *, des_block *);
+#ifdef HAVE_AUTHDES
extern int key_gendes(des_block *);
+#endif /* HAVE_AUTHDES */
extern int key_setsecret(const char *);
extern int key_secretkey_is_set(void);
#ifdef __cplusplus
diff --git a/tirpc/rpc/rpc.h b/tirpc/rpc/rpc.h
index fac2fa9..1dbb391 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 HAVE_AUTHDES
/*
* 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 /* HAVE_AUTHDES */
#ifdef HAVE_RPCSEC_GSS
#include <rpc/auth_gss.h> /* RPCSEC_GSS */