diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2005-12-01 20:43:44 +0000 |
---|---|---|
committer | Peter S. Mazinger <ps.m@gmx.net> | 2005-12-01 20:43:44 +0000 |
commit | 8a0b43005ad9ea011b80d66e32b46fb430ddaffb (patch) | |
tree | 418818740042c5dbba244bc1efc760c8d29e47a9 /libc/inet/rpc | |
parent | 42b161bb716f35948fabd36472fb59cd0a20fa92 (diff) |
Hide mostly used functions
Diffstat (limited to 'libc/inet/rpc')
30 files changed, 174 insertions, 173 deletions
diff --git a/libc/inet/rpc/auth_unix.c b/libc/inet/rpc/auth_unix.c index 787e08b13..c02cc309b 100644 --- a/libc/inet/rpc/auth_unix.c +++ b/libc/inet/rpc/auth_unix.c @@ -152,7 +152,7 @@ no_memory: au->au_origcred.oa_base = mem_alloc ((u_int) len); if (au->au_origcred.oa_base == NULL) goto no_memory; - memcpy(au->au_origcred.oa_base, mymem, (u_int) len); + __memcpy(au->au_origcred.oa_base, mymem, (u_int) len); /* * set auth handle to reflect new cred. diff --git a/libc/inet/rpc/bindresvport.c b/libc/inet/rpc/bindresvport.c index 1234f0682..98ce691ee 100644 --- a/libc/inet/rpc/bindresvport.c +++ b/libc/inet/rpc/bindresvport.c @@ -58,7 +58,7 @@ bindresvport (int sd, struct sockaddr_in *sin) if (sin == (struct sockaddr_in *) 0) { sin = &myaddr; - memset (sin, 0, sizeof (*sin)); + __memset (sin, 0, sizeof (*sin)); sin->sin_family = AF_INET; } else if (sin->sin_family != AF_INET) diff --git a/libc/inet/rpc/clnt_generic.c b/libc/inet/rpc/clnt_generic.c index c8fe545c3..3e2998477 100644 --- a/libc/inet/rpc/clnt_generic.c +++ b/libc/inet/rpc/clnt_generic.c @@ -63,11 +63,11 @@ clnt_create (const char *hostname, u_long prog, u_long vers, CLIENT *client; int herr; - if (strcmp (proto, "unix") == 0) + if (__strcmp (proto, "unix") == 0) { - memset ((char *)&sun, 0, sizeof (sun)); + __memset ((char *)&sun, 0, sizeof (sun)); sun.sun_family = AF_UNIX; - strcpy (sun.sun_path, hostname); + __strcpy (sun.sun_path, hostname); sock = RPC_ANYSOCK; client = clntunix_create (&sun, prog, vers, &sock, 0, 0); if (client == NULL) @@ -112,8 +112,8 @@ clnt_create (const char *hostname, u_long prog, u_long vers, } sin.sin_family = h->h_addrtype; sin.sin_port = 0; - memset (sin.sin_zero, 0, sizeof (sin.sin_zero)); - memcpy ((char *) &sin.sin_addr, h->h_addr, h->h_length); + __memset (sin.sin_zero, 0, sizeof (sin.sin_zero)); + __memcpy ((char *) &sin.sin_addr, h->h_addr, h->h_length); prtbuflen = 1024; prttmpbuf = alloca (prtbuflen); diff --git a/libc/inet/rpc/clnt_perror.c b/libc/inet/rpc/clnt_perror.c index 1c9ca88ae..595ddde9a 100644 --- a/libc/inet/rpc/clnt_perror.c +++ b/libc/inet/rpc/clnt_perror.c @@ -91,8 +91,8 @@ clnt_sperror (CLIENT * rpch, const char *msg) len = sprintf (str, "%s: ", msg); str += len; - (void) strcpy(str, clnt_sperrno(e.re_status)); - str += strlen(str); + (void) __strcpy(str, clnt_sperrno(e.re_status)); + str += __strlen(str); switch (e.re_status) { @@ -126,13 +126,13 @@ clnt_sperror (CLIENT * rpch, const char *msg) case RPC_AUTHERROR: err = auth_errmsg (e.re_why); - (void) strcpy(str, _("; why = ")); - str += strlen(str); + (void) __strcpy(str, _("; why = ")); + str += __strlen(str); if (err != NULL) { - (void) strcpy(str, err); - str += strlen(str); + (void) __strcpy(str, err); + str += __strlen(str); } else { @@ -316,27 +316,27 @@ clnt_spcreateerror (const char *msg) ce = &get_rpc_createerr (); len = sprintf (str, "%s: ", msg); cp = str + len; - (void) strcpy(cp, clnt_sperrno (ce->cf_stat)); - cp += strlen(cp); + (void) __strcpy(cp, clnt_sperrno (ce->cf_stat)); + cp += __strlen(cp); switch (ce->cf_stat) { case RPC_PMAPFAILURE: - (void) strcpy(cp, " - "); - cp += strlen(cp); + (void) __strcpy(cp, " - "); + cp += __strlen(cp); - (void) strcpy(cp, clnt_sperrno (ce->cf_error.re_status)); - cp += strlen(cp); + (void) __strcpy(cp, clnt_sperrno (ce->cf_error.re_status)); + cp += __strlen(cp); break; case RPC_SYSTEMERROR: - (void) strcpy(cp, " - "); - cp += strlen(cp); + (void) __strcpy(cp, " - "); + cp += __strlen(cp); strerror_r (ce->cf_error.re_errno, chrbuf, sizeof chrbuf); - (void) strcpy(cp, chrbuf); - cp += strlen(cp); + (void) __strcpy(cp, chrbuf); + cp += __strlen(cp); break; default: break; diff --git a/libc/inet/rpc/clnt_simple.c b/libc/inet/rpc/clnt_simple.c index b9d315aef..dede4a028 100644 --- a/libc/inet/rpc/clnt_simple.c +++ b/libc/inet/rpc/clnt_simple.c @@ -87,7 +87,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum, crp->socket = RPC_ANYSOCK; } if (crp->valid && crp->oldprognum == prognum && crp->oldversnum == versnum - && strcmp (crp->oldhost, host) == 0) + && __strcmp (crp->oldhost, host) == 0) { /* reuse old client */ } @@ -100,7 +100,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum, crp->valid = 0; if (crp->socket != RPC_ANYSOCK) { - (void) close (crp->socket); + (void) __close (crp->socket); crp->socket = RPC_ANYSOCK; } if (crp->client) @@ -125,7 +125,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum, timeout.tv_usec = 0; timeout.tv_sec = 5; - memcpy ((char *) &server_addr.sin_addr, hp->h_addr, hp->h_length); + __memcpy ((char *) &server_addr.sin_addr, hp->h_addr, hp->h_length); server_addr.sin_family = AF_INET; server_addr.sin_port = 0; if ((crp->client = clntudp_create (&server_addr, (u_long) prognum, @@ -134,7 +134,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum, crp->valid = 1; crp->oldprognum = prognum; crp->oldversnum = versnum; - (void) strncpy (crp->oldhost, host, 255); + (void) __strncpy (crp->oldhost, host, 255); crp->oldhost[255] = '\0'; } tottimeout.tv_sec = 25; diff --git a/libc/inet/rpc/clnt_tcp.c b/libc/inet/rpc/clnt_tcp.c index 62c95bbf0..ad2797a9e 100644 --- a/libc/inet/rpc/clnt_tcp.c +++ b/libc/inet/rpc/clnt_tcp.c @@ -175,7 +175,7 @@ clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers, ce->cf_stat = RPC_SYSTEMERROR; ce->cf_error.re_errno = errno; if (*sockp >= 0) - (void) close (*sockp); + (void) __close (*sockp); goto fooy; } ct->ct_closeit = TRUE; @@ -211,7 +211,7 @@ clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers, { if (ct->ct_closeit) { - (void) close (*sockp); + (void) __close (*sockp); } goto fooy; } @@ -464,7 +464,7 @@ clnttcp_destroy (CLIENT *h) if (ct->ct_closeit) { - (void) close (ct->ct_sock); + (void) __close (ct->ct_sock); } XDR_DESTROY (&(ct->ct_xdrs)); mem_free ((caddr_t) ct, sizeof (struct ct_data)); @@ -506,7 +506,7 @@ readtcp (char *ctptr, char *buf, int len) } break; } - switch (len = read (ct->ct_sock, buf, len)) + switch (len = __read (ct->ct_sock, buf, len)) { case 0: @@ -532,7 +532,7 @@ writetcp (char *ctptr, char *buf, int len) for (cnt = len; cnt > 0; cnt -= i, buf += i) { - if ((i = write (ct->ct_sock, buf, cnt)) == -1) + if ((i = __write (ct->ct_sock, buf, cnt)) == -1) { ct->ct_error.re_errno = errno; ct->ct_error.re_status = RPC_CANTSEND; diff --git a/libc/inet/rpc/clnt_udp.c b/libc/inet/rpc/clnt_udp.c index bd25e4b33..5a7e35e80 100644 --- a/libc/inet/rpc/clnt_udp.c +++ b/libc/inet/rpc/clnt_udp.c @@ -405,13 +405,13 @@ send_again: msg.msg_controllen = 256; ret = recvmsg (cu->cu_sock, &msg, MSG_ERRQUEUE); if (ret >= 0 - && memcmp (cbuf + 256, cu->cu_outbuf, ret) == 0 + && __memcmp (cbuf + 256, cu->cu_outbuf, ret) == 0 && (msg.msg_flags & MSG_ERRQUEUE) && ((msg.msg_namelen == 0 && ret >= 12) || (msg.msg_namelen == sizeof (err_addr) && err_addr.sin_family == AF_INET - && memcmp (&err_addr.sin_addr, &cu->cu_raddr.sin_addr, + && __memcmp (&err_addr.sin_addr, &cu->cu_raddr.sin_addr, sizeof (err_addr.sin_addr)) == 0 && err_addr.sin_port == cu->cu_raddr.sin_port))) for (cmsg = CMSG_FIRSTHDR (&msg); cmsg; @@ -606,7 +606,7 @@ clntudp_destroy (CLIENT *cl) if (cu->cu_closeit) { - (void) close (cu->cu_sock); + (void) __close (cu->cu_sock); } XDR_DESTROY (&(cu->cu_outxdrs)); mem_free ((caddr_t) cu, (sizeof (*cu) + cu->cu_sendsz + cu->cu_recvsz)); diff --git a/libc/inet/rpc/clnt_unix.c b/libc/inet/rpc/clnt_unix.c index a6ac295ad..93ea42afd 100644 --- a/libc/inet/rpc/clnt_unix.c +++ b/libc/inet/rpc/clnt_unix.c @@ -149,7 +149,7 @@ clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers, if (*sockp < 0) { *sockp = socket (AF_UNIX, SOCK_STREAM, 0); - len = strlen (raddr->sun_path) + sizeof (raddr->sun_family) + 1; + len = __strlen (raddr->sun_path) + sizeof (raddr->sun_family) + 1; if (*sockp < 0 || connect (*sockp, (struct sockaddr *) raddr, len) < 0) { @@ -157,7 +157,7 @@ clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers, ce->cf_stat = RPC_SYSTEMERROR; ce->cf_error.re_errno = errno; if (*sockp != -1) - close (*sockp); + __close (*sockp); goto fooy; } ct->ct_closeit = TRUE; @@ -191,7 +191,7 @@ clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers, if (!xdr_callhdr (&(ct->ct_xdrs), &call_msg)) { if (ct->ct_closeit) - close (*sockp); + __close (*sockp); goto fooy; } ct->ct_mpos = XDR_GETPOS (&(ct->ct_xdrs)); @@ -437,7 +437,7 @@ clntunix_destroy (CLIENT *h) if (ct->ct_closeit) { - (void) close (ct->ct_sock); + (void) __close (ct->ct_sock); } XDR_DESTROY (&(ct->ct_xdrs)); mem_free ((caddr_t) ct, sizeof (struct ct_data)); @@ -510,7 +510,7 @@ __msgwrite (int sock, void *data, size_t cnt) cred.uid = geteuid (); cred.gid = getegid (); - memcpy (CMSG_DATA(cmsg), &cred, sizeof (struct ucred)); + __memcpy (CMSG_DATA(cmsg), &cred, sizeof (struct ucred)); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_CREDENTIALS; cmsg->cmsg_len = sizeof(*cmsg) + sizeof(struct ucred); diff --git a/libc/inet/rpc/get_myaddress.c b/libc/inet/rpc/get_myaddress.c index 7674a7a46..ef2c2f52e 100644 --- a/libc/inet/rpc/get_myaddress.c +++ b/libc/inet/rpc/get_myaddress.c @@ -94,7 +94,7 @@ get_myaddress (struct sockaddr_in *addr) { *addr = *((struct sockaddr_in *) &ifr->ifr_addr); addr->sin_port = htons (PMAPPORT); - close (s); + __close (s); return; } ifr++; @@ -104,5 +104,5 @@ get_myaddress (struct sockaddr_in *addr) loopback = 1; goto again; } - close (s); + __close (s); } diff --git a/libc/inet/rpc/getrpcent.c b/libc/inet/rpc/getrpcent.c index 56fbbbe45..c261dfb3b 100644 --- a/libc/inet/rpc/getrpcent.c +++ b/libc/inet/rpc/getrpcent.c @@ -96,10 +96,10 @@ struct rpcent *getrpcbyname(const char *name) setrpcent(0); while ((rpc = getrpcent())) { - if (strcmp(rpc->r_name, name) == 0) + if (__strcmp(rpc->r_name, name) == 0) return rpc; for (rp = rpc->r_aliases; *rp != NULL; rp++) { - if (strcmp(*rp, name) == 0) + if (__strcmp(*rp, name) == 0) return rpc; } } @@ -166,8 +166,8 @@ static char *firstwhite(char *s) { char *s1, *s2; - s1 = strchr(s, ' '); - s2 = strchr(s, '\t'); + s1 = __strchr(s, ' '); + s2 = __strchr(s, '\t'); if (s1) { if (s2) return (s1 < s2) ? s1 : s2; @@ -184,12 +184,12 @@ static struct rpcent *interpret(register struct rpcdata *d) register char *cp, **q; p = d->line; - d->line[strlen(p)-1] = '\n'; + d->line[__strlen(p)-1] = '\n'; if (*p == '#') return __get_next_rpcent(d); - cp = strchr(p, '#'); + cp = __strchr(p, '#'); if (cp == NULL) { - cp = strchr(p, '\n'); + cp = __strchr(p, '\n'); if (cp == NULL) return __get_next_rpcent(d); } @@ -200,9 +200,9 @@ static struct rpcent *interpret(register struct rpcdata *d) else return __get_next_rpcent(d); #else - cp = strchr(p, ' '); + cp = __strchr(p, ' '); if (cp == NULL) { - cp = strchr(p, '\t'); + cp = __strchr(p, '\t'); if (cp == NULL) return __get_next_rpcent(d); } @@ -218,11 +218,11 @@ static struct rpcent *interpret(register struct rpcdata *d) if ((cp = firstwhite(cp))) *cp++ = '\0'; #else - cp = strchr(p, ' '); + cp = __strchr(p, ' '); if (cp != NULL) *cp++ = '\0'; else { - cp = strchr(p, '\t'); + cp = __strchr(p, '\t'); if (cp != NULL) *cp++ = '\0'; } @@ -238,11 +238,11 @@ static struct rpcent *interpret(register struct rpcdata *d) if ((cp = firstwhite(cp))) *cp++ = '\0'; #else - cp = strchr(p, ' '); + cp = __strchr(p, ' '); if (cp != NULL) *cp++ = '\0'; else { - cp = strchr(p, '\t'); + cp = __strchr(p, '\t'); if (cp != NULL) *cp++ = '\0'; } @@ -275,8 +275,8 @@ static int __copy_rpcent(struct rpcent *r, struct rpcent *result_buf, char *buff return ENOENT; /* copy the struct from the shared mem */ - memset(result_buf, 0x00, sizeof(*result_buf)); - memset(buffer, 0x00, buflen); + __memset(result_buf, 0x00, sizeof(*result_buf)); + __memset(buffer, 0x00, buflen); result_buf->r_number = r->r_number; @@ -293,21 +293,21 @@ static int __copy_rpcent(struct rpcent *r, struct rpcent *result_buf, char *buff buflen -= s; while (i-- > 0) { - s = strlen(r->r_aliases[i]) + 1; + s = __strlen(r->r_aliases[i]) + 1; if (buflen < s) goto err_out; result_buf->r_aliases[i] = buffer; buffer += s; buflen -= s; - memcpy(result_buf->r_aliases[i], r->r_aliases[i], s); + __memcpy(result_buf->r_aliases[i], r->r_aliases[i], s); } /* copy the name */ - i = strlen(r->r_name); + i = __strlen(r->r_name); if (buflen <= i) goto err_out; result_buf->r_name = buffer; - memcpy(result_buf->r_name, r->r_name, i); + __memcpy(result_buf->r_name, r->r_name, i); /* that was a hoot eh ? */ *result = result_buf; diff --git a/libc/inet/rpc/getrpcport.c b/libc/inet/rpc/getrpcport.c index 851a1c487..5470fbff6 100644 --- a/libc/inet/rpc/getrpcport.c +++ b/libc/inet/rpc/getrpcport.c @@ -70,7 +70,7 @@ getrpcport (const char *host, u_long prognum, u_long versnum, u_int proto) buffer = alloca (buflen); } - memcpy ((char *) &addr.sin_addr, hp->h_addr, hp->h_length); + __memcpy ((char *) &addr.sin_addr, hp->h_addr, hp->h_length); addr.sin_family = AF_INET; addr.sin_port = 0; return pmap_getport (&addr, prognum, versnum, proto); diff --git a/libc/inet/rpc/pmap_clnt.c b/libc/inet/rpc/pmap_clnt.c index 2382c153b..5bbc81564 100644 --- a/libc/inet/rpc/pmap_clnt.c +++ b/libc/inet/rpc/pmap_clnt.c @@ -90,7 +90,7 @@ __get_myaddress (struct sockaddr_in *addr) { *addr = *((struct sockaddr_in *) &ifr->ifr_addr); addr->sin_port = htons (PMAPPORT); - close (s); + __close (s); return TRUE; } ifr++; @@ -100,7 +100,7 @@ __get_myaddress (struct sockaddr_in *addr) loopback = 0; goto again; } - close (s); + __close (s); return FALSE; } @@ -139,7 +139,7 @@ pmap_set (u_long program, u_long version, int protocol, u_short port) return FALSE; } CLNT_DESTROY (client); - /* (void)close(socket); CLNT_DESTROY closes it */ + /* (void)__close(socket); CLNT_DESTROY closes it */ return rslt; } @@ -168,6 +168,6 @@ pmap_unset (u_long program, u_long version) CLNT_CALL (client, PMAPPROC_UNSET, (xdrproc_t)xdr_pmap, (caddr_t)&parms, (xdrproc_t)xdr_bool, (caddr_t)&rslt, tottimeout); CLNT_DESTROY (client); - /* (void)close(socket); CLNT_DESTROY already closed it */ + /* (void)__close(socket); CLNT_DESTROY already closed it */ return rslt; } diff --git a/libc/inet/rpc/pmap_getmaps.c b/libc/inet/rpc/pmap_getmaps.c index c435dea4e..4ec2d40e9 100644 --- a/libc/inet/rpc/pmap_getmaps.c +++ b/libc/inet/rpc/pmap_getmaps.c @@ -74,7 +74,7 @@ pmap_getmaps (struct sockaddr_in *address) } CLNT_DESTROY (client); } - /* (void)close(socket); CLNT_DESTROY already closed it */ + /* (void)__close(socket); CLNT_DESTROY already closed it */ address->sin_port = 0; return head; } diff --git a/libc/inet/rpc/pmap_getport.c b/libc/inet/rpc/pmap_getport.c index 6d68ef01f..45ed4eae8 100644 --- a/libc/inet/rpc/pmap_getport.c +++ b/libc/inet/rpc/pmap_getport.c @@ -88,7 +88,7 @@ pmap_getport (address, program, version, protocol) } CLNT_DESTROY (client); } - /* (void)close(socket); CLNT_DESTROY already closed it */ + /* (void)__close(socket); CLNT_DESTROY already closed it */ address->sin_port = 0; return port; } diff --git a/libc/inet/rpc/pmap_rmt.c b/libc/inet/rpc/pmap_rmt.c index 04f558fe2..db875e987 100644 --- a/libc/inet/rpc/pmap_rmt.c +++ b/libc/inet/rpc/pmap_rmt.c @@ -40,6 +40,7 @@ static char sccsid[] = "@(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro"; */ #define authunix_create_default __authunix_create_default +#define inet_makeaddr __inet_makeaddr #define __FORCE_GLIBC #include <features.h> @@ -281,7 +282,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) fd.fd = sock; fd.events = POLLIN; nets = getbroadcastnets (addrs, sock, inbuf); - memset ((char *) &baddr, 0, sizeof (baddr)); + __memset ((char *) &baddr, 0, sizeof (baddr)); baddr.sin_family = AF_INET; baddr.sin_port = htons (PMAPPORT); baddr.sin_addr.s_addr = htonl (INADDR_ANY); @@ -409,7 +410,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) } } done_broad: - (void) close (sock); + (void) __close (sock); AUTH_DESTROY (unix_auth); return stat; } diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c index cb4866b7a..a51d09fcd 100644 --- a/libc/inet/rpc/rcmd.c +++ b/libc/inet/rpc/rcmd.c @@ -155,7 +155,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) sin.sin_port = rport; if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0) /* __connect */ break; - (void)close(s); /* __close */ + (void)__close(s); if (errno == EADDRINUSE) { lport--; continue; @@ -185,7 +185,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) } lport--; if (fd2p == 0) { - write(s, "", 1); /* __write */ + __write(s, "", 1); lport = 0; } else { char num[8]; @@ -196,10 +196,10 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) goto bad; listen(s2, 1); (void)snprintf(num, sizeof(num), "%d", lport); /* __snprintf */ - if (write(s, num, strlen(num)+1) != strlen(num)+1) { + if (__write(s, num, __strlen(num)+1) != __strlen(num)+1) { (void)fprintf(stderr, "rcmd: write (setting up stderr): %m\n"); - (void)close(s2); /* __close */ + (void)__close(s2); goto bad; } pfd[0].fd = s; @@ -210,11 +210,11 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) (void)fprintf(stderr, "rcmd: poll (setting up stderr): %m\n"); else (void)fprintf(stderr, "poll: protocol failure in circuit setup\n"); - (void)close(s2); + (void)__close(s2); goto bad; } s3 = accept(s2, (struct sockaddr *)&from, &len); - (void)close(s2); + (void)__close(s2); if (s3 < 0) { (void)fprintf(stderr, "rcmd: accept: %m\n"); @@ -231,17 +231,17 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) goto bad2; } } - (void)write(s, locuser, strlen(locuser)+1); - (void)write(s, remuser, strlen(remuser)+1); - (void)write(s, cmd, strlen(cmd)+1); - if (read(s, &c, 1) != 1) { + (void)__write(s, locuser, __strlen(locuser)+1); + (void)__write(s, remuser, __strlen(remuser)+1); + (void)__write(s, cmd, __strlen(cmd)+1); + if (__read(s, &c, 1) != 1) { (void)fprintf(stderr, "rcmd: %s: %m\n", *ahost); goto bad2; } if (c != 0) { - while (read(s, &c, 1) == 1) { - (void)write(STDERR_FILENO, &c, 1); + while (__read(s, &c, 1) == 1) { + (void)__write(STDERR_FILENO, &c, 1); if (c == '\n') break; } @@ -251,9 +251,9 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) return s; bad2: if (lport) - (void)close(*fd2p); + (void)__close(*fd2p); bad: - (void)close(s); + (void)__close(s); sigsetmask(oldmask); return -1; } @@ -273,12 +273,12 @@ int rresvport(int *alport) if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0) return s; if (errno != EADDRINUSE) { - (void)close(s); + (void)__close(s); return -1; } (*alport)--; if (*alport == IPPORT_RESERVED/2) { - (void)close(s); + (void)__close(s); __set_errno (EAGAIN); /* close */ return -1; } @@ -455,10 +455,10 @@ iruserok2 (raddr, superuser, ruser, luser, rhost) return -1; #endif - dirlen = strlen (pwd->pw_dir); + dirlen = __strlen (pwd->pw_dir); pbuf = malloc (dirlen + sizeof "/.rhosts"); - strcpy (pbuf, pwd->pw_dir); - strcat (pbuf, "/.rhosts"); + __strcpy (pbuf, pwd->pw_dir); + __strcat (pbuf, "/.rhosts"); /* Change effective uid while reading .rhosts. If root and reading an NFS mounted file system, can't read files that @@ -523,18 +523,18 @@ __icheckhost (u_int32_t raddr, char *lhost, const char *rhost) #ifdef HAVE_NETGROUP /* Check nis netgroup. */ - if (strncmp ("+@", lhost, 2) == 0) + if (__strncmp ("+@", lhost, 2) == 0) return innetgr (&lhost[2], rhost, NULL, NULL); - if (strncmp ("-@", lhost, 2) == 0) + if (__strncmp ("-@", lhost, 2) == 0) return -innetgr (&lhost[2], rhost, NULL, NULL); #endif /* HAVE_NETGROUP */ /* -host */ - if (strncmp ("-", lhost,1) == 0) { + if (__strncmp ("-", lhost,1) == 0) { negate = -1; lhost++; - } else if (strcmp ("+",lhost) == 0) { + } else if (__strcmp ("+",lhost) == 0) { return 1; /* asking for trouble, but ok.. */ } @@ -564,7 +564,7 @@ __icheckhost (u_int32_t raddr, char *lhost, const char *rhost) /* Spin through ip addresses. */ for (pp = hp->h_addr_list; *pp; ++pp) - if (!memcmp (&raddr, *pp, sizeof (u_int32_t))) + if (!__memcmp (&raddr, *pp, sizeof (u_int32_t))) return negate; /* No match. */ @@ -583,23 +583,23 @@ __icheckuser (const char *luser, const char *ruser) #ifdef HAVE_NETGROUP /* [-+]@netgroup */ - if (strncmp ("+@", luser, 2) == 0) + if (__strncmp ("+@", luser, 2) == 0) return innetgr (&luser[2], NULL, ruser, NULL); - if (strncmp ("-@", luser,2) == 0) + if (__strncmp ("-@", luser,2) == 0) return -innetgr (&luser[2], NULL, ruser, NULL); #endif /* HAVE_NETGROUP */ /* -user */ - if (strncmp ("-", luser, 1) == 0) - return -(strcmp (&luser[1], ruser) == 0); + if (__strncmp ("-", luser, 1) == 0) + return -(__strcmp (&luser[1], ruser) == 0); /* + */ - if (strcmp ("+", luser) == 0) + if (__strcmp ("+", luser) == 0) return 1; /* simple string match */ - return strcmp (ruser, luser) == 0; + return __strcmp (ruser, luser) == 0; } /* @@ -641,7 +641,7 @@ __ivaliduser2(hostf, raddr, luser, ruser, rhost) } /* Skip lines that are too long. */ - if (strchr (p, '\n') == NULL) { + if (__strchr (p, '\n') == NULL) { int ch = getc_unlocked (hostf); while (ch != '\n' && ch != EOF) diff --git a/libc/inet/rpc/rexec.c b/libc/inet/rpc/rexec.c index 2c280d922..00e68ff6b 100644 --- a/libc/inet/rpc/rexec.c +++ b/libc/inet/rpc/rexec.c @@ -70,7 +70,7 @@ rexec_af(ahost, rport, name, pass, cmd, fd2p, af) snprintf(servbuff, sizeof(servbuff), "%d", ntohs(rport)); servbuff[sizeof(servbuff) - 1] = '\0'; - memset(&hints, 0, sizeof(hints)); + __memset(&hints, 0, sizeof(hints)); hints.ai_family = af; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_CANONNAME; @@ -81,7 +81,7 @@ rexec_af(ahost, rport, name, pass, cmd, fd2p, af) } if (res0->ai_canonname){ - strncpy(ahostbuf, res0->ai_canonname, sizeof(ahostbuf)); + __strncpy(ahostbuf, res0->ai_canonname, sizeof(ahostbuf)); ahostbuf[sizeof(ahostbuf)-1] = '\0'; *ahost = ahostbuf; } @@ -97,7 +97,7 @@ retry: } if (connect(s, res0->ai_addr, res0->ai_addrlen) < 0) { if (errno == ECONNREFUSED && timo <= 16) { - (void) close(s); + (void) __close(s); sleep(timo); timo *= 2; goto retry; @@ -106,7 +106,7 @@ retry: return (-1); } if (fd2p == 0) { - (void) write(s, "", 1); + (void) __write(s, "", 1); port = 0; } else { char num[32]; @@ -114,18 +114,18 @@ retry: s2 = socket(res0->ai_family, res0->ai_socktype, 0); if (s2 < 0) { - (void) close(s); + (void) __close(s); return (-1); } listen(s2, 1); sa2len = sizeof (sa2); if (getsockname(s2, (struct sockaddr *)&sa2, &sa2len) < 0) { perror("getsockname"); - (void) close(s2); + (void) __close(s2); goto bad; } else if (sa2len != SA_LEN((struct sockaddr *)&sa2)) { __set_errno(EINVAL); - (void) close(s2); + (void) __close(s2); goto bad; } port = 0; @@ -134,10 +134,10 @@ retry: NI_NUMERICSERV)) port = atoi(servbuff); (void) sprintf(num, "%u", port); - (void) write(s, num, strlen(num)+1); + (void) __write(s, num, __strlen(num)+1); { socklen_t len = sizeof (from); s3 = accept(s2, (struct sockaddr *)&from, &len); - close(s2); + __close(s2); if (s3 < 0) { perror("accept"); port = 0; @@ -146,10 +146,10 @@ retry: } *fd2p = s3; } - (void) write(s, name, strlen(name) + 1); + (void) __write(s, name, __strlen(name) + 1); /* should public key encypt the password here */ - (void) |