summary refs log tree commit diff
path: root/sunrpc
diff options
context:
space:
mode:
Diffstat (limited to 'sunrpc')
-rw-r--r--sunrpc/auth_unix.c7
-rw-r--r--sunrpc/authuxprot.c25
-rw-r--r--sunrpc/clnt_tcp.c3
-rw-r--r--sunrpc/clnt_udp.c3
-rw-r--r--sunrpc/pmap_rmt.c5
-rw-r--r--sunrpc/svc_authux.c14
-rw-r--r--sunrpc/svc_tcp.c3
7 files changed, 35 insertions, 25 deletions
diff --git a/sunrpc/auth_unix.c b/sunrpc/auth_unix.c
index bb631b4d52..8890a926ba 100644
--- a/sunrpc/auth_unix.c
+++ b/sunrpc/auth_unix.c
@@ -215,14 +215,15 @@ authunix_marshal(auth, xdrs)
 static bool_t
 authunix_validate(auth, verf)
 	register AUTH *auth;
-	struct opaque_auth verf;
+	struct opaque_auth *verf;
 {
 	register struct audata *au;
 	XDR xdrs;
 
-	if (verf.oa_flavor == AUTH_SHORT) {
+	if (verf->oa_flavor == AUTH_SHORT) {
 		au = AUTH_PRIVATE(auth);
-		xdrmem_create(&xdrs, verf.oa_base, verf.oa_length, XDR_DECODE);
+		xdrmem_create(&xdrs, verf->oa_base, verf->oa_length,
+			      XDR_DECODE);
 
 		if (au->au_shcred.oa_base != NULL) {
 			mem_free(au->au_shcred.oa_base,
diff --git a/sunrpc/authuxprot.c b/sunrpc/authuxprot.c
index a60d99a57b..9b21ce195e 100644
--- a/sunrpc/authuxprot.c
+++ b/sunrpc/authuxprot.c
@@ -6,23 +6,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
@@ -55,12 +55,17 @@ xdr_authunix_parms(xdrs, p)
 
 	if (xdr_u_long(xdrs, &(p->aup_time))
 	    && xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME)
-	    && xdr_int(xdrs, &(p->aup_uid))
-	    && xdr_int(xdrs, &(p->aup_gid))
-	    && xdr_array(xdrs, (caddr_t *)&(p->aup_gids),
-		    &(p->aup_len), NGRPS, sizeof(int), xdr_int) ) {
+	    && (sizeof (uid_t) == sizeof (short int)
+		? xdr_u_short(xdrs, (u_short *) &(p->aup_uid))
+		: xdr_u_int(xdrs, (u_int *) &(p->aup_uid)))
+	    && (sizeof (gid_t) == sizeof (short int)
+		? xdr_u_short(xdrs, (u_short *) &(p->aup_gid))
+		: xdr_u_int(xdrs, (u_int *) &(p->aup_gid)))
+ 	    && xdr_array(xdrs, (caddr_t *)&(p->aup_gids),
+			 &(p->aup_len), NGRPS, sizeof(gid_t),
+			 (sizeof (gid_t) == sizeof (short int)
+			  ? xdr_u_short : xdr_u_int)) ) {
 		return (TRUE);
 	}
 	return (FALSE);
 }
-
diff --git a/sunrpc/clnt_tcp.c b/sunrpc/clnt_tcp.c
index bd40cdddf6..aeaf558ad2 100644
--- a/sunrpc/clnt_tcp.c
+++ b/sunrpc/clnt_tcp.c
@@ -417,9 +417,10 @@ readtcp(ct, buf, len)
 
 #endif /* def FD_SETSIZE */
 	while (TRUE) {
+		struct timeval timeout = ct->ct_wait;
 		readfds = mask;
 		switch (select(_rpc_dtablesize(), &readfds, (int*)NULL, (int*)NULL,
-			       &(ct->ct_wait))) {
+			       &timeout)) {
 		case 0:
 			ct->ct_error.re_status = RPC_TIMEDOUT;
 			return (-1);
diff --git a/sunrpc/clnt_udp.c b/sunrpc/clnt_udp.c
index 6b12306a55..e166dede81 100644
--- a/sunrpc/clnt_udp.c
+++ b/sunrpc/clnt_udp.c
@@ -287,9 +287,10 @@ send_again:
 	mask = 1 << cu->cu_sock;
 #endif /* def FD_SETSIZE */
 	for (;;) {
+		struct timeval timeout = cu->cu_wait;
 		readfds = mask;
 		switch (select(_rpc_dtablesize(), &readfds, (int *)NULL,
-			       (int *)NULL, &(cu->cu_wait))) {
+			       (int *)NULL, &timeout)) {
 
 		case 0:
 			time_waited.tv_sec += cu->cu_wait.tv_sec;
diff --git a/sunrpc/pmap_rmt.c b/sunrpc/pmap_rmt.c
index 40a35f1990..8907929973 100644
--- a/sunrpc/pmap_rmt.c
+++ b/sunrpc/pmap_rmt.c
@@ -244,7 +244,7 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
 	struct rmtcallargs a;
 	struct rmtcallres r;
 	struct rpc_msg msg;
-	struct timeval t;
+	struct timeval t, t1;
 	char outbuf[MAX_BROADCAST_SIZE], inbuf[UDPMSGSIZE];
 
 	/*
@@ -324,8 +324,9 @@ 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;
+		t1 = t;
 		switch (select(_rpc_dtablesize(), &readfds, (int *)NULL,
-			       (int *)NULL, &t)) {
+			       (int *)NULL, &t1)) {
 
 		case 0:  /* timed out */
 			stat = RPC_TIMEDOUT;
diff --git a/sunrpc/svc_authux.c b/sunrpc/svc_authux.c
index 1b766d49f6..59fdde6ad8 100644
--- a/sunrpc/svc_authux.c
+++ b/sunrpc/svc_authux.c
@@ -6,23 +6,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
@@ -60,7 +60,7 @@ _svcauth_unix(rqst, msg)
 	struct area {
 		struct authunix_parms area_aup;
 		char area_machname[MAX_MACHINE_NAME+1];
-		int area_gids[NGRPS];
+		gid_t area_gids[NGRPS];
 	} *area;
 	u_int auth_len;
 	int str_len, gid_len;
@@ -125,7 +125,7 @@ done:
  * Looks up longhand in a cache.
  */
 /*ARGSUSED*/
-enum auth_stat 
+enum auth_stat
 _svcauth_short(rqst, msg)
 	struct svc_req *rqst;
 	struct rpc_msg *msg;
diff --git a/sunrpc/svc_tcp.c b/sunrpc/svc_tcp.c
index 2555e32be5..278e16fc33 100644
--- a/sunrpc/svc_tcp.c
+++ b/sunrpc/svc_tcp.c
@@ -305,9 +305,10 @@ readtcp(xprt, buf, len)
 	int readfds;
 #endif /* def FD_SETSIZE */
 	do {
+		struct timeval timeout = wait_per_try;
 		readfds = mask;
 		if (select(_rpc_dtablesize(), &readfds, (int*)NULL, (int*)NULL,
-			   &wait_per_try) <= 0) {
+			   &timeout) <= 0) {
 			if (errno == EINTR) {
 				continue;
 			}