diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2015-09-13 15:36:58 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2015-09-13 15:36:58 +0000 |
commit | 1e31bb92226e5857f47b149158590a7e92900ae0 (patch) | |
tree | 251158dca086b7eb15a3fb7fcee25a083315b83b /lib/libc/rpc | |
parent | 154fdff60dfaf55373633176c4b9877a197d71ee (diff) |
Wrap <rpc/*.h> so that calls go direct and the symbols are all weak.
Hide __xprt_register() and _authenticate(); truncate <rpc/svc_auth.h>
ok deraadt@
Diffstat (limited to 'lib/libc/rpc')
-rw-r--r-- | lib/libc/rpc/auth_none.c | 3 | ||||
-rw-r--r-- | lib/libc/rpc/auth_unix.c | 4 | ||||
-rw-r--r-- | lib/libc/rpc/authunix_prot.c | 3 | ||||
-rw-r--r-- | lib/libc/rpc/clnt_perror.c | 7 | ||||
-rw-r--r-- | lib/libc/rpc/clnt_tcp.c | 3 | ||||
-rw-r--r-- | lib/libc/rpc/clnt_udp.c | 4 | ||||
-rw-r--r-- | lib/libc/rpc/get_myaddress.c | 3 | ||||
-rw-r--r-- | lib/libc/rpc/getrpcent.c | 5 | ||||
-rw-r--r-- | lib/libc/rpc/pmap_clnt.c | 4 | ||||
-rw-r--r-- | lib/libc/rpc/pmap_getport.c | 3 | ||||
-rw-r--r-- | lib/libc/rpc/pmap_prot.c | 3 | ||||
-rw-r--r-- | lib/libc/rpc/pmap_prot2.c | 3 | ||||
-rw-r--r-- | lib/libc/rpc/pmap_rmt.c | 4 | ||||
-rw-r--r-- | lib/libc/rpc/rpc_callmsg.c | 4 | ||||
-rw-r--r-- | lib/libc/rpc/rpc_prot.c | 9 | ||||
-rw-r--r-- | lib/libc/rpc/svc.c | 13 | ||||
-rw-r--r-- | lib/libc/rpc/svc_auth.c | 8 | ||||
-rw-r--r-- | lib/libc/rpc/svc_auth_unix.c | 4 | ||||
-rw-r--r-- | lib/libc/rpc/svc_tcp.c | 3 | ||||
-rw-r--r-- | lib/libc/rpc/svc_udp.c | 4 | ||||
-rw-r--r-- | lib/libc/rpc/xdr.c | 17 | ||||
-rw-r--r-- | lib/libc/rpc/xdr_array.c | 3 | ||||
-rw-r--r-- | lib/libc/rpc/xdr_mem.c | 3 | ||||
-rw-r--r-- | lib/libc/rpc/xdr_rec.c | 18 | ||||
-rw-r--r-- | lib/libc/rpc/xdr_reference.c | 4 |
25 files changed, 106 insertions, 33 deletions
diff --git a/lib/libc/rpc/auth_none.c b/lib/libc/rpc/auth_none.c index 1c4f3290829..68f759e1b40 100644 --- a/lib/libc/rpc/auth_none.c +++ b/lib/libc/rpc/auth_none.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auth_none.c,v 1.12 2015/08/20 21:49:29 deraadt Exp $ */ +/* $OpenBSD: auth_none.c,v 1.13 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -93,6 +93,7 @@ authnone_create(void) } return (&ap->no_client); } +DEF_WEAK(authnone_create); /*ARGSUSED*/ static bool_t diff --git a/lib/libc/rpc/auth_unix.c b/lib/libc/rpc/auth_unix.c index c0b2565c17a..de2262ce747 100644 --- a/lib/libc/rpc/auth_unix.c +++ b/lib/libc/rpc/auth_unix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auth_unix.c,v 1.24 2015/09/02 06:47:19 deraadt Exp $ */ +/* $OpenBSD: auth_unix.c,v 1.25 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -158,6 +158,7 @@ authfail: free(auth); return (NULL); } +DEF_WEAK(authunix_create); /* @@ -201,6 +202,7 @@ authunix_create_default(void) gids2[i] = gids[i]; return (authunix_create(machname, uid, gid, len, gids2)); } +DEF_WEAK(authunix_create_default); /* * authunix operations diff --git a/lib/libc/rpc/authunix_prot.c b/lib/libc/rpc/authunix_prot.c index 913167211ff..c04c3dfcec1 100644 --- a/lib/libc/rpc/authunix_prot.c +++ b/lib/libc/rpc/authunix_prot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: authunix_prot.c,v 1.7 2010/09/01 14:43:34 millert Exp $ */ +/* $OpenBSD: authunix_prot.c,v 1.8 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -58,4 +58,5 @@ xdr_authunix_parms(XDR *xdrs, struct authunix_parms *p) } return (FALSE); } +DEF_WEAK(xdr_authunix_parms); diff --git a/lib/libc/rpc/clnt_perror.c b/lib/libc/rpc/clnt_perror.c index 32e37bab588..7ddf5b4d120 100644 --- a/lib/libc/rpc/clnt_perror.c +++ b/lib/libc/rpc/clnt_perror.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clnt_perror.c,v 1.23 2010/09/01 14:43:34 millert Exp $ */ +/* $OpenBSD: clnt_perror.c,v 1.24 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -140,12 +140,14 @@ truncated: snprintf(buf + CLNT_PERROR_BUFLEN - 5, 5, "...\n"); return (buf); } +DEF_WEAK(clnt_sperror); void clnt_perror(CLIENT *rpch, char *s) { (void) fprintf(stderr, "%s", clnt_sperror(rpch, s)); } +DEF_WEAK(clnt_perror); static const char *const rpc_errlist[] = { "RPC: Success", /* 0 - RPC_SUCCESS */ @@ -182,6 +184,7 @@ clnt_sperrno(enum clnt_stat stat) return ("RPC: (unknown error code)"); } +DEF_WEAK(clnt_sperrno); void clnt_perrno(enum clnt_stat num) @@ -215,12 +218,14 @@ clnt_spcreateerror(char *s) buf[CLNT_PERROR_BUFLEN-1] = '\0'; return (buf); } +DEF_WEAK(clnt_spcreateerror); void clnt_pcreateerror(char *s) { fprintf(stderr, "%s", clnt_spcreateerror(s)); } +DEF_WEAK(clnt_pcreateerror); static const char *const auth_errlist[] = { "Authentication OK", /* 0 - AUTH_OK */ diff --git a/lib/libc/rpc/clnt_tcp.c b/lib/libc/rpc/clnt_tcp.c index 1b164d6b0a2..ba4d33baef9 100644 --- a/lib/libc/rpc/clnt_tcp.c +++ b/lib/libc/rpc/clnt_tcp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clnt_tcp.c,v 1.27 2015/09/01 19:54:01 deraadt Exp $ */ +/* $OpenBSD: clnt_tcp.c,v 1.28 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -222,6 +222,7 @@ fooy: mem_free((caddr_t)h, sizeof(CLIENT)); return (NULL); } +DEF_WEAK(clnttcp_create); static enum clnt_stat clnttcp_call(CLIENT *h, u_long proc, xdrproc_t xdr_args, caddr_t args_ptr, diff --git a/lib/libc/rpc/clnt_udp.c b/lib/libc/rpc/clnt_udp.c index 472e1faabc7..5d4654cdd70 100644 --- a/lib/libc/rpc/clnt_udp.c +++ b/lib/libc/rpc/clnt_udp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clnt_udp.c,v 1.30 2015/09/09 15:40:04 guenther Exp $ */ +/* $OpenBSD: clnt_udp.c,v 1.31 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -186,6 +186,7 @@ fooy: mem_free((caddr_t)cl, sizeof(CLIENT)); return (NULL); } +DEF_WEAK(clntudp_bufcreate); CLIENT * clntudp_create(struct sockaddr_in *raddr, u_long program, u_long version, @@ -195,6 +196,7 @@ clntudp_create(struct sockaddr_in *raddr, u_long program, u_long version, return(clntudp_bufcreate(raddr, program, version, wait, sockp, UDPMSGSIZE, UDPMSGSIZE)); } +DEF_WEAK(clntudp_create); static enum clnt_stat clntudp_call(CLIENT *cl, /* client handle */ diff --git a/lib/libc/rpc/get_myaddress.c b/lib/libc/rpc/get_myaddress.c index 72e39494742..d0ac78f796e 100644 --- a/lib/libc/rpc/get_myaddress.c +++ b/lib/libc/rpc/get_myaddress.c @@ -1,4 +1,4 @@ -/* $OpenBSD: get_myaddress.c,v 1.14 2013/11/12 06:09:50 deraadt Exp $ */ +/* $OpenBSD: get_myaddress.c,v 1.15 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -82,3 +82,4 @@ get_myaddress(struct sockaddr_in *addr) freeifaddrs(ifap); return (0); } +DEF_WEAK(get_myaddress); diff --git a/lib/libc/rpc/getrpcent.c b/lib/libc/rpc/getrpcent.c index 41e1b82095d..6581270c4bc 100644 --- a/lib/libc/rpc/getrpcent.c +++ b/lib/libc/rpc/getrpcent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getrpcent.c,v 1.20 2015/09/11 11:33:03 deraadt Exp $ */ +/* $OpenBSD: getrpcent.c,v 1.21 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -116,6 +116,7 @@ setrpcent(int f) rewind(d->rpcf); d->stayopen |= f; } +DEF_WEAK(setrpcent); void endrpcent(void) @@ -129,6 +130,7 @@ endrpcent(void) d->rpcf = NULL; } } +DEF_WEAK(endrpcent); struct rpcent * getrpcent(void) @@ -144,6 +146,7 @@ getrpcent(void) return (NULL); return (interpret(d->line, strlen(d->line))); } +DEF_WEAK(getrpcent); static struct rpcent * interpret(char *val, int len) diff --git a/lib/libc/rpc/pmap_clnt.c b/lib/libc/rpc/pmap_clnt.c index 0abba0892e3..0d7b8bcd6bc 100644 --- a/lib/libc/rpc/pmap_clnt.c +++ b/lib/libc/rpc/pmap_clnt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap_clnt.c,v 1.18 2015/09/02 06:47:19 deraadt Exp $ */ +/* $OpenBSD: pmap_clnt.c,v 1.19 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -81,6 +81,7 @@ pmap_set(u_long program, u_long version, u_int protocol, int iport) errno = save_errno; return (rslt); } +DEF_WEAK(pmap_set); /* * Remove the mapping between program,version and port. @@ -110,3 +111,4 @@ pmap_unset(u_long program, u_long version) CLNT_DESTROY(client); return (rslt); } +DEF_WEAK(pmap_unset); diff --git a/lib/libc/rpc/pmap_getport.c b/lib/libc/rpc/pmap_getport.c index 97f23ccca0c..016aeba72fb 100644 --- a/lib/libc/rpc/pmap_getport.c +++ b/lib/libc/rpc/pmap_getport.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap_getport.c,v 1.12 2014/11/11 04:51:49 guenther Exp $ */ +/* $OpenBSD: pmap_getport.c,v 1.13 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -80,3 +80,4 @@ pmap_getport(struct sockaddr_in *address, u_long program, u_long version, address->sin_port = 0; return (port); } +DEF_WEAK(pmap_getport); diff --git a/lib/libc/rpc/pmap_prot.c b/lib/libc/rpc/pmap_prot.c index 097b07138f7..bfa4c251bcd 100644 --- a/lib/libc/rpc/pmap_prot.c +++ b/lib/libc/rpc/pmap_prot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap_prot.c,v 1.7 2010/09/01 14:43:34 millert Exp $ */ +/* $OpenBSD: pmap_prot.c,v 1.8 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -51,3 +51,4 @@ xdr_pmap(XDR *xdrs, struct pmap *regs) return (xdr_u_long(xdrs, ®s->pm_port)); return (FALSE); } +DEF_WEAK(xdr_pmap); diff --git a/lib/libc/rpc/pmap_prot2.c b/lib/libc/rpc/pmap_prot2.c index 20fe99c3d37..ec1f805b04c 100644 --- a/lib/libc/rpc/pmap_prot2.c +++ b/lib/libc/rpc/pmap_prot2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap_prot2.c,v 1.7 2010/09/01 14:43:34 millert Exp $ */ +/* $OpenBSD: pmap_prot2.c,v 1.8 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -110,3 +110,4 @@ xdr_pmaplist(XDR *xdrs, struct pmaplist **rp) rp = (freeing) ? next : &((*rp)->pml_next); } } +DEF_WEAK(xdr_pmaplist); diff --git a/lib/libc/rpc/pmap_rmt.c b/lib/libc/rpc/pmap_rmt.c index a59bbf72542..58f8ac31008 100644 --- a/lib/libc/rpc/pmap_rmt.c +++ b/lib/libc/rpc/pmap_rmt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap_rmt.c,v 1.32 2015/08/20 21:49:29 deraadt Exp $ */ +/* $OpenBSD: pmap_rmt.c,v 1.33 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -124,6 +124,7 @@ xdr_rmtcall_args(XDR *xdrs, struct rmtcallargs *cap) } return (FALSE); } +DEF_WEAK(xdr_rmtcall_args); /* * XDR remote call results @@ -142,6 +143,7 @@ xdr_rmtcallres(XDR *xdrs, struct rmtcallres *crp) } return (FALSE); } +DEF_WEAK(xdr_rmtcallres); /* diff --git a/lib/libc/rpc/rpc_callmsg.c b/lib/libc/rpc/rpc_callmsg.c index a6b47bb8003..5825a0ebfd5 100644 --- a/lib/libc/rpc/rpc_callmsg.c +++ b/lib/libc/rpc/rpc_callmsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rpc_callmsg.c,v 1.11 2015/01/16 16:48:51 deraadt Exp $ */ +/* $OpenBSD: rpc_callmsg.c,v 1.12 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -183,4 +183,4 @@ xdr_callmsg(XDR *xdrs, struct rpc_msg *cmsg) return (xdr_opaque_auth(xdrs, &(cmsg->rm_call.cb_verf))); return (FALSE); } - +DEF_WEAK(xdr_callmsg); diff --git a/lib/libc/rpc/rpc_prot.c b/lib/libc/rpc/rpc_prot.c index ac2bc90a05a..20558bfa04c 100644 --- a/lib/libc/rpc/rpc_prot.c +++ b/lib/libc/rpc/rpc_prot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rpc_prot.c,v 1.12 2015/01/16 16:48:51 deraadt Exp $ */ +/* $OpenBSD: rpc_prot.c,v 1.13 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -61,6 +61,7 @@ xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap) &ap->oa_length, MAX_AUTH_BYTES)); return (FALSE); } +DEF_WEAK(xdr_opaque_auth); /* * XDR a DES block @@ -97,6 +98,7 @@ xdr_accepted_reply(XDR *xdrs, struct accepted_reply *ar) return (TRUE); /* TRUE => open ended set of problems */ } } +DEF_WEAK(xdr_accepted_reply); /* * XDR the MSG_DENIED part of a reply message union @@ -119,6 +121,7 @@ xdr_rejected_reply(XDR *xdrs, struct rejected_reply *rr) } return (FALSE); } +DEF_WEAK(xdr_rejected_reply); static struct xdr_discrim reply_dscrm[3] = { { (int)MSG_ACCEPTED, xdr_accepted_reply }, @@ -138,7 +141,7 @@ xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg) (caddr_t)&(rmsg->rm_reply.ru), reply_dscrm, NULL)); return (FALSE); } - +DEF_WEAK(xdr_replymsg); /* * Serializes the "static part" of a call message header. @@ -159,6 +162,7 @@ xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg) return (xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_vers))); return (FALSE); } +DEF_WEAK(xdr_callhdr); /* ************************** Client utility routine ************* */ @@ -262,3 +266,4 @@ _seterr_reply(struct rpc_msg *msg, struct rpc_err *error) break; } } +DEF_STRONG(_seterr_reply); diff --git a/lib/libc/rpc/svc.c b/lib/libc/rpc/svc.c index 0afcb4bffef..79639591a05 100644 --- a/lib/libc/rpc/svc.c +++ b/lib/libc/rpc/svc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svc.c,v 1.27 2015/08/20 21:49:29 deraadt Exp $ */ +/* $OpenBSD: svc.c,v 1.28 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -278,6 +278,7 @@ xprt_unregister(SVCXPRT *xprt) svc_fd_remove(sock); } } +DEF_WEAK(xprt_unregister); /* ********************** CALLOUT list related stuff ************* */ @@ -315,6 +316,7 @@ pmap_it: } return (TRUE); } +DEF_WEAK(svc_register); /* * Remove a service program from the callout list. @@ -376,6 +378,7 @@ svc_sendreply(SVCXPRT *xprt, xdrproc_t xdr_results, caddr_t xdr_location) rply.acpted_rply.ar_results.proc = xdr_results; return (SVC_REPLY(xprt, &rply)); } +DEF_WEAK(svc_sendreply); /* * No procedure error reply @@ -406,6 +409,7 @@ svcerr_decode(SVCXPRT *xprt) rply.acpted_rply.ar_stat = GARBAGE_ARGS; SVC_REPLY(xprt, &rply); } +DEF_WEAK(svcerr_decode); /* * Some system error @@ -436,6 +440,7 @@ svcerr_auth(SVCXPRT *xprt, enum auth_stat why) rply.rjcted_rply.rj_why = why; SVC_REPLY(xprt, &rply); } +DEF_WEAK(svcerr_auth); /* * Auth too weak error reply @@ -461,6 +466,7 @@ svcerr_noprog(SVCXPRT *xprt) rply.acpted_rply.ar_stat = PROG_UNAVAIL; SVC_REPLY(xprt, &rply); } +DEF_WEAK(svcerr_noprog); /* * Program version mismatch error reply @@ -478,6 +484,7 @@ svcerr_progvers(SVCXPRT *xprt, u_long low_vers, u_long high_vers) rply.acpted_rply.ar_vers.high = high_vers; SVC_REPLY(xprt, &rply); } +DEF_WEAK(svcerr_progvers); /* ******************* SERVER INPUT STUFF ******************* */ @@ -505,6 +512,7 @@ svc_getreq(int rdfds) for (; (bit = ffs(rdfds)); rdfds ^= (1 << (bit - 1))) svc_getreq_common(bit - 1); } +DEF_WEAK(svc_getreq); void svc_getreqset(fd_set *readfds) @@ -525,6 +533,7 @@ svc_getreqset2(fd_set *readfds, int width) svc_getreq_common(sock + bit - 1); } } +DEF_WEAK(svc_getreqset2); void svc_getreq_poll(struct pollfd *pfd, const int nready) @@ -541,6 +550,7 @@ svc_getreq_poll(struct pollfd *pfd, const int nready) svc_getreq_common(pfd[i].fd); } } +DEF_WEAK(svc_getreq_poll); void svc_getreq_common(int fd) @@ -614,3 +624,4 @@ svc_getreq_common(int fd) } } while (stat == XPRT_MOREREQS); } +DEF_WEAK(svc_getreq_common); diff --git a/lib/libc/rpc/svc_auth.c b/lib/libc/rpc/svc_auth.c index 4ff84636ae8..67ab5df1878 100644 --- a/lib/libc/rpc/svc_auth.c +++ b/lib/libc/rpc/svc_auth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svc_auth.c,v 1.8 2010/09/01 14:43:34 millert Exp $ */ +/* $OpenBSD: svc_auth.c,v 1.9 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -55,10 +55,7 @@ /* no authentication */ enum auth_stat _svcauth_null(void); -/* unix style (uid, gids) */ -enum auth_stat _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg); -/* short hand unix style */ -enum auth_stat _svcauth_short(struct svc_req *rqst, struct rpc_msg *msg); +PROTO_NORMAL(_svcauth_null); static struct { enum auth_stat (*authenticator)(); @@ -112,3 +109,4 @@ _svcauth_null(void) return (AUTH_OK); } +DEF_STRONG(_svcauth_null); diff --git a/lib/libc/rpc/svc_auth_unix.c b/lib/libc/rpc/svc_auth_unix.c index ad9efa78b51..0bcec6365ef 100644 --- a/lib/libc/rpc/svc_auth_unix.c +++ b/lib/libc/rpc/svc_auth_unix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svc_auth_unix.c,v 1.11 2015/09/02 02:52:26 deraadt Exp $ */ +/* $OpenBSD: svc_auth_unix.c,v 1.12 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -113,6 +113,7 @@ done: XDR_DESTROY(&xdrs); return (stat); } +DEF_STRONG(_svcauth_unix); /* @@ -125,3 +126,4 @@ _svcauth_short(struct svc_req *rqst, struct rpc_msg *msg) { return (AUTH_REJECTEDCRED); } +DEF_STRONG(_svcauth_short); diff --git a/lib/libc/rpc/svc_tcp.c b/lib/libc/rpc/svc_tcp.c index d0ee4b019c1..5cec3834d2c 100644 --- a/lib/libc/rpc/svc_tcp.c +++ b/lib/libc/rpc/svc_tcp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svc_tcp.c,v 1.35 2015/09/01 19:54:01 deraadt Exp $ */ +/* $OpenBSD: svc_tcp.c,v 1.36 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -181,6 +181,7 @@ svctcp_create(int sock, u_int sendsize, u_int recvsize) } return (xprt); } +DEF_WEAK(svctcp_create); /* * Like svtcp_create(), except the routine takes any *open* UNIX file diff --git a/lib/libc/rpc/svc_udp.c b/lib/libc/rpc/svc_udp.c index b494d92c057..a1ca7e3acfa 100644 --- a/lib/libc/rpc/svc_udp.c +++ b/lib/libc/rpc/svc_udp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svc_udp.c,v 1.23 2015/09/01 19:54:01 deraadt Exp $ */ +/* $OpenBSD: svc_udp.c,v 1.24 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -159,6 +159,7 @@ svcudp_bufcreate(int sock, u_int sendsz, u_int recvsz) } return (xprt); } +DEF_WEAK(svcudp_bufcreate); SVCXPRT * svcudp_create(int sock) @@ -166,6 +167,7 @@ svcudp_create(int sock) return(svcudp_bufcreate(sock, UDPMSGSIZE, UDPMSGSIZE)); } +DEF_WEAK(svcudp_create); /* ARGSUSED */ static enum xprt_stat diff --git a/lib/libc/rpc/xdr.c b/lib/libc/rpc/xdr.c index dfc7a554845..95e60711059 100644 --- a/lib/libc/rpc/xdr.c +++ b/lib/libc/rpc/xdr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr.c,v 1.13 2015/09/01 19:54:01 deraadt Exp $ */ +/* $OpenBSD: xdr.c,v 1.14 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -70,6 +70,7 @@ xdr_free(xdrproc_t proc, char *objp) x.x_op = XDR_FREE; (*proc)(&x, objp); } +DEF_WEAK(xdr_free); /* * XDR nothing @@ -82,6 +83,7 @@ xdr_void(void) return (TRUE); } +DEF_WEAK(xdr_void); /* @@ -110,6 +112,7 @@ xdr_int(XDR *xdrs, int *ip) } return (FALSE); } +DEF_WEAK(xdr_int); /* * XDR unsigned integers @@ -137,6 +140,7 @@ xdr_u_int(XDR *xdrs, u_int *up) } return (FALSE); } +DEF_WEAK(xdr_u_int); /* @@ -157,6 +161,7 @@ xdr_long(XDR *xdrs, long int *lp) return (FALSE); } +DEF_WEAK(xdr_long); /* * XDR unsigned long integers @@ -175,6 +180,7 @@ xdr_u_long(XDR *xdrs, u_long *ulp) } return (FALSE); } +DEF_WEAK(xdr_u_long); /* @@ -232,6 +238,7 @@ xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p) } return (FALSE); } +DEF_WEAK(xdr_u_int32_t); /* @@ -260,6 +267,7 @@ xdr_short(XDR *xdrs, short int *sp) } return (FALSE); } +DEF_WEAK(xdr_short); /* * XDR unsigned short integers @@ -287,6 +295,7 @@ xdr_u_short(XDR *xdrs, u_short *usp) } return (FALSE); } +DEF_WEAK(xdr_u_short); /* @@ -402,6 +411,7 @@ xdr_bool(XDR *xdrs, int32_t *bp) } return (FALSE); } +DEF_WEAK(xdr_bool); /* * XDR enumerations @@ -424,6 +434,7 @@ xdr_enum(XDR *xdrs, int32_t *ep) return (FALSE); } } +DEF_WEAK(xdr_enum); /* * XDR opaque data @@ -473,6 +484,7 @@ xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt) return (FALSE); } +DEF_WEAK(xdr_opaque); /* * XDR counted bytes @@ -524,6 +536,7 @@ xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize) } return (FALSE); } +DEF_WEAK(xdr_bytes); /* * Implemented here due to commonality of the object. @@ -578,6 +591,7 @@ xdr_union(XDR *xdrs, return ((dfault == NULL) ? FALSE : (*dfault)(xdrs, unp)); } +DEF_WEAK(xdr_union); /* @@ -648,6 +662,7 @@ xdr_string(XDR *xdrs, char **cpp, u_int maxsize) } return (FALSE); } +DEF_WEAK(xdr_string); /* * Wrapper for xdr_string that can be called directly from diff --git a/lib/libc/rpc/xdr_array.c b/lib/libc/rpc/xdr_array.c index f24847e07d8..7eee6c8ad93 100644 --- a/lib/libc/rpc/xdr_array.c +++ b/lib/libc/rpc/xdr_array.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_array.c,v 1.11 2015/09/01 19:54:01 deraadt Exp $ */ +/* $OpenBSD: xdr_array.c,v 1.12 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -112,6 +112,7 @@ xdr_array(XDR *xdrs, } return (stat); } +DEF_WEAK(xdr_array); /* * xdr_vector(): diff --git a/lib/libc/rpc/xdr_mem.c b/lib/libc/rpc/xdr_mem.c index 4bda429f845..cbb311d8b4a 100644 --- a/lib/libc/rpc/xdr_mem.c +++ b/lib/libc/rpc/xdr_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_mem.c,v 1.15 2010/09/01 14:43:34 millert Exp $ */ +/* $OpenBSD: xdr_mem.c,v 1.16 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -97,6 +97,7 @@ xdrmem_create(XDR *xdrs, caddr_t addr, u_int size, enum xdr_op op) xdrs->x_private = xdrs->x_base = addr; xdrs->x_handy = size; } +DEF_WEAK(xdrmem_create); /*ARGSUSED*/ static void diff --git a/lib/libc/rpc/xdr_rec.c b/lib/libc/rpc/xdr_rec.c index 8f0b0d21dd7..c9216ffa192 100644 --- a/lib/libc/rpc/xdr_rec.c +++ b/lib/libc/rpc/xdr_rec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_rec.c,v 1.19 2015/09/11 13:34:41 guenther Exp $ */ +/* $OpenBSD: xdr_rec.c,v 1.20 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -69,6 +69,15 @@ static bool_t xdrrec_setpos(XDR *, u_int); static int32_t *xdrrec_inline(XDR *, u_int); static void xdrrec_destroy(XDR *); +/* + * Not clear if these are used externally + */ +bool_t __xdrrec_setnonblock(XDR *, int); +PROTO_STD_DEPRECATED(__xdrrec_setnonblock); + +bool_t __xdrrec_getrec(XDR *xdrs, enum xprt_stat *statp, bool_t expectdata); +PROTO_NORMAL(__xdrrec_getrec); + struct ct_data; static struct xdr_ops xdrrec_ops = { @@ -206,6 +215,7 @@ xdrrec_create(XDR *xdrs, u_int sendsize, u_int recvsize, caddr_t tcp_handle, rstrm->in_reclen = 0; rstrm->in_received = 0; } +DEF_WEAK(xdrrec_create); /* @@ -407,8 +417,6 @@ xdrrec_destroy(XDR *xdrs) mem_free(rstrm, sizeof(RECSTREAM)); } -bool_t __xdrrec_getrec(XDR *xdrs, enum xprt_stat *statp, bool_t expectdata); - /* * Exported routines to manage xdr records */ @@ -445,6 +453,7 @@ xdrrec_skiprecord(XDR *xdrs) rstrm->last_frag = FALSE; return (TRUE); } +DEF_WEAK(xdrrec_skiprecord); /* * Look ahead fuction. @@ -467,6 +476,7 @@ xdrrec_eof(XDR *xdrs) return (TRUE); return (FALSE); } +DEF_WEAK(xdrrec_eof); /* * The client must tell the package when an end-of-record has occurred. @@ -493,6 +503,7 @@ xdrrec_endofrecord(XDR *xdrs, int32_t sendnow) rstrm->out_finger += sizeof(u_int32_t); return (TRUE); } +DEF_WEAK(xdrrec_endofrecord); /* * Fill the stream buffer with a record for a non-blocking connection. @@ -571,6 +582,7 @@ __xdrrec_getrec(XDR *xdrs, enum xprt_stat *statp, bool_t expectdata) *statp = XPRT_MOREREQS; return (FALSE); } +DEF_WEAK(__xdrrec_getrec); bool_t __xdrrec_setnonblock(XDR *xdrs, int maxrec) diff --git a/lib/libc/rpc/xdr_reference.c b/lib/libc/rpc/xdr_reference.c index a5f7594bbc9..2e604281647 100644 --- a/lib/libc/rpc/xdr_reference.c +++ b/lib/libc/rpc/xdr_reference.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_reference.c,v 1.10 2015/09/01 19:54:01 deraadt Exp $ */ +/* $OpenBSD: xdr_reference.c,v 1.11 2015/09/13 15:36:56 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -82,6 +82,7 @@ xdr_reference(XDR *xdrs, } return (stat); } +DEF_WEAK(xdr_reference); /* @@ -119,3 +120,4 @@ xdr_pointer(XDR *xdrs, char **objpp, u_int obj_size, xdrproc_t xdr_obj) } return (xdr_reference(xdrs,objpp,obj_size,xdr_obj)); } +DEF_WEAK(xdr_pointer); |