From 2a43d772be1e45faa8e488d436b6e867371563fb Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Sat, 14 Feb 1998 02:27:25 +0000 Subject: [PATCH] "Renames" in the following refer to renaming of various exported functions and global variables to prefix them with "gssrpc_" or "_gssrpc" as might be appropriate. Some symbols which are unlikely to occur in vendor rpc implementations have retained their old names (notably the gssapi specific ones). * auth.h: Renames. * auth_any.c: Update header locations. * auth_gssapi.c: Punt naughty RCS keywords. Update header locations. Remove explicit extern decl of rpc_createrr (clnt.h gets it). Renames. * auth_gssapi.h: Punt naughty RCS keywords. * auth_gssapi_misc.c: Punt naught RCS keywords. Update header locations. * auth_none.c: Update header locations. Renames. * auth_unix.c: Update header locations. Renames. * auth_unix.h: Renames. * authunix_prot.c: Update header locations. * bindresvport.c: Renames. * clnt.h: Renames. * clnt_generic.c: Update header locations. * clnt_perror.c: Update header locations. * clnt_raw.c: Update header locations. Renames. * clnt_simple.c: Update header locations. Renames. * clnt_tcp.c: Update header locations. Renames. * clnt_udp.c: Upate header loations. Renames. * get_myaddress.c: Update header locations. Renames. * getrpcent.c: Update header locations. * getrpcport.c: Update header locations. Renames. * netdb.h: Update header locations. * pmap_clnt.c: Update header locations. Renames. * pmap_clnt.h: Renames. * pmap_getmaps.c: Update header locations. * pmap_getport.c: Update header locations. * pmap_prot.c: Update header locations. * pmap_prot.h: Renames. * pmap_prot2.c: Update header locations. * pmap_rmt.c: Update header locations. Renames. * pmap_rmt.h: Renames. * rpc.h: Update header locations. No longer include rpc/netdb.h. * rpc_callmsg.c: Update header locations. Renames. * rpc_commondata.c: Update header locations. * rpc_dtablesize.c: Renames. * rpc_msg.h: Renames. * rpc_prot.c: Update header locations. Renames. * svc.c: Update header locations. Renames. * svc.h: Renames. * svc_auth.c: Update header locations. Renames. * svc_auth.h: Renames. * svc_auth_any.c: Update header locations. * svc_auth_gssapi.c: Punt naughty RCS keywords. Update header locations. Renames. * svc_auth_unix.c: Renames. * svc_raw.c: Update header locations. * svc_run.c: Update header locations. Renames. * svc_simple.c: Update header locations. Renames. Make pl static. * svc_tcp.c: Update header locations. Renames. * svc_udp.c: Update header locations. Renames. * xdr.c: Update header locations. Renames. * xdr.h: Renames. * xdr_alloc.c: Punt naughty RCS keywords. Update header locations. * xdr_array.c: Update header locations. * xdr_float.c: Update header locations. * xdr_mem.c: Update header locations. * xdr_rec.c: Update header locations. * xdr_reference.c: Update header locations. * xdr_stdio.c: Update header locations. * Makefile.in: Bump major version due to changes. Don't build getrpcent.o, since we don't use it, and dealing with the rpc/netdb.h lossage was a major pain. Also, rename HDRDIR to $(BUILDTOP)/gssrpc in order to avoid problems with system headers including rpc/*.h. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10447 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/rpc/ChangeLog | 72 +++++++++++ src/lib/rpc/Makefile.in | 7 +- src/lib/rpc/auth.h | 11 ++ src/lib/rpc/auth_any.c | 6 +- src/lib/rpc/auth_gssapi.c | 22 +--- src/lib/rpc/auth_gssapi.h | 74 ----------- src/lib/rpc/auth_gssapi_misc.c | 106 +-------------- src/lib/rpc/auth_none.c | 10 +- src/lib/rpc/auth_unix.c | 16 +-- src/lib/rpc/auth_unix.h | 1 + src/lib/rpc/authunix_prot.c | 8 +- src/lib/rpc/bindresvport.c | 2 +- src/lib/rpc/clnt.h | 12 ++ src/lib/rpc/clnt_generic.c | 2 +- src/lib/rpc/clnt_perror.c | 6 +- src/lib/rpc/clnt_raw.c | 4 +- src/lib/rpc/clnt_simple.c | 4 +- src/lib/rpc/clnt_tcp.c | 10 +- src/lib/rpc/clnt_udp.c | 10 +- src/lib/rpc/get_myaddress.c | 10 +- src/lib/rpc/getrpcent.c | 2 +- src/lib/rpc/getrpcport.c | 4 +- src/lib/rpc/netdb.h | 2 +- src/lib/rpc/pmap_clnt.c | 8 +- src/lib/rpc/pmap_clnt.h | 7 + src/lib/rpc/pmap_getmaps.c | 6 +- src/lib/rpc/pmap_getport.c | 6 +- src/lib/rpc/pmap_prot.c | 6 +- src/lib/rpc/pmap_prot.h | 2 + src/lib/rpc/pmap_prot2.c | 6 +- src/lib/rpc/pmap_rmt.c | 10 +- src/lib/rpc/pmap_rmt.h | 2 + src/lib/rpc/rpc.h | 26 ++-- src/lib/rpc/rpc_callmsg.c | 6 +- src/lib/rpc/rpc_commondata.c | 2 +- src/lib/rpc/rpc_dtablesize.c | 2 +- src/lib/rpc/rpc_msg.h | 5 + src/lib/rpc/rpc_prot.c | 14 +- src/lib/rpc/svc.c | 10 +- src/lib/rpc/svc.h | 30 ++++- src/lib/rpc/svc_auth.c | 6 +- src/lib/rpc/svc_auth.h | 1 + src/lib/rpc/svc_auth_any.c | 2 +- src/lib/rpc/svc_auth_gssapi.c | 227 +-------------------------------- src/lib/rpc/svc_auth_unix.c | 6 +- src/lib/rpc/svc_raw.c | 2 +- src/lib/rpc/svc_run.c | 4 +- src/lib/rpc/svc_simple.c | 6 +- src/lib/rpc/svc_tcp.c | 8 +- src/lib/rpc/svc_udp.c | 6 +- src/lib/rpc/xdr.c | 6 +- src/lib/rpc/xdr.h | 37 ++++++ src/lib/rpc/xdr_alloc.c | 42 +----- src/lib/rpc/xdr_array.c | 4 +- src/lib/rpc/xdr_float.c | 4 +- src/lib/rpc/xdr_mem.c | 4 +- src/lib/rpc/xdr_rec.c | 4 +- src/lib/rpc/xdr_reference.c | 4 +- src/lib/rpc/xdr_stdio.c | 4 +- 59 files changed, 337 insertions(+), 589 deletions(-) diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog index 49d3c42f2..e55956126 100644 --- a/src/lib/rpc/ChangeLog +++ b/src/lib/rpc/ChangeLog @@ -1,3 +1,75 @@ +Fri Feb 13 20:57:49 1998 Tom Yu + + * auth.h: Renames. + * auth_any.c: Update header locations. + * auth_gssapi.c: Punt naughty RCS keywords. Update header + locations. Remove explicit extern decl of rpc_createrr (clnt.h + gets it). Renames. + * auth_gssapi.h: Punt naughty RCS keywords. + * auth_gssapi_misc.c: Punt naught RCS keywords. Update header + locations. + * auth_none.c: Update header locations. Renames. + * auth_unix.c: Update header locations. Renames. + * auth_unix.h: Renames. + * authunix_prot.c: Update header locations. + * bindresvport.c: Renames. + * clnt.h: Renames. + * clnt_generic.c: Update header locations. + * clnt_perror.c: Update header locations. + * clnt_raw.c: Update header locations. Renames. + * clnt_simple.c: Update header locations. Renames. + * clnt_tcp.c: Update header locations. Renames. + * clnt_udp.c: Upate header loations. Renames. + * get_myaddress.c: Update header locations. Renames. + * getrpcent.c: Update header locations. + * getrpcport.c: Update header locations. Renames. + * netdb.h: Update header locations. + * pmap_clnt.c: Update header locations. Renames. + * pmap_clnt.h: Renames. + * pmap_getmaps.c: Update header locations. + * pmap_getport.c: Update header locations. + * pmap_prot.c: Update header locations. + * pmap_prot.h: Renames. + * pmap_prot2.c: Update header locations. + * pmap_rmt.c: Update header locations. Renames. + * pmap_rmt.h: Renames. + * rpc.h: Update header locations. No longer include rpc/netdb.h. + * rpc_callmsg.c: Update header locations. Renames. + * rpc_commondata.c: Update header locations. + * rpc_dtablesize.c: Renames. + * rpc_msg.h: Renames. + * rpc_prot.c: Update header locations. Renames. + * svc.c: Update header locations. Renames. + * svc.h: Renames. + * svc_auth.c: Update header locations. Renames. + * svc_auth.h: Renames. + * svc_auth_any.c: Update header locations. + * svc_auth_gssapi.c: Punt naughty RCS keywords. Update header + locations. Renames. + * svc_auth_unix.c: Renames. + * svc_raw.c: Update header locations. + * svc_run.c: Update header locations. Renames. + * svc_simple.c: Update header locations. Renames. Make pl + static. + * svc_tcp.c: Update header locations. Renames. + * svc_udp.c: Update header locations. Renames. + * xdr.c: Update header locations. Renames. + * xdr.h: Renames. + * xdr_alloc.c: Punt naughty RCS keywords. Update header + locations. + * xdr_array.c: Update header locations. + * xdr_float.c: Update header locations. + * xdr_mem.c: Update header locations. + * xdr_rec.c: Update header locations. + * xdr_reference.c: Update header locations. + * xdr_stdio.c: Update header locations. + + * Makefile.in: Bump major version due to changes. Don't build + getrpcent.o, since we don't use it, and dealing with the + rpc/netdb.h lossage was a major pain. Also, rename HDRDIR to + $(BUILDTOP)/gssrpc in order to avoid problems with system headers + including rpc/*.h. + Thu Feb 12 16:18:22 1998 Tom Yu * configure.in: Add commented out AC_OUTPUT to force autoreconf to diff --git a/src/lib/rpc/Makefile.in b/src/lib/rpc/Makefile.in index bf0ffff75..29842f4ec 100644 --- a/src/lib/rpc/Makefile.in +++ b/src/lib/rpc/Makefile.in @@ -6,7 +6,7 @@ CFLAGS = $(CCOPTS) $(DEFS) -DGSSAPI_KRB5 -DDEBUG_GSSAPI=0 ##DOSLIBNAME=libgssrpc.lib LIB=gssrpc -LIBMAJOR=1 +LIBMAJOR=2 LIBMINOR=0 STOBJLISTS=OBJS.ST SHLIB_EXPDEPS= \ @@ -35,7 +35,6 @@ SRCS = $(srcdir)/auth_none.c \ $(srcdir)/clnt_udp.c \ $(srcdir)/rpc_dtablesize.c \ $(srcdir)/get_myaddress.c \ - $(srcdir)/getrpcent.c \ $(srcdir)/getrpcport.c \ $(srcdir)/pmap_clnt.c \ $(srcdir)/pmap_getmaps.c \ @@ -80,7 +79,6 @@ OBJS = auth_none.$(OBJEXT) \ clnt_udp.$(OBJEXT) \ rpc_dtablesize.$(OBJEXT) \ get_myaddress.$(OBJEXT) \ - getrpcent.$(OBJEXT) \ getrpcport.$(OBJEXT) \ pmap_clnt.$(OBJEXT) \ pmap_getmaps.$(OBJEXT) \ @@ -126,7 +124,6 @@ STLIBOBJS = \ clnt_udp.o \ rpc_dtablesize.o \ get_myaddress.o \ - getrpcent.o \ getrpcport.o \ pmap_clnt.o \ pmap_getmaps.o \ @@ -156,7 +153,7 @@ STLIBOBJS = \ xdr_stdio.o \ xdr_alloc.o -HDRDIR=$(BUILDTOP)/include/rpc +HDRDIR=$(BUILDTOP)/include/gssrpc HDRS= $(HDRDIR)/auth.h \ $(HDRDIR)/auth_gssapi.h \ diff --git a/src/lib/rpc/auth.h b/src/lib/rpc/auth.h index 4b0a40ccc..a27bdbae4 100644 --- a/src/lib/rpc/auth.h +++ b/src/lib/rpc/auth.h @@ -72,6 +72,7 @@ union des_block { char c[8]; }; typedef union des_block des_block; +#define xdr_des_block gssrpc_xdr_des_block extern bool_t xdr_des_block(); /* @@ -151,6 +152,7 @@ typedef struct { ((*((auth)->ah_ops->ah_destroy))(auth)) +#define _null_auth _gssrpc_null_auth extern struct opaque_auth _null_auth; @@ -162,6 +164,10 @@ extern struct opaque_auth _null_auth; * Any style authentication. These routines can be used by any * authentication style that does not use the wrap/unwrap functions. */ + +#define authany_wrap gssrpc_authany_wrap +#define authany_unwrap gssrpc_authany_unwrap + int authany_wrap(), authany_unwrap(); /* @@ -173,6 +179,11 @@ int authany_wrap(), authany_unwrap(); * int len; * int *aup_gids; */ +#define authunix_create gssrpc_authunix_create +#define authunix_create_default gssrpc_authunix_create_default +#define authnone_create gssrpc_authnone_create +#define authdes_create gssrpc_authdes_create + extern AUTH *authunix_create(); extern AUTH *authunix_create_default(); /* takes no parameters */ extern AUTH *authnone_create(); /* takes no parameters */ diff --git a/src/lib/rpc/auth_any.c b/src/lib/rpc/auth_any.c index 5e2a8633a..37731e0fa 100644 --- a/src/lib/rpc/auth_any.c +++ b/src/lib/rpc/auth_any.c @@ -5,9 +5,9 @@ */ #include -#include -#include -#include +#include +#include +#include int authany_wrap(auth, xdrs, xfunc, xwhere) AUTH *auth; diff --git a/src/lib/rpc/auth_gssapi.c b/src/lib/rpc/auth_gssapi.c index 455856cc2..1c85765c9 100644 --- a/src/lib/rpc/auth_gssapi.c +++ b/src/lib/rpc/auth_gssapi.c @@ -1,14 +1,8 @@ /* * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved. * - * $Header$ - * */ -#if !defined(lint) && !defined(__CODECENTER__) -static char *rcsid = "$Header$"; -#endif - #include #include #include @@ -19,8 +13,8 @@ static char *rcsid = "$Header$"; #include #endif -#include -#include +#include +#include #ifdef __CODECENTER__ #define DEBUG_GSSAPI 1 @@ -75,8 +69,6 @@ struct auth_gssapi_data { }; #define AUTH_PRIVATE(auth) ((struct auth_gssapi_data *)auth->ah_private) -extern struct rpc_createerr rpc_createerr; - /* * Function: auth_gssapi_create_default * @@ -419,7 +411,7 @@ next_token: AUTH_PRIVATE(auth)->seq_num)); /* we no longer need these results.. */ - xdr_free(xdr_authgssapi_init_res, &call_res); + gssrpc_xdr_free(xdr_authgssapi_init_res, &call_res); } } else if (call_res.signed_isn.length != 0) { PRINTF(("gssapi_create: got signed isn, can't check yet\n")); @@ -596,8 +588,8 @@ static bool_t auth_gssapi_marshall(auth, xdrs) auth->ah_verf.oa_base = out_buf.value; auth->ah_verf.oa_length = out_buf.length; - if (! xdr_opaque_auth(xdrs, &auth->ah_cred) || - ! xdr_opaque_auth(xdrs, &auth->ah_verf)) { + if (! gssrpc_xdr_opaque_auth(xdrs, &auth->ah_cred) || + ! gssrpc_xdr_opaque_auth(xdrs, &auth->ah_verf)) { (void) gss_release_buffer(&minor_stat, &out_buf); return FALSE; } @@ -608,8 +600,8 @@ static bool_t auth_gssapi_marshall(auth, xdrs) auth->ah_verf.oa_base = NULL; auth->ah_verf.oa_length = 0; - if (! xdr_opaque_auth(xdrs, &auth->ah_cred) || - ! xdr_opaque_auth(xdrs, &auth->ah_verf)) { + if (! gssrpc_xdr_opaque_auth(xdrs, &auth->ah_cred) || + ! gssrpc_xdr_opaque_auth(xdrs, &auth->ah_verf)) { return FALSE; } } diff --git a/src/lib/rpc/auth_gssapi.h b/src/lib/rpc/auth_gssapi.h index 88b7e46ce..218b5cb9d 100644 --- a/src/lib/rpc/auth_gssapi.h +++ b/src/lib/rpc/auth_gssapi.h @@ -4,80 +4,6 @@ * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved. * * $Id$ - * $Source$ - * - * $Log$ - * Revision 1.19 1996/08/14 00:01:34 tlyu - * * getrpcent.c: Add PROTOTYPE and conditionalize function - * prototypes. - * - * * xdr.h: Add PROTOTYPE and conditionalize function prototypes. - * - * * svc_auth_gssapi.c: Remove ANSI string concatenation, de-ANSI-fy - * function definitions. - * - * * auth_gssapi_misc.c (auth_gssapi_display_status_1): Remove ANSI - * string concatenation, de-ANSI-fy function definitions. - * - * * auth_gssapi.h: Add PROTOTYPE and conditionalize function - * prototypes. - * - * * auth_gssapi.c (auth_gssapi_create): remove ANSI-ish string - * concatenation, de-ANSI-fy function definitions. - * - * Revision 1.18 1996/07/22 20:39:41 marc - * this commit includes all the changes on the OV_9510_INTEGRATION and - * OV_MERGE branches. This includes, but is not limited to, the new openvision - * admin system, and major changes to gssapi to add functionality, and bring - * the implementation in line with rfc1964. before committing, the - * code was built and tested for netbsd and solaris. - * - * Revision 1.17.4.1 1996/07/18 04:18:31 marc - * merged in changes from OV_9510_BP to OV_9510_FINAL1 - * - * Revision 1.17.2.1 1996/06/20 23:35:44 marc - * File added to the repository on a branch - * - * Revision 1.17 1996/05/12 06:11:38 marc - * renamed lots of types: u_foo to unsigned foo, and foo32 to rpc_foo32. This is to make autoconfiscation less painful. - * - * Revision 1.16 1996/01/31 19:16:16 grier - * [secure/3570] - * Remove (void *) casts to memcpy() args - * - * Revision 1.15 1995/12/28 17:54:34 jik - * Don't define DEBUG_GSSAPI here. - * - * Revision 1.14 1995/12/13 14:03:01 grier - * Longs to ints for Alpha - * - * Revision 1.13 1995/11/07 23:15:26 grier - * memcpy() casts - * - * Revision 1.12 1995/05/25 18:35:59 bjaspan - * [secure-rpc/3103] log misc errors from RPC - * - * Revision 1.11 1994/10/27 12:39:14 jik - * [secure-rpc/2808: add credential versioning] - * - * Sandbox: - * - * [secure-rpc/2808] add version field to client creds - * - * Revision 1.11 1994/10/26 20:04:00 bjaspan - * [secure-rpc/2808] add version field to client creds - * - * Revision 1.10 1993/11/12 02:32:50 bjaspan - * add badauth, don't use const_gss_OID - * - * Revision 1.9 1993/11/03 23:46:15 bjaspan - * new log_badverf format - * - * Revision 1.8 1993/11/03 21:21:38 bjaspan - * added log_badverf - * - * Revision 1.7 1993/11/03 01:29:56 bjaspan - * add const to gss_nt_* * */ diff --git a/src/lib/rpc/auth_gssapi_misc.c b/src/lib/rpc/auth_gssapi_misc.c index b1e78b968..818aaeb46 100644 --- a/src/lib/rpc/auth_gssapi_misc.c +++ b/src/lib/rpc/auth_gssapi_misc.c @@ -1,115 +1,13 @@ /* * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved. * - * $Header$ - * - * $Log$ - * Revision 1.15 1996/08/14 00:01:37 tlyu - * * getrpcent.c: Add PROTOTYPE and conditionalize function - * prototypes. - * - * * xdr.h: Add PROTOTYPE and conditionalize function prototypes. - * - * * svc_auth_gssapi.c: Remove ANSI string concatenation, de-ANSI-fy - * function definitions. - * - * * auth_gssapi_misc.c (auth_gssapi_display_status_1): Remove ANSI - * string concatenation, de-ANSI-fy function definitions. - * - * * auth_gssapi.h: Add PROTOTYPE and conditionalize function - * prototypes. - * - * * auth_gssapi.c (auth_gssapi_create): remove ANSI-ish string - * concatenation, de-ANSI-fy function definitions. - * - * Revision 1.14 1996/07/22 20:39:44 marc - * this commit includes all the changes on the OV_9510_INTEGRATION and - * OV_MERGE branches. This includes, but is not limited to, the new openvision - * admin system, and major changes to gssapi to add functionality, and bring - * the implementation in line with rfc1964. before committing, the - * code was built and tested for netbsd and solaris. - * - * Revision 1.13.4.1 1996/07/18 04:18:32 marc - * merged in changes from OV_9510_BP to OV_9510_FINAL1 - * - * Revision 1.13.2.1 1996/06/20 23:35:49 marc - * File added to the repository on a branch - * - * Revision 1.13 1996/05/12 06:11:38 marc - * renamed lots of types: u_foo to unsigned foo, and foo32 to rpc_foo32. This is to make autoconfiscation less painful. - * - * Revision 1.12 1996/02/25 15:53:57 grier - * [secure/3570] - * OSF1 long changes - * - * Revision 1.11 1995/12/13 14:03:30 grier - * Longs to ints for Alpha - * - * Revision 1.10 1994/10/27 12:39:23 jik - * [secure-rpc/2808: add credential versioning] - * - * Sandbox: - * - * [secure-rpc/2808] back out the backwards compat hack (I only put it - * there in case we ever decide we want it, which we won't) and just - * handle the version field as if it were always there - * - * [secure-rpc/2808] add a backwards-compatible version field encoder - * - * change to use GSS_ERROR &c macros; I don't think this is correct - * ============================================================================= - * - * Revision 1.12 1994/10/26 19:48:45 bjaspan - * [secure-rpc/2808] back out the backwards compat hack (I only put it - * there in case we ever decide we want it, which we won't) and just - * handle the version field as if it were always there - * - * Revision 1.11 1994/10/26 19:47:42 bjaspan - * [secure-rpc/2808] add a backwards-compatible version field encoder - * - * Revision 1.10 1993/12/19 22:19:40 bjaspan - * [secure-rpc/1077] use free instead of xdr_free(xdr_bytes,...) because - * xdr_bytes takes non-standard arguments - * - * Revision 1.9 1993/12/08 21:43:37 bjaspan - * use AUTH_GSSAPI_DISPLAY_STATUS macro, reindent - * - * Revision 1.8 1993/12/06 21:21:21 bjaspan - * debugging levels - * - * Revision 1.7 1993/11/03 23:46:34 bjaspan - * add debugging printfs showing amount of data wrapped/unwrapped - * - * Revision 1.6 1993/11/03 21:21:53 bjaspan - * unstatic misc_debug_gssapi - * - * Revision 1.5 1993/11/01 19:55:54 bjaspan - * improve display_status messages, and include gss_{major,minor} - * - * Revision 1.4 1993/10/28 22:08:21 bjaspan - * wrap/unwrap_data include sequence number in arg/result block - * - * Revision 1.3 1993/10/27 18:26:16 bjaspan - * use xdr_free instead of free(in_buf.value); doesn't actually make a - * difference, though - * - * Revision 1.2 1993/10/26 21:12:38 bjaspan - * cleaning - * - * Revision 1.1 1993/10/19 03:12:28 bjaspan - * Initial revision - * */ -#if !defined(lint) && !defined(__CODECENTER__) -static char *rcsid = "$Header$"; -#endif - -#include +#include #include #include -#include +#include #ifdef __CODECENTER__ #define DEBUG_GSSAPI 1 diff --git a/src/lib/rpc/auth_none.c b/src/lib/rpc/auth_none.c index 90f3bb8be..5e97405c0 100644 --- a/src/lib/rpc/auth_none.c +++ b/src/lib/rpc/auth_none.c @@ -39,9 +39,9 @@ static char sccsid[] = "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro"; * Copyright (C) 1984, Sun Microsystems, Inc. */ -#include -#include -#include +#include +#include +#include #include #define MAX_MARSHEL_SIZE 20 @@ -89,8 +89,8 @@ authnone_create() xdrs = &xdr_stream; xdrmem_create(xdrs, ap->marshalled_client, (unsigned int)MAX_MARSHEL_SIZE, XDR_ENCODE); - (void)xdr_opaque_auth(xdrs, &ap->no_client.ah_cred); - (void)xdr_opaque_auth(xdrs, &ap->no_client.ah_verf); + (void)gssrpc_xdr_opaque_auth(xdrs, &ap->no_client.ah_cred); + (void)gssrpc_xdr_opaque_auth(xdrs, &ap->no_client.ah_verf); ap->mcnt = XDR_GETPOS(xdrs); XDR_DESTROY(xdrs); } diff --git a/src/lib/rpc/auth_unix.c b/src/lib/rpc/auth_unix.c index b41e442fc..4e96b82c6 100644 --- a/src/lib/rpc/auth_unix.c +++ b/src/lib/rpc/auth_unix.c @@ -45,10 +45,10 @@ static char sccsid[] = "@(#)auth_unix.c 1.19 87/08/11 Copyr 1984 Sun Micro"; #include -#include -#include -#include -#include +#include +#include +#include +#include /* @@ -224,11 +224,11 @@ authunix_validate(auth, verf) au->au_shcred.oa_length); au->au_shcred.oa_base = NULL; } - if (xdr_opaque_auth(&xdrs, &au->au_shcred)) { + if (gssrpc_xdr_opaque_auth(&xdrs, &au->au_shcred)) { auth->ah_cred = au->au_shcred; } else { xdrs.x_op = XDR_FREE; - (void)xdr_opaque_auth(&xdrs, &au->au_shcred); + (void)gssrpc_xdr_opaque_auth(&xdrs, &au->au_shcred); au->au_shcred.oa_base = NULL; auth->ah_cred = au->au_origcred; } @@ -312,8 +312,8 @@ marshal_new_auth(auth) register struct audata *au = AUTH_PRIVATE(auth); xdrmem_create(xdrs, au->au_marshed, MAX_AUTH_BYTES, XDR_ENCODE); - if ((! xdr_opaque_auth(xdrs, &(auth->ah_cred))) || - (! xdr_opaque_auth(xdrs, &(auth->ah_verf)))) { + if ((! gssrpc_xdr_opaque_auth(xdrs, &(auth->ah_cred))) || + (! gssrpc_xdr_opaque_auth(xdrs, &(auth->ah_verf)))) { perror("auth_none.c - Fatal marshalling problem"); } else { au->au_mpos = XDR_GETPOS(xdrs); diff --git a/src/lib/rpc/auth_unix.h b/src/lib/rpc/auth_unix.h index 4b54f1db6..e4ee994d8 100644 --- a/src/lib/rpc/auth_unix.h +++ b/src/lib/rpc/auth_unix.h @@ -60,6 +60,7 @@ struct authunix_parms { int *aup_gids; }; +#define xdr_authunix_parms gssrpc_xdr_authunix_parms extern bool_t xdr_authunix_parms(); /* diff --git a/src/lib/rpc/authunix_prot.c b/src/lib/rpc/authunix_prot.c index 36770f298..e7f863dd3 100644 --- a/src/lib/rpc/authunix_prot.c +++ b/src/lib/rpc/authunix_prot.c @@ -39,10 +39,10 @@ static char sccsid[] = "@(#)authunix_prot.c 1.15 87/08/11 Copyr 1984 Sun Micro"; */ -#include -#include -#include -#include +#include +#include +#include +#include /* * XDR for unix authentication parameters. diff --git a/src/lib/rpc/bindresvport.c b/src/lib/rpc/bindresvport.c index 8deb12499..b006e30f3 100644 --- a/src/lib/rpc/bindresvport.c +++ b/src/lib/rpc/bindresvport.c @@ -41,7 +41,7 @@ static char sccsid[] = "@(#)bindresvport.c 2.2 88/07/29 4.0 RPCSRC 1.8 88/02/08 /* * Bind a socket to a privileged IP port */ -bindresvport(sd, sin) +gssrpc_bindresvport(sd, sin) int sd; struct sockaddr_in *sin; { diff --git a/src/lib/rpc/clnt.h b/src/lib/rpc/clnt.h index 442a96d44..1f82700d0 100644 --- a/src/lib/rpc/clnt.h +++ b/src/lib/rpc/clnt.h @@ -239,12 +239,14 @@ typedef struct { * rpc_u_int32 prog; * rpc_u_int32 vers; */ +#define clntraw_create gssrpc_clntraw_create extern CLIENT *clntraw_create(); /* * Generic client creation routine. Supported protocols are "udp" and "tcp" */ +#define clnt_create gssrpc_clnt_create extern CLIENT * clnt_create(/*host, prog, vers, prot*/); /* char *host; -- hostname @@ -267,6 +269,7 @@ clnt_create(/*host, prog, vers, prot*/); /* * unsigned int sendsz; * unsigned int recvsz; */ +#define clnttcp_create gssrpc_clnttcp_create extern CLIENT *clnttcp_create(); /* @@ -290,29 +293,37 @@ extern CLIENT *clnttcp_create(); * unsigned int sendsz; * unsigned int recvsz; */ +#define clntudp_create gssrpc_clntudp_create +#define clntudp_bufcreate gssrpc_clntudp_bufcreate extern CLIENT *clntudp_create(); extern CLIENT *clntudp_bufcreate(); /* * Print why creation failed */ +#define clnt_pcreateerror gssrpc_clnt_pcreateerror +#define clnt_spcreateerror gssrpc_clnt_spcreateerror void clnt_pcreateerror(/* char *msg */); /* stderr */ char *clnt_spcreateerror(/* char *msg */); /* string */ /* * Like clnt_perror(), but is more verbose in its output */ +#define clnt_perrno gssrpc_clnt_perrno void clnt_perrno(/* enum clnt_stat num */); /* stderr */ /* * Print an English error message, given the client error code */ +#define clnt_perror gssrpc_clnt_perror +#define clnt_sperror gssrpc_clnt_sperror void clnt_perror(/* CLIENT *clnt, char *msg */); /* stderr */ char *clnt_sperror(/* CLIENT *clnt, char *msg */); /* string */ /* * If a creation fails, the following allows the user to figure out why. */ +#define rpc_createerr gssrpc_rpc_createrr struct rpc_createerr { enum clnt_stat cf_stat; struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */ @@ -325,6 +336,7 @@ extern struct rpc_createerr rpc_createerr; /* * Copy error message to buffer. */ +#define clnt_sperrno gssrpc_clnt_sperrno char *clnt_sperrno(/* enum clnt_stat num */); /* string */ diff --git a/src/lib/rpc/clnt_generic.c b/src/lib/rpc/clnt_generic.c index 9eeabe152..c59ac9429 100644 --- a/src/lib/rpc/clnt_generic.c +++ b/src/lib/rpc/clnt_generic.c @@ -33,7 +33,7 @@ static char sccsid[] = "@(#)clnt_generic.c 1.4 87/08/11 (C) 1987 SMI"; /* * Copyright (C) 1987, Sun Microsystems, Inc. */ -#include +#include #include #include #include diff --git a/src/lib/rpc/clnt_perror.c b/src/lib/rpc/clnt_perror.c index 82b6317f7..560cb27b7 100644 --- a/src/lib/rpc/clnt_perror.c +++ b/src/lib/rpc/clnt_perror.c @@ -41,9 +41,9 @@ static char sccsid[] = "@(#)clnt_perror.c 1.15 87/10/07 Copyr 1984 Sun Micro"; #include #include -#include -#include -#include +#include +#include +#include #ifdef NEED_SYS_ERRLIST extern char *sys_errlist[]; diff --git a/src/lib/rpc/clnt_raw.c b/src/lib/rpc/clnt_raw.c index d05dbaa7e..ec5fa6f90 100644 --- a/src/lib/rpc/clnt_raw.c +++ b/src/lib/rpc/clnt_raw.c @@ -42,7 +42,7 @@ static char sccsid[] = "@(#)clnt_raw.c 1.22 87/08/11 Copyr 1984 Sun Micro"; * any interference from the kernal. */ -#include +#include #define MCALL_MSG_SIZE 24 @@ -190,7 +190,7 @@ call_again: } if (msg.acpted_rply.ar_verf.oa_base != NULL) { xdrs->x_op = XDR_FREE; - (void)xdr_opaque_auth(xdrs, &(msg.acpted_rply.ar_verf)); + (void)gssrpc_xdr_opaque_auth(xdrs, &(msg.acpted_rply.ar_verf)); } } diff --git a/src/lib/rpc/clnt_simple.c b/src/lib/rpc/clnt_simple.c index 9b5ba9fa6..b3d2eb330 100644 --- a/src/lib/rpc/clnt_simple.c +++ b/src/lib/rpc/clnt_simple.c @@ -39,7 +39,7 @@ static char sccsid[] = "@(#)clnt_simple.c 1.35 87/08/11 Copyr 1984 Sun Micro"; */ #include -#include +#include #include #include #include @@ -51,7 +51,7 @@ static struct callrpc_private { char *oldhost; } *callrpc_private; -callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out) +gssrpc_callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out) char *host; xdrproc_t inproc, outproc; char *in, *out; diff --git a/src/lib/rpc/clnt_tcp.c b/src/lib/rpc/clnt_tcp.c index c573897f7..6f36553b9 100644 --- a/src/lib/rpc/clnt_tcp.c +++ b/src/lib/rpc/clnt_tcp.c @@ -51,11 +51,11 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro"; */ #include -#include +#include #include #include #include -#include +#include #define MCALL_MSG_SIZE 24 @@ -153,7 +153,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz) */ if (*sockp < 0) { *sockp = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - (void)bindresvport(*sockp, (struct sockaddr_in *)0); + (void)gssrpc_bindresvport(*sockp, (struct sockaddr_in *)0); if ((*sockp < 0) || (connect(*sockp, (struct sockaddr *)raddr, sizeof(*raddr)) < 0)) { @@ -314,7 +314,7 @@ call_again: if ((reply_msg.rm_reply.rp_stat == MSG_ACCEPTED) && (reply_msg.acpted_rply.ar_verf.oa_base != NULL)) { xdrs->x_op = XDR_FREE; - (void)xdr_opaque_auth(xdrs, &(reply_msg.acpted_rply.ar_verf)); + (void)gssrpc_xdr_opaque_auth(xdrs, &(reply_msg.acpted_rply.ar_verf)); } return (ct->ct_error.re_status); } @@ -425,7 +425,7 @@ readtcp(ct, buf, len) #endif /* def FD_SETSIZE */ while (TRUE) { readfds = mask; - switch (select(_rpc_dtablesize(), &readfds, (fd_set*)NULL, (fd_set*)NULL, + switch (select(_gssrpc_rpc_dtablesize(), &readfds, (fd_set*)NULL, (fd_set*)NULL, &(ct->ct_wait))) { case 0: ct->ct_error.re_status = RPC_TIMEDOUT; diff --git a/src/lib/rpc/clnt_udp.c b/src/lib/rpc/clnt_udp.c index 9e1d563af..7ef61c975 100644 --- a/src/lib/rpc/clnt_udp.c +++ b/src/lib/rpc/clnt_udp.c @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro"; */ #include -#include +#include #include #include #if defined(sun) @@ -46,7 +46,7 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro"; #endif #include #include -#include +#include extern int errno; @@ -178,7 +178,7 @@ clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz) goto fooy; } /* attempt to bind to prov port */ - (void)bindresvport(*sockp, (struct sockaddr_in *)0); + (void)gssrpc_bindresvport(*sockp, (struct sockaddr_in *)0); /* the sockets rpc controls are non-blocking */ (void)ioctl(*sockp, FIONBIO, (char *) &dontblock); cu->cu_closeit = TRUE; @@ -296,7 +296,7 @@ send_again: #endif /* def FD_SETSIZE */ for (;;) { readfds = mask; - switch (select(_rpc_dtablesize(), &readfds, (fd_set *)NULL, + switch (select(_gssrpc_rpc_dtablesize(), &readfds, (fd_set *)NULL, (fd_set *)NULL, &(cu->cu_wait))) { case 0: @@ -374,7 +374,7 @@ send_again: if ((reply_msg.rm_reply.rp_stat == MSG_ACCEPTED) && (reply_msg.acpted_rply.ar_verf.oa_base != NULL)) { xdrs->x_op = XDR_FREE; - (void)xdr_opaque_auth(xdrs, + (void)gssrpc_xdr_opaque_auth(xdrs, &(reply_msg.acpted_rply.ar_verf)); } } /* end of valid reply message */ diff --git a/src/lib/rpc/get_myaddress.c b/src/lib/rpc/get_myaddress.c index b6c456c69..f86f86dad 100644 --- a/src/lib/rpc/get_myaddress.c +++ b/src/lib/rpc/get_myaddress.c @@ -40,15 +40,15 @@ static char sccsid[] = "@(#)get_myaddress.c 1.4 87/08/11 Copyr 1984 Sun Micro"; #ifdef GSSAPI_KRB5 #include -#include -#include +#include +#include #include #include #include /* * don't use gethostbyname, which would invoke yellow pages */ -get_myaddress(addr) +gssrpc_get_myaddress(addr) struct sockaddr_in *addr; { krb5_address **addrs, **a; @@ -79,8 +79,8 @@ get_myaddress(addr) } #else /* !GSSAPI_KRB5 */ -#include -#include +#include +#include #include #if defined(sun) #include diff --git a/src/lib/rpc/getrpcent.c b/src/lib/rpc/getrpcent.c index 506ebce90..ed674c085 100644 --- a/src/lib/rpc/getrpcent.c +++ b/src/lib/rpc/getrpcent.c @@ -39,7 +39,7 @@ static char sccsid[] = "@(#)getrpcent.c 1.9 87/08/11 Copyr 1984 Sun Micro"; #include #include #include -#include +#include #include #include diff --git a/src/lib/rpc/getrpcport.c b/src/lib/rpc/getrpcport.c index 1bc239f94..4a80b9c2e 100644 --- a/src/lib/rpc/getrpcport.c +++ b/src/lib/rpc/getrpcport.c @@ -36,11 +36,11 @@ static char sccsid[] = "@(#)getrpcport.c 1.3 87/08/11 SMI"; */ #include -#include +#include #include #include -getrpcport(host, prognum, versnum, proto) +gssrpc_getrpcport(host, prognum, versnum, proto) char *host; { struct sockaddr_in addr; diff --git a/src/lib/rpc/netdb.h b/src/lib/rpc/netdb.h index cbc5fb1d0..69267874e 100644 --- a/src/lib/rpc/netdb.h +++ b/src/lib/rpc/netdb.h @@ -31,7 +31,7 @@ * Mountain View, California 94043 */ /* @(#)rpc.h 1.8 87/07/24 SMI */ -#include +#include /* since the gssrpc library requires that any application using it be built with these header files, I am making the decision that any app which uses the rpcent routines must use this header file, or something diff --git a/src/lib/rpc/pmap_clnt.c b/src/lib/rpc/pmap_clnt.c index 7218777cc..a82d8599f 100644 --- a/src/lib/rpc/pmap_clnt.c +++ b/src/lib/rpc/pmap_clnt.c @@ -38,15 +38,17 @@ static char sccsid[] = "@(#)pmap_clnt.c 1.37 87/08/11 Copyr 1984 Sun Micro"; * Copyright (C) 1984, Sun Microsystems, Inc. */ -#include -#include -#include +#include +#include +#include static struct timeval timeout = { 5, 0 }; static struct timeval tottimeout = { 60, 0 }; +#define clnt_perror gssrpc_clnt_perror void clnt_perror(); +#define get_myaddress gssrpc_get_myaddress /* * Set a mapping between program,version and port. diff --git a/src/lib/rpc/pmap_clnt.h b/src/lib/rpc/pmap_clnt.h index dfb00dcc5..4b3ba02a2 100644 --- a/src/lib/rpc/pmap_clnt.h +++ b/src/lib/rpc/pmap_clnt.h @@ -57,6 +57,13 @@ * address if the responder to the broadcast. */ +#define pmap_set gssrpc_pmap_set +#define pmap_unset gssrpc_pmap_unset +#define pmap_getmaps gssrpc_pmap_getmaps +#define pmap_rmtcall gssrpc_pmap_rmtcall +#define clnt_broadcast gssrpc_clnt_broadcast +#define pmap_getport gssrpc_pmap_getport + extern bool_t pmap_set(); extern bool_t pmap_unset(); extern struct pmaplist *pmap_getmaps(); diff --git a/src/lib/rpc/pmap_getmaps.c b/src/lib/rpc/pmap_getmaps.c index 472b2a46d..9252aa137 100644 --- a/src/lib/rpc/pmap_getmaps.c +++ b/src/lib/rpc/pmap_getmaps.c @@ -39,9 +39,9 @@ static char sccsid[] = "@(#)pmap_getmaps.c 1.10 87/08/11 Copyr 1984 Sun Micro"; * Copyright (C) 1984, Sun Microsystems, Inc. */ -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/src/lib/rpc/pmap_getport.c b/src/lib/rpc/pmap_getport.c index 40b764880..2075280f2 100644 --- a/src/lib/rpc/pmap_getport.c +++ b/src/lib/rpc/pmap_getport.c @@ -38,9 +38,9 @@ static char sccsid[] = "@(#)pmap_getport.c 1.9 87/08/11 Copyr 1984 Sun Micro"; * Copyright (C) 1984, Sun Microsystems, Inc. */ -#include -#include -#include +#include +#include +#include #include #ifdef OSF1 #include diff --git a/src/lib/rpc/pmap_prot.c b/src/lib/rpc/pmap_prot.c index 1dffffe17..c1f25ce89 100644 --- a/src/lib/rpc/pmap_prot.c +++ b/src/lib/rpc/pmap_prot.c @@ -38,9 +38,9 @@ static char sccsid[] = "@(#)pmap_prot.c 1.17 87/08/11 Copyr 1984 Sun Micro"; * Copyright (C) 1984, Sun Microsystems, Inc. */ -#include -#include -#include +#include +#include +#include bool_t diff --git a/src/lib/rpc/pmap_prot.h b/src/lib/rpc/pmap_prot.h index 4f76580f4..935fa45a1 100644 --- a/src/lib/rpc/pmap_prot.h +++ b/src/lib/rpc/pmap_prot.h @@ -84,6 +84,7 @@ struct pmap { rpc_u_int32 pm_port; }; +#define xdr_pmap gssrpc_xdr_pmap extern bool_t xdr_pmap(); struct pmaplist { @@ -91,4 +92,5 @@ struct pmaplist { struct pmaplist *pml_next; }; +#define xdr_pmaplist gssrpc_xdr_pmaplist extern bool_t xdr_pmaplist(); diff --git a/src/lib/rpc/pmap_prot2.c b/src/lib/rpc/pmap_prot2.c index 5f48f2a28..1c64a4f2c 100644 --- a/src/lib/rpc/pmap_prot2.c +++ b/src/lib/rpc/pmap_prot2.c @@ -38,9 +38,9 @@ static char sccsid[] = "@(#)pmap_prot2.c 1.3 87/08/11 Copyr 1984 Sun Micro"; * Copyright (C) 1984, Sun Microsystems, Inc. */ -#include -#include -#include +#include +#include +#include /* diff --git a/src/lib/rpc/pmap_rmt.c b/src/lib/rpc/pmap_rmt.c index b740f5083..7cafe6e01 100644 --- a/src/lib/rpc/pmap_rmt.c +++ b/src/lib/rpc/pmap_rmt.c @@ -39,10 +39,10 @@ static char sccsid[] = "@(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro"; * Copyright (C) 1984, Sun Microsystems, Inc. */ -#include -#include -#include -#include +#include +#include +#include +#include #include #ifdef sun #include @@ -335,7 +335,7 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) msg.acpted_rply.ar_results.where = (caddr_t)&r; msg.acpted_rply.ar_results.proc = xdr_rmtcallres; readfds = mask; - switch (select(_rpc_dtablesize(), &readfds, (fd_set *)NULL, + switch (select(_gssrpc_rpc_dtablesize(), &readfds, (fd_set *)NULL, (fd_set *)NULL, &t)) { case 0: /* timed out */ diff --git a/src/lib/rpc/pmap_rmt.h b/src/lib/rpc/pmap_rmt.h index 2ea22120e..f43f618cd 100644 --- a/src/lib/rpc/pmap_rmt.h +++ b/src/lib/rpc/pmap_rmt.h @@ -41,6 +41,7 @@ struct rmtcallargs { xdrproc_t xdr_args; }; +#define xdr_rmtcall_args gssrpc_xdr_rmtcall_args bool_t xdr_rmtcall_args(); struct rmtcallres { @@ -50,4 +51,5 @@ struct rmtcallres { xdrproc_t xdr_results; }; +#define xdr_rmtcallres gssrpc_xdr_rmtcallres bool_t xdr_rmtcallres(); diff --git a/src/lib/rpc/rpc.h b/src/lib/rpc/rpc.h index d8ae24ae9..203e5ef09 100644 --- a/src/lib/rpc/rpc.h +++ b/src/lib/rpc/rpc.h @@ -37,31 +37,36 @@ #ifndef __RPC_HEADER__ #define __RPC_HEADER__ -#include /* some typedefs */ +#include /* some typedefs */ #include /* external data representation interfaces */ -#include /* generic (de)serializer */ +#include /* generic (de)serializer */ /* Client side only authentication */ -#include /* generic authenticator (client side) */ +#include /* generic authenticator (client side) */ /* Client side (mostly) remote procedure call */ -#include /* generic rpc stuff */ +#include /* generic rpc stuff */ /* semi-private protocol headers */ -#include /* protocol for rpc messages */ -#include /* protocol for unix style cred */ +#include /* protocol for rpc messages */ +#include /* protocol for unix style cred */ /* * 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 protocol for des style cred */ +/*#include protocol for des style cred */ /* Server side only remote procedure callee */ -#include /* service side authenticator */ -#include /* service manager and multiplexer */ +#include /* service side authenticator */ +#include /* service manager and multiplexer */ +/* + * Punt the rpc/netdb.h everywhere because it just makes things much more + * difficult. We don't use the *rpcent functions anyway. + */ +#if 0 /* * COMMENT OUT THE NEXT INCLUDE IF RUNNING ON SUN OS OR ON A VERSION * OF UNIX BASED ON NFSSRC. These systems will already have the structures @@ -72,6 +77,7 @@ #include #endif -#include /* structures and routines to parse /etc/rpc */ +#include /* structures and routines to parse /etc/rpc */ +#endif #endif /* ndef __RPC_HEADER__ */ diff --git a/src/lib/rpc/rpc_callmsg.c b/src/lib/rpc/rpc_callmsg.c index 370e79ff9..83ce05712 100644 --- a/src/lib/rpc/rpc_callmsg.c +++ b/src/lib/rpc/rpc_callmsg.c @@ -40,7 +40,7 @@ static char sccsid[] = "@(#)rpc_callmsg.c 1.4 87/08/11 Copyr 1984 Sun Micro"; #include -#include +#include /* * XDR a call message @@ -188,8 +188,8 @@ xdr_callmsg(xdrs, cmsg) xdr_u_int32(xdrs, &(cmsg->rm_call.cb_prog)) && xdr_u_int32(xdrs, &(cmsg->rm_call.cb_vers)) && xdr_u_int32(xdrs, &(cmsg->rm_call.cb_proc)) && - xdr_opaque_auth(xdrs, &(cmsg->rm_call.cb_cred)) ) - return (xdr_opaque_auth(xdrs, &(cmsg->rm_call.cb_verf))); + gssrpc_xdr_opaque_auth(xdrs, &(cmsg->rm_call.cb_cred)) ) + return (gssrpc_xdr_opaque_auth(xdrs, &(cmsg->rm_call.cb_verf))); return (FALSE); } diff --git a/src/lib/rpc/rpc_commondata.c b/src/lib/rpc/rpc_commondata.c index 75cead087..c44333b5b 100644 --- a/src/lib/rpc/rpc_commondata.c +++ b/src/lib/rpc/rpc_commondata.c @@ -27,7 +27,7 @@ * 2550 Garcia Avenue * Mountain View, California 94043 */ -#include +#include /* * This file should only contain common data (global data) that is exported * by public interfaces diff --git a/src/lib/rpc/rpc_dtablesize.c b/src/lib/rpc/rpc_dtablesize.c index d252d6acd..d7b07c867 100644 --- a/src/lib/rpc/rpc_dtablesize.c +++ b/src/lib/rpc/rpc_dtablesize.c @@ -37,7 +37,7 @@ static char sccsid[] = "@(#)rpc_dtablesize.c 1.2 87/08/11 Copyr 1987 Sun Micro"; * Cache the result of getdtablesize(), so we don't have to do an * expensive system call every time. */ -_rpc_dtablesize() +_gssrpc_rpc_dtablesize() { static int size; diff --git a/src/lib/rpc/rpc_msg.h b/src/lib/rpc/rpc_msg.h index 66b10c5fb..08ca63a31 100644 --- a/src/lib/rpc/rpc_msg.h +++ b/src/lib/rpc/rpc_msg.h @@ -160,6 +160,7 @@ struct rpc_msg { * XDR *xdrs; * struct rpc_msg *cmsg; */ +#define xdr_callmsg gssrpc_xdr_callmsg extern bool_t xdr_callmsg(); /* @@ -168,6 +169,7 @@ extern bool_t xdr_callmsg(); * XDR *xdrs; * struct rpc_msg *cmsg; */ +#define xdr_callhdr gssrpc_xdr_callhdr extern bool_t xdr_callhdr(); /* @@ -176,6 +178,7 @@ extern bool_t xdr_callhdr(); * XDR *xdrs; * struct rpc_msg *rmsg; */ +#define xdr_replymsg gssrpc_xdr_replymsg extern bool_t xdr_replymsg(); /* @@ -184,4 +187,6 @@ extern bool_t xdr_replymsg(); * struct rpc_msg *msg; * struct rpc_err *error; */ +#define _seterr_reply _gssrpc_seterr_reply +#define sunrpc_seterr_reply _seterr_reply extern void _seterr_reply(); diff --git a/src/lib/rpc/rpc_prot.c b/src/lib/rpc/rpc_prot.c index 6fea605e6..853dca79d 100644 --- a/src/lib/rpc/rpc_prot.c +++ b/src/lib/rpc/rpc_prot.c @@ -46,7 +46,7 @@ static char sccsid[] = "@(#)rpc_prot.c 1.36 87/08/11 Copyr 1984 Sun Micro"; #include -#include +#include /* * * * * * * * * * * * * * XDR Authentication * * * * * * * * * * * */ @@ -55,7 +55,7 @@ static char sccsid[] = "@(#)rpc_prot.c 1.36 87/08/11 Copyr 1984 Sun Micro"; * (see auth.h) */ bool_t -xdr_opaque_auth(xdrs, ap) +gssrpc_xdr_opaque_auth(xdrs, ap) register XDR *xdrs; register struct opaque_auth *ap; { @@ -83,13 +83,13 @@ xdr_des_block(xdrs, blkp) * XDR the MSG_ACCEPTED part of a reply message union */ bool_t -xdr_accepted_reply(xdrs, ar) +gssrpc_xdr_accepted_reply(xdrs, ar) register XDR *xdrs; register struct accepted_reply *ar; { /* personalized union, rather than calling xdr_union */ - if (! xdr_opaque_auth(xdrs, &(ar->ar_verf))) + if (! gssrpc_xdr_opaque_auth(xdrs, &(ar->ar_verf))) return (FALSE); if (! xdr_enum(xdrs, (enum_t *)&(ar->ar_stat))) return (FALSE); @@ -110,7 +110,7 @@ xdr_accepted_reply(xdrs, ar) * XDR the MSG_DENIED part of a reply message union */ bool_t -xdr_rejected_reply(xdrs, rr) +gssrpc_xdr_rejected_reply(xdrs, rr) register XDR *xdrs; register struct rejected_reply *rr; { @@ -132,8 +132,8 @@ xdr_rejected_reply(xdrs, rr) } static struct xdr_discrim reply_dscrm[3] = { - { (int)MSG_ACCEPTED, xdr_accepted_reply }, - { (int)MSG_DENIED, xdr_rejected_reply }, + { (int)MSG_ACCEPTED, gssrpc_xdr_accepted_reply }, + { (int)MSG_DENIED, gssrpc_xdr_rejected_reply }, { __dontcare__, NULL_xdrproc_t } }; /* diff --git a/src/lib/rpc/svc.c b/src/lib/rpc/svc.c index cb4d877a7..b5bc708a0 100644 --- a/src/lib/rpc/svc.c +++ b/src/lib/rpc/svc.c @@ -42,8 +42,8 @@ static char sccsid[] = "@(#)svc.c 1.41 87/10/13 Copyr 1984 Sun Micro"; */ #include -#include -#include +#include +#include #include extern int errno; @@ -90,7 +90,7 @@ xprt_register(xprt) xports = (SVCXPRT **) mem_alloc(FD_SETSIZE * sizeof(SVCXPRT *)); } - if (sock < _rpc_dtablesize()) { + if (sock < _gssrpc_rpc_dtablesize()) { xports[sock] = xprt; FD_SET(sock, &svc_fdset); } @@ -113,7 +113,7 @@ xprt_unregister(xprt) register int sock = xprt->xp_sock; #ifdef FD_SETSIZE - if ((sock < _rpc_dtablesize()) && (xports[sock] == xprt)) { + if ((sock < _gssrpc_rpc_dtablesize()) && (xports[sock] == xprt)) { xports[sock] = (SVCXPRT *)0; FD_CLR(sock, &svc_fdset); } @@ -412,7 +412,7 @@ svc_getreqset(readfds) r.rq_clntcred = &(cred_area[2*MAX_AUTH_BYTES]); #ifdef FD_SETSIZE - setsize = _rpc_dtablesize(); + setsize = _gssrpc_rpc_dtablesize(); maskp = (rpc_u_int32 *)readfds->fds_bits; for (sock = 0; sock < setsize; sock += NFDBITS) { diff --git a/src/lib/rpc/svc.h b/src/lib/rpc/svc.h index 805957383..7472d2d7e 100644 --- a/src/lib/rpc/svc.h +++ b/src/lib/rpc/svc.h @@ -174,6 +174,7 @@ struct svc_req { * void (*dispatch)(); * int protocol; like TCP or UDP, zero means do not register */ +#define svc_register gssrpc_svc_register extern bool_t svc_register(); /* @@ -183,6 +184,7 @@ extern bool_t svc_register(); * rpc_u_int32 prog; * rpc_u_int32 vers; */ +#define svc_unregister gssrpc_svc_unregister extern void svc_unregister(); /* @@ -191,6 +193,7 @@ extern void svc_unregister(); * xprt_register(xprt) * SVCXPRT *xprt; */ +#define xprt_register gssrpc_xprt_register extern void xprt_register(); /* @@ -199,6 +202,7 @@ extern void xprt_register(); * xprt_unregister(xprt) * SVCXPRT *xprt; */ +#define xprt_unregister gssrpc_xprt_unregister extern void xprt_unregister(); @@ -231,6 +235,15 @@ extern void xprt_unregister(); * deadlock the caller and server processes! */ +#define svc_sendreply gssrpc_svc_sendreply +#define svcerr_decode gssrpc_svcerr_decode +#define svcerr_weakauth gssrpc_svcerr_weakauth +#define svcerr_noproc gssrpc_svcerr_noproc +#define svcerr_progvers gssrpc_svcerr_progvers +#define svcerr_auth gssrpc_svcerr_auth +#define svcerr_noprog gssrpc_svcerr_noprog +#define svcerr_systemerr gssrpc_svcerr_systemerr + extern bool_t svc_sendreply(); extern void svcerr_decode(); extern void svcerr_weakauth(); @@ -255,19 +268,26 @@ extern void svcerr_systemerr(); * Global keeper of rpc service descriptors in use * dynamic; must be inspected before each call to select */ +#define svc_fdset gssrpc_svc_fdset +#define svc_fds gssrpc_svc_fds #ifdef FD_SETSIZE -extern fd_set svc_fdset; -#define svc_fds svc_fdset.fds_bits[0] /* compatibility */ +extern fd_set gssrpc_svc_fdset; +#define gssrpc_svc_fds gsssrpc_svc_fdset.fds_bits[0] /* compatibility */ #else -extern int svc_fds; +extern int gssrpc_svc_fds; #endif /* def FD_SETSIZE */ /* * a small program implemented by the svc_rpc implementation itself; * also see clnt.h for protocol numbers. */ +#define rpctest_service gssrpc_rpctest_service extern void rpctest_service(); +#define svc_getreq gssrpc_svc_getreq +#define svc_getreqset gssrpc_svc_getreqset +#define svc_run gssrpc_svc_run + extern void svc_getreq(); extern void svc_getreqset(); /* takes fdset instead of int */ extern void svc_run(); /* never returns */ @@ -284,17 +304,21 @@ extern void svc_run(); /* never returns */ /* * Memory based rpc for testing and timing. */ +#define svcraw_create gssrpc_svcraw_create extern SVCXPRT *svcraw_create(); /* * Udp based rpc. */ +#define svcudp_create gssrpc_svcudp_create +#define svcudp_bufcreate gssrpc_svcudp_bufcreate extern SVCXPRT *svcudp_create(); extern SVCXPRT *svcudp_bufcreate(); /* * Tcp based rpc. */ +#define svctcp_create gssrpc_svctcp_create extern SVCXPRT *svctcp_create(); #endif /* !__SVC_HEADER__ */ diff --git a/src/lib/rpc/svc_auth.c b/src/lib/rpc/svc_auth.c index 281d7cba4..e0e3dc50e 100644 --- a/src/lib/rpc/svc_auth.c +++ b/src/lib/rpc/svc_auth.c @@ -37,7 +37,7 @@ static char sccsid[] = "@(#)svc_auth.c 2.1 88/08/07 4.0 RPCSRC; from 1.19 87/08/ * Copyright (C) 1984, Sun Microsystems, Inc. */ -#include +#include /* * Server side authenticators are called from authenticate by @@ -52,6 +52,10 @@ static char sccsid[] = "@(#)svc_auth.c 2.1 88/08/07 4.0 RPCSRC; from 1.19 87/08/ * */ +#define _svcauth_null _gssrpc_svcauth_null +#define _svcauth_unix _gssrpc_svcauth_unix +#define _svcauth_short _gssrpc_svcauth_short + enum auth_stat _svcauth_null(); /* no authentication */ enum auth_stat _svcauth_unix(); /* unix style (uid, gids) */ enum auth_stat _svcauth_short(); /* short hand unix style */ diff --git a/src/lib/rpc/svc_auth.h b/src/lib/rpc/svc_auth.h index 4d5963144..6a97e5b76 100644 --- a/src/lib/rpc/svc_auth.h +++ b/src/lib/rpc/svc_auth.h @@ -51,6 +51,7 @@ extern SVCAUTH svc_auth_any; /* * Server side authenticator */ +#define _authenticate _gssrpc_authenticate extern enum auth_stat _authenticate(); #define SVCAUTH_WRAP(auth, xdrs, xfunc, xwhere) \ diff --git a/src/lib/rpc/svc_auth_any.c b/src/lib/rpc/svc_auth_any.c index 2f0a66dc8..f538b1709 100644 --- a/src/lib/rpc/svc_auth_any.c +++ b/src/lib/rpc/svc_auth_any.c @@ -7,7 +7,7 @@ */ #include -#include +#include extern int authany_wrap(); diff --git a/src/lib/rpc/svc_auth_gssapi.c b/src/lib/rpc/svc_auth_gssapi.c index 1f18c8ff2..2a3233ee9 100644 --- a/src/lib/rpc/svc_auth_gssapi.c +++ b/src/lib/rpc/svc_auth_gssapi.c @@ -2,222 +2,9 @@ * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved. * * $Id$ - * $Source$ - * - * $Log$ - * Revision 1.44 1997/12/16 16:23:38 epeisach - * * svc_auth_gssapi.c (_svcauth_gssapi): When looping over services, - * free previous output_tokens. - * - * Revision 1.43 1997/10/21 18:33:55 epeisach - * Fix to not lose entries in the chain linked client list. - * - * A pointer was not being updated resulting in the situation where - * random clients would sudenly fail with a misc. rpc. error as the client - * handle could not be found. The scenario required three active clients - * to trigger the problem. - * - * Revision 1.42 1996/12/04 17:47:18 bjaspan - * * Various changes to allow channel bindings to work with both UDP - * and TCP cleanly [krb5-libs/180]: - * - * * auth_gssapi.c: remove the special-case exception to channel - * bindings failure added in the previous revision, since we now - * solve the problem by making channel bindings not fail - * - * * clnt_udp.c: use a connected socket so that the client can - * determine its own source address with getsockname - * - * * svc.h: add xp_laddr and xp_laddrlen fields to SVCXPRT structure - * - * * svc_tcp.c: set xp_laddr and xp_laddrlen when a connection is - * established - * - * * svc_udp.c (svcudp_recv): use recvmsg with MSG_PEEK followed by - * recvfrom in order to determine both source and dest address on - * unconnected UDP socket, set xp_laddr and xp_laddrlen - * - * Revision 1.41 1996/10/16 20:16:10 bjaspan - * * svc_auth_gssapi.c (_svcauth_gssapi): accept add call_arg version 4 - * - * Revision 1.40 1996/10/15 21:05:10 bjaspan - * * configure.in: add DO_SUBDIRS so make will descend into unit-test - * - * Revision 1.39 1996/08/14 00:01:48 tlyu - * * getrpcent.c: Add PROTOTYPE and conditionalize function - * prototypes. - * - * * xdr.h: Add PROTOTYPE and conditionalize function prototypes. - * - * * svc_auth_gssapi.c: Remove ANSI string concatenation, de-ANSI-fy - * function definitions. - * - * * auth_gssapi_misc.c (auth_gssapi_display_status_1): Remove ANSI - * string concatenation, de-ANSI-fy function definitions. - * - * * auth_gssapi.h: Add PROTOTYPE and conditionalize function - * prototypes. - * - * * auth_gssapi.c (auth_gssapi_create): remove ANSI-ish string - * concatenation, de-ANSI-fy function definitions. - * - * Revision 1.38 1996/07/30 23:25:37 tlyu - * * svc_auth_gssapi.c: #include before (to - * get sys/types.h. - * - * Revision 1.37 1996/07/22 20:41:00 marc - * this commit includes all the changes on the OV_9510_INTEGRATION and - * OV_MERGE branches. This includes, but is not limited to, the new openvision - * admin system, and major changes to gssapi to add functionality, and bring - * the implementation in line with rfc1964. before committing, the - * code was built and tested for netbsd and solaris. - * - * Revision 1.36.4.1 1996/07/18 04:19:34 marc - * merged in changes from OV_9510_BP to OV_9510_FINAL1 - * - * Revision 1.36.2.1 1996/06/20 23:39:22 marc - * File added to the repository on a branch - * - * Revision 1.36 1996/05/30 19:25:02 bjaspan - * zero bindings structure before using it - * - * Revision 1.35 1996/05/12 06:17:25 marc - * changed around the file includes, since krb5 has changed some. - * - * added conditionalization GSS_BACKWARD_HACK until and if this hack is - * reimplemented in the newly merged gssapi. - * - * conditionalize out the host-specific cruft for setting the local - * address to INADDR_ANY, since you can just assign it that way on all - * platforms I know of. - * - * Revision 1.34 1996/02/12 15:14:00 grier - * [secure/3570] - * restore (struct sockaddr *) cast that got mangled - * - * Revision 1.33 1996/02/07 13:09:52 jik - * Actually, I should have used krb5_error_code, not krb5_int32. - * - * Revision 1.32 1996/02/07 13:08:31 jik - * Include to get the krb5_int32 typedef, which we then use - * in a cast when checking if the GSS-API minor status value is equal to - * a krb5 error code. - * - * Revision 1.31 1996/02/01 18:29:29 grier - * Restore use of error code definition. - * Return original code structure. - * - * Revision 1.30 1996/01/31 19:15:49 grier - * [secure/3570] - * Remove (void *) casts to memcpy() args - * - * Revision 1.29 1996/01/25 03:58:04 grier - * Remove debug code - * - * Revision 1.28 1996/01/25 03:56:50 grier - * secure/3570 - missed Alpha checkin - * - * Revision 1.26 1995/11/07 23:17:23 grier - * memcpy() cast - * - * Revision 1.25 1995/08/24 21:05:48 bjaspan - * set acceptor channel bindings - * - * Revision 1.24 1995/08/23 20:28:02 bjaspan - * [secure-rpc/3392] add channel bindinds to the rpc - * - * Revision 1.23 1995/07/10 18:49:22 bjaspan - * [secure-build/3377] remove use of BSD db - * - * Revision 1.22 1995/05/25 18:35:53 bjaspan - * [secure-rpc/3103] log misc errors from RPC - * - * Revision 1.21 1995/05/24 17:34:03 bjaspan - * [secure-rpc/3302] don't allow client to make server exit unless - * debugging is enabled - * - * Revision 1.20 1995/05/08 22:32:44 marc - * if a new client is in use, set the krb5 gssapi mech into - * backward-compatibility mode. - * - * Revision 1.19 1994/10/27 12:38:51 jik - * [secure-rpc/2808: add credential versioning] - * - * Sandbox: - * - * [secure-rpc/2808] add version field to client creds - * - * Revision 1.22 1994/10/26 20:03:27 bjaspan - * [secure-rpc/2808] add version field to client creds - * - * Revision 1.21 1994/05/23 01:26:01 bjaspan - * [secure-rpc/1911] set rq_svccred to the context instead of the service - * gss name - * - * Revision 1.20 1994/05/09 17:48:39 shanzer - * change sys/fcntl.h to fcntl.h - * - * Revision 1.19 1994/04/08 17:21:32 bjaspan - * remove KRB5KTNAME hack - * - * Revision 1.18 1994/03/18 15:48:13 shanzer - * include sys/fcntl.h - * - * Revision 1.17 1994/03/08 00:05:56 shanzer - * call rand() instead random() - * - * Revision 1.16 1993/12/08 21:43:54 bjaspan - * gss_delete_sec_context failure is not fatal (in fact, the context - * will often be expired); use AUTH_GSSAPI_DISPLAY_STATUS macro - * - * Revision 1.15 1993/12/08 20:20:08 bjaspan - * add debugging info to expire_client, correct comment above btree->put - * - * Revision 1.14 1993/12/08 06:52:49 bjaspan - * *many* debugging improvements to help find secure-rpc/586, and (I hope) - * the fix: don't change client_data->expiration without deleting it - * and reinserting it into the btree - * - * Revision 1.13 1993/12/06 21:22:26 bjaspan - * debugging levels, #ifdef PURIFY, call abort() on impossible failures - * - * Revision 1.12 1993/11/12 02:33:14 bjaspan - * add badauth - * / - * - * Revision 1.11 1993/11/03 23:46:15 bjaspan - * new log_badverf format - * - * Revision 1.10 1993/11/03 21:23:30 bjaspan - * handle GSS_C_INDEFINITE expiration, add log_badverf, set rq_svccred - * - * Revision 1.9 1993/11/03 01:30:36 bjaspan - * don't include gssapi_krb5.h, it isn't needed - * - * Revision 1.8 1993/11/02 22:09:02 bjaspan - * support multiple service-side names via _svcauth_gssapi_set_names - * - * Revision 1.7 1993/11/01 19:56:22 bjaspan - * unstatic svc_debug_gssapi, and send gss_{major,minor} back if - * accept_sec_context fails - * - * Revision 1.6 1993/10/28 22:09:58 bjaspan - * fix verifier mem leak, clean_clients() first to avoid dangling ref, - * only include hacked kt_default_name if DEBUG_GSSAPI defined - * - * Revision 1.5 1993/10/27 18:26:51 bjaspan - * use xdr_free instead of gss_release_buffer; this fixes memory leaks - * that were probably caused by zero-length seal/unseal tokens - * - * Revision 1.4 1993/10/26 21:12:51 bjaspan - * fully working * */ -#if !defined(lint) && !defined(__CODECENTER__) -static char *rcsid = "$Header$"; -#endif - /* * svc_auth_gssapi.c * Handles the GSS-API flavor authentication parameters on the service @@ -226,11 +13,11 @@ static char *rcsid = "$Header$"; #include #include -#include +#include #include #include -#include +#include #ifdef GSS_BACKWARD_HACK #include @@ -396,7 +183,7 @@ enum auth_stat _svcauth_gssapi(rqst, msg, no_dispatch) if (creds.auth_msg && rqst->rq_proc == AUTH_GSSAPI_EXIT) { PRINTF(("svcauth_gssapi: GSSAPI_EXIT, cleaning up\n")); svc_sendreply(rqst->rq_xprt, xdr_void, NULL); - xdr_free(xdr_authgssapi_creds, &creds); + gssrpc_xdr_free(xdr_authgssapi_creds, &creds); cleanup(); exit(0); } @@ -618,7 +405,7 @@ enum auth_stat _svcauth_gssapi(rqst, msg, no_dispatch) minor_stat = call_res.gss_minor; /* done with call args */ - xdr_free(xdr_authgssapi_init_arg, &call_arg); + gssrpc_xdr_free(xdr_authgssapi_init_arg, &call_arg); PRINTF(("svcauth_gssapi: accept_sec_context returned %#x\n", call_res.gss_major)); @@ -773,7 +560,7 @@ enum auth_stat _svcauth_gssapi(rqst, msg, no_dispatch) &call_arg.token); /* done with call args */ - xdr_free(xdr_authgssapi_init_arg, &call_arg); + gssrpc_xdr_free(xdr_authgssapi_init_arg, &call_arg); if (gssstat != GSS_S_COMPLETE) { AUTH_GSSAPI_DISPLAY_STATUS(("processing token", @@ -815,7 +602,7 @@ enum auth_stat _svcauth_gssapi(rqst, msg, no_dispatch) if (creds.client_handle.length != 0) { PRINTF(("svcauth_gssapi: freeing client_handle len %d\n", creds.client_handle.length)); - xdr_free(xdr_authgssapi_creds, &creds); + gssrpc_xdr_free(xdr_authgssapi_creds, &creds); } PRINTF(("\n")); @@ -825,7 +612,7 @@ error: if (creds.client_handle.length != 0) { PRINTF(("svcauth_gssapi: freeing client_handle len %d\n", creds.client_handle.length)); - xdr_free(xdr_authgssapi_creds, &creds); + gssrpc_xdr_free(xdr_authgssapi_creds, &creds); } PRINTF(("\n")); diff --git a/src/lib/rpc/svc_auth_unix.c b/src/lib/rpc/svc_auth_unix.c index 1ff21588c..781b350fd 100644 --- a/src/lib/rpc/svc_auth_unix.c +++ b/src/lib/rpc/svc_auth_unix.c @@ -43,13 +43,13 @@ static char sccsid[] = "@(#)svc_auth_unix.c 1.28 88/02/08 Copyr 1984 Sun Micro"; */ #include -#include +#include /* * Unix longhand authenticator */ enum auth_stat -_svcauth_unix(rqst, msg) +_gssrpc_svcauth_unix(rqst, msg) register struct svc_req *rqst; register struct rpc_msg *msg; { @@ -128,7 +128,7 @@ done: */ /*ARGSUSED*/ enum auth_stat -_svcauth_short(rqst, msg) +_gssrpc_svcauth_short(rqst, msg) struct svc_req *rqst; struct rpc_msg *msg; { diff --git a/src/lib/rpc/svc_raw.c b/src/lib/rpc/svc_raw.c index 1170ecec8..e5d966783 100644 --- a/src/lib/rpc/svc_raw.c +++ b/src/lib/rpc/svc_raw.c @@ -40,7 +40,7 @@ static char sccsid[] = "@(#)svc_raw.c 1.15 87/08/11 Copyr 1984 Sun Micro"; * Copyright (C) 1984, Sun Microsystems, Inc. */ -#include +#include /* diff --git a/src/lib/rpc/svc_run.c b/src/lib/rpc/svc_run.c index d43aa2425..ca48364a1 100644 --- a/src/lib/rpc/svc_run.c +++ b/src/lib/rpc/svc_run.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)svc_run.c 1.1 87/10/13 Copyr 1984 Sun Micro"; * This is the rpc server side idle loop * Wait for input, call server program. */ -#include +#include #include void @@ -55,7 +55,7 @@ svc_run() #else readfds = svc_fds; #endif /* def FD_SETSIZE */ - switch (select(_rpc_dtablesize(), &readfds, (fd_set *)0, + switch (select(_gssrpc_rpc_dtablesize(), &readfds, (fd_set *)0, (fd_set *)0, (struct timeval *)0)) { case -1: if (errno == EINTR) { diff --git a/src/lib/rpc/svc_simple.c b/src/lib/rpc/svc_simple.c index 2a22e5722..780eafff5 100644 --- a/src/lib/rpc/svc_simple.c +++ b/src/lib/rpc/svc_simple.c @@ -39,7 +39,7 @@ static char sccsid[] = "@(#)svc_simple.c 1.18 87/08/11 Copyr 1984 Sun Micro"; */ #include -#include +#include #include #include @@ -52,9 +52,9 @@ static struct proglst { } *proglst; static void universal(); static SVCXPRT *transp; -struct proglst *pl; +static struct proglst *pl; -registerrpc(prognum, versnum, procnum, progname, inproc, outproc) +gssrpc_registerrpc(prognum, versnum, procnum, progname, inproc, outproc) char *(*progname)(); xdrproc_t inproc, outproc; { diff --git a/src/lib/rpc/svc_tcp.c b/src/lib/rpc/svc_tcp.c index fe9b87fa6..60872c54b 100644 --- a/src/lib/rpc/svc_tcp.c +++ b/src/lib/rpc/svc_tcp.c @@ -42,7 +42,7 @@ static char sccsid[] = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro"; */ #include -#include +#include #include #include #include @@ -140,7 +140,7 @@ svctcp_create(sock, sendsize, recvsize) } memset((char *)&addr, 0, sizeof (addr)); addr.sin_family = AF_INET; - if (bindresvport(sock, &addr)) { + if (gssrpc_bindresvport(sock, &addr)) { addr.sin_port = 0; (void)bind(sock, (struct sockaddr *)&addr, len); } @@ -184,7 +184,7 @@ svctcp_create(sock, sendsize, recvsize) * descriptor as its first input. */ SVCXPRT * -svcfd_create(fd, sendsize, recvsize) +gssrpc_svcfd_create(fd, sendsize, recvsize) int fd; unsigned int sendsize; unsigned int recvsize; @@ -318,7 +318,7 @@ readtcp(xprt, buf, len) #endif /* def FD_SETSIZE */ do { readfds = mask; - if (select(_rpc_dtablesize(), &readfds, (fd_set*)NULL, + if (select(_gssrpc_rpc_dtablesize(), &readfds, (fd_set*)NULL, (fd_set*)NULL, &wait_per_try) <= 0) { if (errno == EINTR) { continue; diff --git a/src/lib/rpc/svc_udp.c b/src/lib/rpc/svc_udp.c index 6c507d8a9..454f99fc5 100644 --- a/src/lib/rpc/svc_udp.c +++ b/src/lib/rpc/svc_udp.c @@ -40,7 +40,7 @@ static char sccsid[] = "@(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro"; */ #include -#include +#include #include #include #ifdef HAVE_SYS_UIO_H @@ -119,7 +119,7 @@ svcudp_bufcreate(sock, sendsz, recvsz) } memset((char *)&addr, 0, sizeof (addr)); addr.sin_family = AF_INET; - if (bindresvport(sock, &addr)) { + if (gssrpc_bindresvport(sock, &addr)) { addr.sin_port = 0; (void)bind(sock, (struct sockaddr *)&addr, len); } @@ -374,7 +374,7 @@ struct udp_cache { * Enable use of the cache. * Note: there is no disable. */ -svcudp_enablecache(transp, size) +gssrpc_svcudp_enablecache(transp, size) SVCXPRT *transp; rpc_u_int32 size; { diff --git a/src/lib/rpc/xdr.c b/src/lib/rpc/xdr.c index 6a2fe44c6..df277fe3a 100644 --- a/src/lib/rpc/xdr.c +++ b/src/lib/rpc/xdr.c @@ -44,8 +44,8 @@ static char sccsid[] = "@(#)xdr.c 1.35 87/08/12"; #include #include -#include -#include +#include +#include /* * constants specific to the xdr "protocol" @@ -64,7 +64,7 @@ static char xdr_zero[BYTES_PER_XDR_UNIT] = { 0, 0, 0, 0 }; * Not a filter, but a convenient utility nonetheless */ void -xdr_free(proc, objp) +gssrpc_xdr_free(proc, objp) xdrproc_t proc; char *objp; { diff --git a/src/lib/rpc/xdr.h b/src/lib/rpc/xdr.h index fbc5fc2f1..7c2ae2f68 100644 --- a/src/lib/rpc/xdr.h +++ b/src/lib/rpc/xdr.h @@ -232,6 +232,29 @@ struct xdr_discrim { /* * These are the "generic" xdr routines. */ +#define xdr_void gssrpc_xdr_void +#define xdr_int gssrpc_xdr_int +#define xdr_u_int gssrpc_xdr_u_int +#define xdr_long gssrpc_xdr_long +#define xdr_u_long gssrpc_xdr_u_long +#define xdr_short gssrpc_xdr_short +#define xdr_u_short gssrpc_xdr_u_short +#define xdr_bool gssrpc_xdr_bool +#define xdr_enum gssrpc_xdr_enum +#define xdr_array gssrpc_xdr_array +#define xdr_bytes gssrpc_xdr_bytes +#define xdr_opaque gssrpc_xdr_opaque +#define xdr_string gssrpc_xdr_string +#define xdr_union gssrpc_xdr_union +#define xdr_char gssrpc_xdr_char +#define xdr_u_char gssrpc_xdr_u_char +#define xdr_vector gssrpc_xdr_vector +#define xdr_float gssrpc_xdr_float +#define xdr_double gssrpc_xdr_double +#define xdr_reference gssrpc_xdr_reference +#define xdr_pointer gssrpc_xdr_pointer +#define xdr_wrapstring gssrpc_xdr_wrapstring + extern bool_t xdr_void(); extern bool_t xdr_int PROTOTYPE((XDR *, int *)); @@ -280,6 +303,10 @@ PROTOTYPE((XDR *, char **)); * Common opaque bytes objects used by many rpc protocols; * declared here due to commonality. */ +#define xdr_netobj gssrpc_xdr_netobj +#define xdr_int32 gssrpc_xdr_int32 +#define xdr_u_int32 gssrpc_xdr_u_int32 + #define MAX_NETOBJ_SZ 1024 struct netobj { unsigned int n_len; @@ -298,6 +325,16 @@ PROTOTYPE((XDR *, rpc_u_int32 *)); * These are the public routines for the various implementations of * xdr streams. */ +#define xdrmem_create gssrpc_xdrmem_create +#define xdrstdio_create gssrpc_xdrstdio_create +#define xdrrec_create gssrpc_xdrrec_create +#define xdralloc_create gssrpc_xdralloc_create +#define xdralloc_release gssrpc_xdralloc_release +#define xdrrec_endofrecord gssrpc_xdrrec_endofrecord +#define xdrrec_skiprecord gssrpc_xdrrec_skiprecord +#define xdrrec_eof gssrpc_xdrrec_eof +#define xdralloc_getdata gssrpc_xdralloc_getdata + extern void xdrmem_create(); /* XDR using memory buffers */ extern void xdrstdio_create(); /* XDR using stdio library */ extern void xdrrec_create(); /* XDR pseudo records for tcp */ diff --git a/src/lib/rpc/xdr_alloc.c b/src/lib/rpc/xdr_alloc.c index 37ae71e82..6023930f3 100644 --- a/src/lib/rpc/xdr_alloc.c +++ b/src/lib/rpc/xdr_alloc.c @@ -34,48 +34,10 @@ static char sccsid[] = "@(#)xdr_mem.c 1.19 87/08/11 Copyr 1984 Sun Micro"; /* * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved. * - * $Header$ - * - * $Log$ - * Revision 1.6 1996/07/22 20:41:21 marc - * this commit includes all the changes on the OV_9510_INTEGRATION and - * OV_MERGE branches. This includes, but is not limited to, the new openvision - * admin system, and major changes to gssapi to add functionality, and bring - * the implementation in line with rfc1964. before committing, the - * code was built and tested for netbsd and solaris. - * - * Revision 1.5.4.1 1996/07/18 04:19:49 marc - * merged in changes from OV_9510_BP to OV_9510_FINAL1 - * - * Revision 1.5.2.1 1996/06/20 23:40:30 marc - * File added to the repository on a branch - * - * Revision 1.5 1996/05/12 06:19:25 marc - * renamed lots of types: u_foo to unsigned foo, and foo32 to rpc_foo32. This is to make autoconfiscation less painful. - * - * Revision 1.4 1995/12/13 14:03:14 grier - * Longs to ints for Alpha - * - * Revision 1.3 1993/12/09 18:57:25 bjaspan - * [secure-releng/833] misc bugfixes to admin library - * - * Revision 1.3 1993/12/06 21:23:08 bjaspan - * add xdralloc_release - * - * Revision 1.2 1993/10/26 21:13:19 bjaspan - * add casts for correctness - * - * Revision 1.1 1993/10/19 03:11:39 bjaspan - * Initial revision - * */ -#if !defined(lint) && !defined(__CODECENTER__) -static char *rcsid = "$Header$"; -#endif - -#include -#include +#include +#include #include static bool_t xdralloc_putlong(); diff --git a/src/lib/rpc/xdr_array.c b/src/lib/rpc/xdr_array.c index 09bd50abd..7c4c70e36 100644 --- a/src/lib/rpc/xdr_array.c +++ b/src/lib/rpc/xdr_array.c @@ -42,8 +42,8 @@ static char sccsid[] = "@(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro"; #include -#include -#include +#include +#include #define LASTUNSIGNED ((unsigned int)0-1) diff --git a/src/lib/rpc/xdr_float.c b/src/lib/rpc/xdr_float.c index 0c153c472..894b9e820 100644 --- a/src/lib/rpc/xdr_float.c +++ b/src/lib/rpc/xdr_float.c @@ -43,8 +43,8 @@ static char sccsid[] = "@(#)xdr_float.c 1.12 87/08/11 Copyr 1984 Sun Micro"; #include -#include -#include +#include +#include /* * NB: Not portable. diff --git a/src/lib/rpc/xdr_mem.c b/src/lib/rpc/xdr_mem.c index 39c0df203..d32b39136 100644 --- a/src/lib/rpc/xdr_mem.c +++ b/src/lib/rpc/xdr_mem.c @@ -43,8 +43,8 @@ static char sccsid[] = "@(#)xdr_mem.c 1.19 87/08/11 Copyr 1984 Sun Micro"; */ -#include -#include +#include +#include #include #include diff --git a/src/lib/rpc/xdr_rec.c b/src/lib/rpc/xdr_rec.c index 99ce9235a..01605be06 100644 --- a/src/lib/rpc/xdr_rec.c +++ b/src/lib/rpc/xdr_rec.c @@ -49,8 +49,8 @@ static char sccsid[] = "@(#)xdr_rec.c 1.21 87/08/11 Copyr 1984 Sun Micro"; */ #include -#include -#include +#include +#include #include #include diff --git a/src/lib/rpc/xdr_reference.c b/src/lib/rpc/xdr_reference.c index ebf14b68e..7d891a816 100644 --- a/src/lib/rpc/xdr_reference.c +++ b/src/lib/rpc/xdr_reference.c @@ -41,8 +41,8 @@ static char sccsid[] = "@(#)xdr_reference.c 1.11 87/08/11 SMI"; */ #include -#include -#include +#include +#include #define LASTUNSIGNED ((unsigned int)0-1) diff --git a/src/lib/rpc/xdr_stdio.c b/src/lib/rpc/xdr_stdio.c index 316284764..84bdd9671 100644 --- a/src/lib/rpc/xdr_stdio.c +++ b/src/lib/rpc/xdr_stdio.c @@ -41,9 +41,9 @@ static char sccsid[] = "@(#)xdr_stdio.c 1.16 87/08/11 Copyr 1984 Sun Micro"; * from the stream. */ -#include +#include #include -#include +#include static bool_t xdrstdio_getlong(); static bool_t xdrstdio_putlong(); -- 2.26.2