CXXFLAGS="$CXXFLAGS -DNEED_XDR_LONGLONG"])
LIBS="$old_LIBS"
-ACX_RPCTEST([rpctest="yes"],[rpctest="no"])
-if test $rpctest = "no"; then
- AC_CHECK_HEADERS([stropts.h])
- CFLAGS="-DNEED_RPC_TLI $CFLAGS"
- CXXFLAGS="-DNEED_RPC_TLI $CXXFLAGS"
- ACX_RPCTEST(,AC_MSG_ERROR([neither style of ONC RPC worked]))
-fi
-
# checks for pthreads
ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
if test $enable_threads != "pthread"; then
# output the underlying makefiles
WANT_SUBDIRS="shib schemas configs eduPerson shib-target shar test"
AC_CONFIG_FILES([Makefile shib/Makefile schemas/Makefile eduPerson/Makefile \
- configs/Makefile shib-target/Makefile shar/Makefile test/Makefile])
+ configs/Makefile oncrpc/Makefile oncrpc/rpc/Makefile \
+ shib-target/Makefile shar/Makefile test/Makefile])
+
+# now test the rpc library, to see if we need to build our own
+ACX_RPCTEST([rpctest="yes"],[rpctest="no"])
+if test $rpctest = "no"; then
+ WANT_SUBDIRS="oncrpc $WANT_SUBDIRS"
+ AM_CONDITIONAL(USE_OUR_ONCRPC,test "$rpctest" = "no")
+fi
# Much of this is taken from mod_dav.
# The basic idea is to use configure options to control whether/which types
AUTOMAKE_OPTIONS = foreign
+if USE_OUR_ONCRPC
+RPC_CFLAGS = -I${top_srcdir}/oncrpc
+endif
+
shibrmdir = $(libexecdir)
shibrm_LTLIBRARIES = mod_shibrm.la
mod_shibrm_la_SOURCES = mod_shibrm.cpp
-AM_CXXFLAGS = $(APXS_CFLAGS) -I$(APXS_INCLUDE)
+AM_CXXFLAGS = $(APXS_CFLAGS) -I$(APXS_INCLUDE) $(RPC_CFLAGS)
mod_shibrm_la_LIBADD = $(top_builddir)/shib/libshib.la $(top_builddir)/shib-target/libshib-target.la
AUTOMAKE_OPTIONS = foreign
+if USE_OUR_ONCRPC
+RPC_CFLAGS = -I${top_srcdir}/oncrpc
+endif
+
shiredir = $(libexecdir)
shire_LTLIBRARIES = mod_shire.la
mod_shire_la_SOURCES = mod_shire.cpp
-AM_CXXFLAGS = $(APXS_CFLAGS) -I$(APXS_INCLUDE)
+AM_CXXFLAGS = $(APXS_CFLAGS) -I$(APXS_INCLUDE) $(RPC_CFLAGS)
mod_shire_la_LIBADD = $(top_builddir)/shib/libshib.la $(top_builddir)/shib-target/libshib-target.la
--- /dev/null
+/Makefile.in
+/Makefile
+/.libs
+/.deps
+/*.lo
+/*.la
\ No newline at end of file
--- /dev/null
+
+AUTOMAKE_OPTIONS = foreign
+
+SUBDIRS = . rpc
+
+AM_CFLAGS = -D_rpc_dtablesize=getdtablesize
+
+lib_LTLIBRARIES = liboncrpc.la
+
+liboncrpc_la_SOURCES = \
+ auth_non.c \
+ auth_uni.c \
+ authunix.c \
+ clnt_gen.c \
+ clnt_per.c \
+ clnt_raw.c \
+ clnt_sim.c \
+ clnt_tcp.c \
+ clnt_udp.c \
+ get_myad.c \
+ pmap_cln.c \
+ pmap_get.c \
+ pmap_gma.c \
+ pmap_pr.c \
+ pmap_pro.c \
+ pmap_rmt.c \
+ rpc_call.c \
+ rpc_comm.c \
+ rpc_prot.c \
+ svc.c \
+ svc_auth.c \
+ svc_autu.c \
+ svc_raw.c \
+ svc_run.c \
+ svc_simp.c \
+ svc_tcp.c \
+ svc_udp.c \
+ xdr.c \
+ xdr_arra.c \
+ xdr_floa.c \
+ xdr_mem.c \
+ xdr_rec.c \
+ xdr_refe.c \
+ xdr_stdi.c
+
+# this is different from the project version
+# http://sources.redhat.com/autobook/autobook/autobook_91.html
+liboncrpc_la_LDFLAGS = -version-info 1:0:0
+
+EXTRA_DIST = \
+ .cvsignore \
+ makefile.bc \
+ makefile.nt \
+ oncbcimp.def \
+ oncrpc.def \
+ oncrpc.rc \
+ oncrpcbc.def \
+ bcopy.c \
+ bindresv.c \
+ getrpcen.c \
+ getrpcpo.c \
+ nt.c \
+ portmap.c
+
#include <rpc/rpc.h>
#include <rpc/xdr.h>
#include <rpc/auth.h>
-#include <rpc/auth_uni.h>
+#include <rpc/auth_unix.h>
#else
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/auth.h>
-#include <rpc/auth_uni.h>
+#include <rpc/auth_unix.h>
#else
#include <rpc/types.h>
#include <rpc/xdr.h>
#ifndef WIN32
extern char *sys_errlist[];
+#ifdef NEED_SPRINTF
extern char *sprintf();
#endif
+#endif
static char *auth_errmsg();
extern char *strcpy();
#include <rpc/rpc.h>
#ifdef WIN32
#include <errno.h>
-#include <rpc/pmap_cln.h>
+#include <rpc/pmap_clnt.h>
#else
#include <sys/socket.h>
#include <netdb.h>
}
return (len);
#else
- switch (select(_rpc_dtablesize(), &readfds, (int*)NULL, (int*)NULL,
+ switch (select(_rpc_dtablesize(), &readfds, NULL, NULL,
&(ct->ct_wait))) {
case 0:
ct->ct_error.re_status = RPC_TIMEDOUT;
#include <rpc/rpc.h>
#ifdef WIN32
#include <errno.h>
-#include <rpc/pmap_cln.h>
+#include <rpc/pmap_clnt.h>
#else
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <rpc/pmap_clnt.h>
+#ifndef FIONBIO
+#include <sys/filio.h>
+#endif
+
extern int errno;
#endif
for (;;) {
readfds = mask;
#ifdef WIN32
- switch (select(0 /* unused in winsock */, &readfds, (int *)NULL,
+ switch (select(0 /* unused in winsock */, &readfds, (int *)NULL, (int *)NULL,
#else
- switch (select(_rpc_dtablesize(), &readfds, (int *)NULL,
+ switch (select(_rpc_dtablesize(), &readfds, NULL, NULL,
#endif
- (int *)NULL, &(cu->cu_wait))) {
+ &(cu->cu_wait))) {
case 0:
time_waited.tv_sec += cu->cu_wait.tv_sec;
#ifdef WIN32
#include <rpc/rpc.h>
-#include <rpc/pmap_pro.h>
+#include <rpc/pmap_prot.h>
#include <stdio.h>
#define MAX_NAME_LEN 255
#include <arpa/inet.h>
#include <netinet/in.h>
+#ifndef SIOCGIFCONF
+#include <sys/sockio.h>
+#endif
+
/*
* don't use gethostbyname, which would invoke yellow pages
*/
#include <rpc/rpc.h>
#ifdef WIN32
-#include <rpc/pmap_pro.h>
-#include <rpc/pmap_cln.h>
+#include <rpc/pmap_prot.h>
+#include <rpc/pmap_clnt.h>
#else
#include <rpc/pmap_prot.h>
#include <rpc/pmap_clnt.h>
*/
#include <rpc/rpc.h>
-#include <rpc/pmap_pro.h>
-#include <rpc/pmap_cln.h>
+#include <rpc/pmap_prot.h>
+#include <rpc/pmap_clnt.h>
static struct timeval timeout = { 5, 0 };
static struct timeval tottimeout = { 60, 0 };
}
CLNT_DESTROY(client);
}
+#ifdef WIN32
(void)closesocket(socket);
+#else
+ (void)close(socket);
+#endif
address->sin_port = 0;
return (port);
}
#include <rpc/rpc.h>
#ifdef WIN32
#include <stdlib.h>
-#include <rpc/pmap_pro.h>
-#include <rpc/pmap_cln.h>
+#include <rpc/pmap_prot.h>
+#include <rpc/pmap_clnt.h>
#else
#include <rpc/pmap_prot.h>
#include <rpc/pmap_clnt.h>
#include <rpc/rpc.h>
#ifdef WIN32
-#include <rpc/pmap_pro.h>
-#include <rpc/pmap_cln.h>
+#include <rpc/pmap_prot.h>
+#include <rpc/pmap_clnt.h>
#include <rpc/pmap_rmt.h>
#include <stdio.h>
#include <errno.h>
#include <arpa/inet.h>
#define MAX_BROADCAST_SIZE 1400
+#ifndef SIOCGIFCONF
+#include <sys/sockio.h>
+#endif
+
extern int errno;
#endif
static struct timeval timeout = { 3, 0 };
#ifdef SIOCGIFBRDADDR /* 4.3BSD */
if (ioctl(sock, SIOCGIFBRDADDR, (char *)&ifreq) < 0) {
addrs[i++] = inet_makeaddr(inet_netof
- (sin->sin_addr.s_addr), INADDR_ANY);
+ (sin->sin_addr), INADDR_ANY);
} else {
addrs[i++] = ((struct sockaddr_in*)
&ifreq.ifr_addr)->sin_addr;
msg.acpted_rply.ar_results.proc = xdr_rmtcallres;
readfds = mask;
#ifdef WIN32
- switch (select(0 /* unused in winsock */, &readfds, (int *)NULL,
+ switch (select(0 /* unused in winsock */, &readfds, (int *)NULL, (int*)NULL,
#else
- switch (select(_rpc_dtablesize(), &readfds, (int *)NULL,
+ switch (select(_rpc_dtablesize(), &readfds, NULL, NULL,
#endif
- (int *)NULL, &t)) {
+ &t)) {
case 0: /* timed out */
stat = RPC_TIMEDOUT;
continue;
--- /dev/null
+/Makefile.in
+/Makefile
+/.libs
+/.deps
+/*.lo
+/*.la
\ No newline at end of file
--- /dev/null
+
+AUTOMAKE_OPTIONS = foreign
+
+oncrpcdir = $(includedir)/rpc
+oncrpc_DATA = \
+ auth.h \
+ clnt.h \
+ pmap_prot.h \
+ rpc_msg.h \
+ types.h \
+ auth_unix.h \
+ netdb.h \
+ pmap_rmt.h \
+ svc.h \
+ xdr.h \
+ bcopy.h \
+ pmap_clnt.h \
+ rpc.h \
+ svc_auth.h
+
+EXTRA_DIST = \
+ ${oncrpc_DATA}
#ifdef __cplusplus
extern "C" auth_stat _authenticate(...);
#else
-extern struct auth_stat _authenticate();
+extern enum auth_stat _authenticate();
#endif
#endif
#ifndef WIN32
#include <sys/time.h>
+#include <netinet/in.h>
+#include <netdb.h>
#endif
#ifndef INADDR_LOOPBACK
#define MAXHOSTNAMELEN 64
#endif
+#ifdef WIN32
typedef char *caddr_t;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef unsigned short u_short;
+#endif
#endif /* ndef __TYPES_RPC_HEADER__ */
#ifdef WIN32
#include <rpc/rpc.h>
-#include <rpc/pmap_cln.h>
+#include <rpc/pmap_clnt.h>
#include <stdio.h>
#else
#include <sys/errno.h>
break;
}
} while (stat == XPRT_MOREREQS);
+ }
}
}
#ifdef WIN32
switch (select(0 /* unused in winsock */, &readfds, (int *)0, (int *)0,
#else
- switch (select(_rpc_dtablesize(), &readfds, (int *)0, (int *)0,
+ switch (select(_rpc_dtablesize(), &readfds, NULL, NULL,
#endif
(struct timeval *)0)) {
case -1:
#ifdef WIN32
if (select(0 /* unused in winsock */, &readfds, (int*)NULL, (int*)NULL,
#else
- if (select(_rpc_dtablesize(), &readfds, (int*)NULL, (int*)NULL,
+ if (select(_rpc_dtablesize(), &readfds, NULL, NULL,
#endif
&wait_per_try) <= 0) {
#ifdef WIN32
static bool_t svcudp_freeargs();
static void svcudp_destroy();
+static cache_get();
+static cache_set();
+
+
static struct xp_ops svcudp_op = {
svcudp_recv,
svcudp_stat,
#define CACHE_PERROR(msg) \
nt_rpc_report(msg)
#else
-#define CACHE_PERROR(msg) \
- (void) fprintf(stderr,"%s\n", msg)
+#define CACHE_PERROR(msg) (void) fprintf(stderr,"%s\n", msg)
#endif
-#define ALLOC(type, size) \
- (type *) mem_alloc((unsigned) (sizeof(type) * (size)))
+#define ALLOC(type, size) (type *) mem_alloc((unsigned)(sizeof(type)*(size)))
-#define BZERO(addr, type, size) \
- bzero((char *) addr, sizeof(type) * (int) (size))
+#define BZERO(addr, type, size) bzero((char *) addr, sizeof(type) * (int) (size))
/*
* An entry in the cache
};
-
/*
* The entire cache
*/
/*
* the hashing function
*/
-#define CACHE_LOC(transp, xid) \
- (xid % (SPARSENESS*((struct udp_cache *) su_data(transp)->su_cache)->uc_size))
-
+#define CACHE_LOC(transp, xid) (xid % (SPARSENESS*((struct udp_cache *) su_data(transp)->su_cache)->uc_size))
/*
* Enable use of the cache.
uc->uc_addr = xprt->xp_raddr;
return(0);
}
-
return (FALSE);
}
c = *sizep;
- if ((c > maxsize) && (xdrs->x_op != XDR_FREE)) {
+ if ((c > maxsize || c > LASTUNSIGNED / elsize) &&
+ (xdrs->x_op != XDR_FREE)) {
return (FALSE);
}
nodesize = c * elsize;
static long * xdrrec_inline();
static void xdrrec_destroy();
+static bool_t flush_out();
+static bool_t get_input_bytes();
+static bool_t set_input_fragment();
+static bool_t skip_input_bytes();
+
static struct xdr_ops xdrrec_ops = {
xdrrec_getlong,
xdrrec_putlong,
AUTOMAKE_OPTIONS = foreign
+if USE_OUR_ONCRPC
+AM_CFLAGS = -I${top_srcdir}/oncrpc
+endif
+
bin_PROGRAMS = shar test-client
test_client_SOURCES = test-client.c
lib_LTLIBRARIES = libshib-target.la
+if USE_OUR_ONCRPC
+libshib_target_la_LIBADD = ${top_builddir}/oncrpc/liboncrpc.la
+AM_CFLAGS = -I${top_srcdir}/oncrpc
+AM_CXXFLAGS = -I${top_srcdir}/oncrpc
+endif
+
libshib_targetdir = $(includedir)/shib-target
libshib_target_HEADERS = shib-target.h shibrpc.h