summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/rpc')
-rw-r--r--lib/libc/rpc/auth_des.c2
-rw-r--r--lib/libc/rpc/auth_unix.c11
-rw-r--r--lib/libc/rpc/authunix_prot.c14
-rw-r--r--lib/libc/rpc/clnt_vc.c4
-rw-r--r--lib/libc/rpc/getnetpath.c3
-rw-r--r--lib/libc/rpc/rpc_generic.c6
-rw-r--r--lib/libc/rpc/rpc_soc.32
-rw-r--r--lib/libc/rpc/svc_auth_des.c2
-rw-r--r--lib/libc/rpc/svc_auth_unix.c2
9 files changed, 25 insertions, 21 deletions
diff --git a/lib/libc/rpc/auth_des.c b/lib/libc/rpc/auth_des.c
index 8f363e9..1b45c3b 100644
--- a/lib/libc/rpc/auth_des.c
+++ b/lib/libc/rpc/auth_des.c
@@ -286,7 +286,7 @@ authdes_marshal(AUTH *auth, XDR *xdrs)
* Figure out the "time", accounting for any time difference
* with the server if necessary.
*/
- (void) gettimeofday(&ad->ad_timestamp, (struct timezone *)NULL);
+ (void)gettimeofday(&ad->ad_timestamp, NULL);
ad->ad_timestamp.tv_sec += ad->ad_timediff.tv_sec;
ad->ad_timestamp.tv_usec += ad->ad_timediff.tv_usec;
while (ad->ad_timestamp.tv_usec >= USEC_PER_SEC) {
diff --git a/lib/libc/rpc/auth_unix.c b/lib/libc/rpc/auth_unix.c
index c0d2548..5c138d0 100644
--- a/lib/libc/rpc/auth_unix.c
+++ b/lib/libc/rpc/auth_unix.c
@@ -94,10 +94,10 @@ struct audata {
AUTH *
authunix_create(machname, uid, gid, len, aup_gids)
char *machname;
- int uid;
- int gid;
+ u_int uid;
+ u_int gid;
int len;
- int *aup_gids;
+ u_int *aup_gids;
{
struct authunix_parms aup;
char mymem[MAX_AUTH_BYTES];
@@ -207,9 +207,8 @@ authunix_create_default()
abort();
if (ngids > NGRPS)
ngids = NGRPS;
- /* XXX: interface problem; those should all have been unsigned */
- auth = authunix_create(machname, (int)uid, (int)gid, ngids,
- (int *)gids);
+ /* XXX: interface problem; we should translate from uid_t and gid_t */
+ auth = authunix_create(machname, uid, gid, ngids, gids);
free(gids);
return (auth);
}
diff --git a/lib/libc/rpc/authunix_prot.c b/lib/libc/rpc/authunix_prot.c
index 7699e28..f80b176 100644
--- a/lib/libc/rpc/authunix_prot.c
+++ b/lib/libc/rpc/authunix_prot.c
@@ -60,19 +60,19 @@ xdr_authunix_parms(xdrs, p)
XDR *xdrs;
struct authunix_parms *p;
{
- int **paup_gids;
+ u_int **paup_gids;
assert(xdrs != NULL);
assert(p != NULL);
paup_gids = &p->aup_gids;
- 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, (char **) paup_gids,
- &(p->aup_len), NGRPS, sizeof(int), (xdrproc_t)xdr_int) ) {
+ if (xdr_u_long(xdrs, &(p->aup_time)) &&
+ xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME) &&
+ xdr_u_int(xdrs, &(p->aup_uid)) &&
+ xdr_u_int(xdrs, &(p->aup_gid)) &&
+ xdr_array(xdrs, (char **) paup_gids,
+ &(p->aup_len), NGRPS, sizeof(u_int), (xdrproc_t)xdr_u_int) ) {
return (TRUE);
}
return (FALSE);
diff --git a/lib/libc/rpc/clnt_vc.c b/lib/libc/rpc/clnt_vc.c
index 07eff46..881f84d 100644
--- a/lib/libc/rpc/clnt_vc.c
+++ b/lib/libc/rpc/clnt_vc.c
@@ -672,6 +672,10 @@ clnt_vc_destroy(cl)
if (ct->ct_addr.buf)
free(ct->ct_addr.buf);
mem_free(ct, sizeof(struct ct_data));
+ if (cl->cl_netid && cl->cl_netid[0])
+ mem_free(cl->cl_netid, strlen(cl->cl_netid) +1);
+ if (cl->cl_tp && cl->cl_tp[0])
+ mem_free(cl->cl_tp, strlen(cl->cl_tp) +1);
mem_free(cl, sizeof(CLIENT));
mutex_unlock(&clnt_fd_lock);
thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
diff --git a/lib/libc/rpc/getnetpath.c b/lib/libc/rpc/getnetpath.c
index d1ea554..92eae95 100644
--- a/lib/libc/rpc/getnetpath.c
+++ b/lib/libc/rpc/getnetpath.c
@@ -99,9 +99,8 @@ setnetpath()
return (NULL);
}
if ((np_sessionp->nc_handlep = setnetconfig()) == NULL) {
- free(np_sessionp);
syslog (LOG_ERR, "rpc: failed to open " NETCONFIG);
- return (NULL);
+ goto failed;
}
np_sessionp->valid = NP_VALID;
np_sessionp->ncp_list = NULL;
diff --git a/lib/libc/rpc/rpc_generic.c b/lib/libc/rpc/rpc_generic.c
index ab259d5..0ac4597 100644
--- a/lib/libc/rpc/rpc_generic.c
+++ b/lib/libc/rpc/rpc_generic.c
@@ -269,7 +269,8 @@ __rpc_getconfip(nettype)
}
while ((nconf = getnetconfig(confighandle)) != NULL) {
if (strcmp(nconf->nc_protofmly, NC_INET) == 0) {
- if (strcmp(nconf->nc_proto, NC_TCP) == 0) {
+ if (strcmp(nconf->nc_proto, NC_TCP) == 0 &&
+ netid_tcp == NULL) {
netid_tcp = strdup(nconf->nc_netid);
if (main_thread)
netid_tcp_main = netid_tcp;
@@ -277,7 +278,8 @@ __rpc_getconfip(nettype)
thr_setspecific(tcp_key,
(void *) netid_tcp);
} else
- if (strcmp(nconf->nc_proto, NC_UDP) == 0) {
+ if (strcmp(nconf->nc_proto, NC_UDP) == 0 &&
+ netid_udp == NULL) {
netid_udp = strdup(nconf->nc_netid);
if (main_thread)
netid_udp_main = netid_udp;
diff --git a/lib/libc/rpc/rpc_soc.3 b/lib/libc/rpc/rpc_soc.3
index 8dedaa8..1af5728 100644
--- a/lib/libc/rpc/rpc_soc.3
+++ b/lib/libc/rpc/rpc_soc.3
@@ -148,7 +148,7 @@ default authentication used by
.Ft "AUTH *"
.Xc
.It Xo
-.Fn authunix_create "char *host" "int uid" "int gid" "int len" "int *aup_gids"
+.Fn authunix_create "char *host" "u_int uid" "u_int gid" "int len" "u_int *aup_gids"
.Xc
.Pp
Create and return an
diff --git a/lib/libc/rpc/svc_auth_des.c b/lib/libc/rpc/svc_auth_des.c
index de4d1b4..bd45f20 100644
--- a/lib/libc/rpc/svc_auth_des.c
+++ b/lib/libc/rpc/svc_auth_des.c
@@ -271,7 +271,7 @@ _svcauth_des(rqst, msg)
debug("timestamp before last seen");
return (AUTH_REJECTEDVERF); /* replay */
}
- (void) gettimeofday(&current, (struct timezone *)NULL);
+ (void)gettimeofday(&current, NULL);
current.tv_sec -= window; /* allow for expiration */
if (!BEFORE(&current, &timestamp)) {
debug("timestamp expired");
diff --git a/lib/libc/rpc/svc_auth_unix.c b/lib/libc/rpc/svc_auth_unix.c
index 4d6f102..20d4ecc 100644
--- a/lib/libc/rpc/svc_auth_unix.c
+++ b/lib/libc/rpc/svc_auth_unix.c
@@ -68,7 +68,7 @@ _svcauth_unix(rqst, msg)
struct area {
struct authunix_parms area_aup;
char area_machname[MAX_MACHINE_NAME+1];
- int area_gids[NGRPS];
+ u_int area_gids[NGRPS];
} *area;
u_int auth_len;
size_t str_len, gid_len;
OpenPOWER on IntegriCloud