aboutsummaryrefslogtreecommitdiff
path: root/sunrpc
diff options
context:
space:
mode:
Diffstat (limited to 'sunrpc')
-rw-r--r--sunrpc/auth_des.c7
-rw-r--r--sunrpc/auth_unix.c3
-rw-r--r--sunrpc/clnt_perr.c3
-rw-r--r--sunrpc/key_call.c3
-rw-r--r--sunrpc/pmap_rmt.c1
-rw-r--r--sunrpc/svc_tcp.c3
-rw-r--r--sunrpc/svcauth_des.c16
-rw-r--r--sunrpc/xcrypt.c31
-rw-r--r--sunrpc/xdr_rec.c15
9 files changed, 58 insertions, 24 deletions
diff --git a/sunrpc/auth_des.c b/sunrpc/auth_des.c
index 9b03056..bd29abd 100644
--- a/sunrpc/auth_des.c
+++ b/sunrpc/auth_des.c
@@ -71,7 +71,8 @@ static bool_t authdes_marshal (AUTH *, XDR *);
static bool_t authdes_validate (AUTH *, struct opaque_auth *);
static bool_t authdes_refresh (AUTH *);
static void authdes_destroy (AUTH *);
-static bool_t synchronize (struct sockaddr *, struct timeval *);
+static bool_t synchronize (struct sockaddr *, struct timeval *)
+ internal_function;
static struct auth_ops authdes_ops =
{
@@ -140,6 +141,7 @@ authdes_pk_create (const char *servername, netobj * pkey, u_int window,
*/
auth = ALLOC (AUTH);
ad = ALLOC (struct ad_private);
+ memset (ad, 0, sizeof (struct ad_private));
memcpy (ad->ad_pkey, pkey->n_bytes, pkey->n_len);
if (!getnetname (namebuf))
goto failed;
@@ -200,11 +202,11 @@ failed:
FREE (auth, sizeof (AUTH));
if (ad != NULL)
{
- FREE (ad, sizeof (struct ad_private));
if (ad->ad_fullname != NULL)
FREE (ad->ad_fullname, ad->ad_fullnamelen + 1);
if (ad->ad_servername != NULL)
FREE (ad->ad_servername, ad->ad_servernamelen + 1);
+ FREE (ad, sizeof (struct ad_private));
}
return (NULL);
}
@@ -440,6 +442,7 @@ authdes_destroy (AUTH * auth)
* adjust timep to reflect the delta between our clocks
*/
static bool_t
+internal_function
synchronize (struct sockaddr *syncaddr, struct timeval *timep)
{
struct timeval mytime;
diff --git a/sunrpc/auth_unix.c b/sunrpc/auth_unix.c
index ac9b53a..091735e 100644
--- a/sunrpc/auth_unix.c
+++ b/sunrpc/auth_unix.c
@@ -85,7 +85,7 @@ struct audata
};
#define AUTH_PRIVATE(auth) ((struct audata *)auth->ah_private)
-static bool_t marshal_new_auth (AUTH *);
+static bool_t marshal_new_auth (AUTH *) internal_function;
/*
@@ -307,6 +307,7 @@ authunix_destroy (AUTH *auth)
* sets private data, au_marshed and au_mpos
*/
static bool_t
+internal_function
marshal_new_auth (AUTH *auth)
{
XDR xdr_stream;
diff --git a/sunrpc/clnt_perr.c b/sunrpc/clnt_perr.c
index 73ec6a1..89f61f0 100644
--- a/sunrpc/clnt_perr.c
+++ b/sunrpc/clnt_perr.c
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)clnt_perror.c 1.15 87/10/07 Copyr 1984 Sun Micro";
#include <rpc/auth.h>
#include <rpc/clnt.h>
-static char *auth_errmsg (enum auth_stat stat);
+static char *auth_errmsg (enum auth_stat stat) internal_function;
static char *buf;
@@ -288,6 +288,7 @@ static const struct auth_errtab auth_errlist[] =
};
static char *
+internal_function
auth_errmsg (enum auth_stat stat)
{
size_t i;
diff --git a/sunrpc/key_call.c b/sunrpc/key_call.c
index dff7da6..a497bc7 100644
--- a/sunrpc/key_call.c
+++ b/sunrpc/key_call.c
@@ -57,7 +57,7 @@ extern int _openchild (char *command, FILE **fto, FILE **ffrom);
static int key_call (u_long, xdrproc_t xdr_arg, char *,
- xdrproc_t xdr_rslt, char *);
+ xdrproc_t xdr_rslt, char *) internal_function;
static struct timeval trytimeout = {KEY_TIMEOUT, 0};
static struct timeval tottimeout = {KEY_TIMEOUT *KEY_NRETRY, 0};
@@ -267,6 +267,7 @@ cryptkeyres *(*__key_decryptsession_pk_LOCAL) (uid_t, char *) = 0;
des_block *(*__key_gendes_LOCAL) (uid_t, char *) = 0;
static int
+internal_function
key_call (u_long proc, xdrproc_t xdr_arg, char *arg,
xdrproc_t xdr_rslt, char *rslt)
{
diff --git a/sunrpc/pmap_rmt.c b/sunrpc/pmap_rmt.c
index 6117c36..9115491 100644
--- a/sunrpc/pmap_rmt.c
+++ b/sunrpc/pmap_rmt.c
@@ -167,6 +167,7 @@ xdr_rmtcallres (xdrs, crp)
*/
static int
+internal_function
getbroadcastnets (struct in_addr *addrs, int sock, char *buf)
/* int sock: any valid socket will do */
/* char *buf: why allocate more when we can use existing... */
diff --git a/sunrpc/svc_tcp.c b/sunrpc/svc_tcp.c
index ec7de3b..e14a9ad 100644
--- a/sunrpc/svc_tcp.c
+++ b/sunrpc/svc_tcp.c
@@ -87,7 +87,7 @@ static const struct xp_ops svctcp_rendezvous_op =
static int readtcp (char*, char *, int);
static int writetcp (char *, char *, int);
-static SVCXPRT *makefd_xprt (int, u_int, u_int);
+static SVCXPRT *makefd_xprt (int, u_int, u_int) internal_function;
struct tcp_rendezvous
{ /* kept in xprt->xp_p1 */
@@ -191,6 +191,7 @@ svcfd_create (int fd, u_int sendsize, u_int recvsize)
}
static SVCXPRT *
+internal_function
makefd_xprt (int fd, u_int sendsize, u_int recvsize)
{
SVCXPRT *xprt;
diff --git a/sunrpc/svcauth_des.c b/sunrpc/svcauth_des.c
index 3547830..c2dde69 100644
--- a/sunrpc/svcauth_des.c
+++ b/sunrpc/svcauth_des.c
@@ -80,12 +80,14 @@ struct cache_entry
static struct cache_entry *authdes_cache /* [AUTHDES_CACHESZ] */ ;
static short *authdes_lru /* [AUTHDES_CACHESZ] */ ;
-static void cache_init (void); /* initialize the cache */
-static short cache_spot (des_block *, char *, struct timeval *);
- /* find an entry in the cache */
-static void cache_ref (short sid); /* note that sid was ref'd */
+static void cache_init (void) internal_function; /* initialize the cache */
+static short cache_spot (des_block *, char *, struct timeval *)
+ internal_function; /* find an entry in the cache */
+static void cache_ref (short sid) internal_function;
+ /* note that sid was ref'd */
-static void invalidate (char *cred); /* invalidate entry in cache */
+static void invalidate (char *cred) internal_function;
+ /* invalidate entry in cache */
/*
* cache statistics
@@ -364,6 +366,7 @@ _svcauth_des (register struct svc_req *rqst, register struct rpc_msg *msg)
* Initialize the cache
*/
static void
+internal_function
cache_init (void)
{
register int i;
@@ -397,6 +400,7 @@ cache_victim (void)
* Note that sid was referenced
*/
static void
+internal_function
cache_ref (register short sid)
{
register int i;
@@ -420,6 +424,7 @@ cache_ref (register short sid)
* return the spot in the cache.
*/
static short
+internal_function
cache_spot (register des_block * key, char *name, struct timeval *timestamp)
{
register struct cache_entry *cp;
@@ -538,6 +543,7 @@ authdes_getucred (const struct authdes_cred *adc, uid_t * uid, gid_t * gid,
}
static void
+internal_function
invalidate (char *cred)
{
if (cred == NULL)
diff --git a/sunrpc/xcrypt.c b/sunrpc/xcrypt.c
index 97c30d1..df191f5 100644
--- a/sunrpc/xcrypt.c
+++ b/sunrpc/xcrypt.c
@@ -5,23 +5,23 @@
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
@@ -41,6 +41,7 @@ static char sccsid[] = "@(#)xcrypt.c 1.3 89/03/24 Copyr 1986 Sun Micro";
* xcrypt.c: Hex encryption/decryption and utility routines
*/
+#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -53,9 +54,19 @@ static char hex[16] =
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f',
};
-static char hexval (char);
-static void hex2bin (int, char *, char *);
-static void bin2hex (int, unsigned char *, char *);
+
+#ifdef _LIBC
+# define hexval(c) \
+ (c >= '0' && c <= '9' \
+ ? c - '0' \
+ : ({ int upp = toupper (c); \
+ upp >= 'a' && upp <= 'z' ? upp - 'a' + 10 : -1; }))
+#else
+static char hexval (char) internal_function;
+#endif
+
+static void hex2bin (int, char *, char *) internal_function;
+static void bin2hex (int, unsigned char *, char *) internal_function;
void passwd2des (char *pw, char *key);
/*
@@ -140,6 +151,7 @@ passwd2des (char *pw, char *key)
* Hex to binary conversion
*/
static void
+internal_function
hex2bin (int len, char *hexnum, char *binnum)
{
int i;
@@ -152,6 +164,7 @@ hex2bin (int len, char *hexnum, char *binnum)
* Binary to hex conversion
*/
static void
+internal_function
bin2hex (int len, unsigned char *binnum, char *hexnum)
{
int i;
@@ -166,6 +179,7 @@ bin2hex (int len, unsigned char *binnum, char *hexnum)
hexnum[len * 2] = 0;
}
+#ifndef _LIBC
static char
hexval (char c)
{
@@ -178,3 +192,4 @@ hexval (char c)
else
return -1;
}
+#endif
diff --git a/sunrpc/xdr_rec.c b/sunrpc/xdr_rec.c
index b8a4f51..db5684b 100644
--- a/sunrpc/xdr_rec.c
+++ b/sunrpc/xdr_rec.c
@@ -117,11 +117,11 @@ typedef struct rec_strm
}
RECSTREAM;
-static u_int fix_buf_size (u_int);
-static bool_t skip_input_bytes (RECSTREAM *, long);
-static bool_t flush_out (RECSTREAM *, bool_t);
-static bool_t set_input_fragment (RECSTREAM *);
-static bool_t get_input_bytes (RECSTREAM *, caddr_t, int);
+static u_int fix_buf_size (u_int) internal_function;
+static bool_t skip_input_bytes (RECSTREAM *, long) internal_function;
+static bool_t flush_out (RECSTREAM *, bool_t) internal_function;
+static bool_t set_input_fragment (RECSTREAM *) internal_function;
+static bool_t get_input_bytes (RECSTREAM *, caddr_t, int) internal_function;
/*
* Create an xdr handle for xdrrec
@@ -497,6 +497,7 @@ xdrrec_endofrecord (xdrs, sendnow)
* Internal useful routines
*/
static bool_t
+internal_function
flush_out (RECSTREAM *rstrm, bool_t eor)
{
u_long eormask = (eor == TRUE) ? LAST_FRAG : 0;
@@ -533,6 +534,7 @@ fill_input_buf (RECSTREAM *rstrm)
}
static bool_t /* knows nothing about records! Only about input buffers */
+internal_function
get_input_bytes (RECSTREAM *rstrm, caddr_t addr, int len)
{
int current;
@@ -556,6 +558,7 @@ get_input_bytes (RECSTREAM *rstrm, caddr_t addr, int len)
}
static bool_t /* next two bytes of the input stream are treated as a header */
+internal_function
set_input_fragment (RECSTREAM *rstrm)
{
u_long header;
@@ -569,6 +572,7 @@ set_input_fragment (RECSTREAM *rstrm)
}
static bool_t /* consumes input bytes; knows nothing about records! */
+internal_function
skip_input_bytes (RECSTREAM *rstrm, long cnt)
{
int current;
@@ -590,6 +594,7 @@ skip_input_bytes (RECSTREAM *rstrm, long cnt)
}
static u_int
+internal_function
fix_buf_size (u_int s)
{
if (s < 100)