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 | |
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@
39 files changed, 492 insertions, 89 deletions
diff --git a/include/rpc/svc.h b/include/rpc/svc.h index 5d68723ee06..93157f5cd25 100644 --- a/include/rpc/svc.h +++ b/include/rpc/svc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: svc.h,v 1.13 2014/10/29 04:34:21 guenther Exp $ */ +/* $OpenBSD: svc.h,v 1.14 2015/09/13 15:36:57 guenther Exp $ */ /* $NetBSD: svc.h,v 1.9 1995/04/29 05:28:01 cgd Exp $ */ /* @@ -193,7 +193,6 @@ __END_DECLS */ __BEGIN_DECLS extern void xprt_register(SVCXPRT *); -extern int __xprt_register(SVCXPRT *); __END_DECLS /* diff --git a/include/rpc/svc_auth.h b/include/rpc/svc_auth.h index b1790408799..cc6b56de367 100644 --- a/include/rpc/svc_auth.h +++ b/include/rpc/svc_auth.h @@ -1,52 +1 @@ -/* $OpenBSD: svc_auth.h,v 1.4 2010/09/01 14:43:34 millert Exp $ */ -/* $NetBSD: svc_auth.h,v 1.4 1994/10/26 00:57:07 cgd Exp $ */ - -/* - * Copyright (c) 2010, Oracle America, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * * Neither the name of the "Oracle America, Inc." nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * from: @(#)svc_auth.h 1.6 86/07/16 SMI - * @(#)svc_auth.h 2.1 88/07/29 4.0 RPCSRC - */ - -/* - * svc_auth.h, Service side of rpc authentication. - */ - -#ifndef _RPC_SVCAUTH_H -#define _RPC_SVCAUTH_H - -/* - * Server side authenticator - */ -__BEGIN_DECLS -extern enum auth_stat _authenticate(struct svc_req *, struct rpc_msg *); -__END_DECLS - -#endif /* !_RPC_SVCAUTH_H */ +/* this file intentionally left blank */ diff --git a/lib/libc/Symbols.list b/lib/libc/Symbols.list index 1a8fbee6b27..de0ca20999f 100644 --- a/lib/libc/Symbols.list +++ b/lib/libc/Symbols.list @@ -1180,8 +1180,6 @@ __svc_fdset __svc_fdsetsize __xdrrec_getrec __xdrrec_setnonblock -__xprt_register -_authenticate _null_auth _seterr_reply _svcauth_null diff --git a/lib/libc/hidden/rpc/auth.h b/lib/libc/hidden/rpc/auth.h new file mode 100644 index 00000000000..b6ad32b0285 --- /dev/null +++ b/lib/libc/hidden/rpc/auth.h @@ -0,0 +1,29 @@ +/* $OpenBSD: auth.h,v 1.1 2015/09/13 15:36:56 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_RPC_AUTH_H +#define _LIBC_RPC_AUTH_H + +#include_next <rpc/auth.h> + +PROTO_NORMAL(authnone_create); +PROTO_NORMAL(authunix_create); +PROTO_NORMAL(authunix_create_default); +PROTO_DEPRECATED(set_rpc_maxgrouplist); +PROTO_DEPRECATED(xdr_des_block); + +#endif /* !_LIBC_RPC_AUTH_H */ diff --git a/lib/libc/hidden/rpc/auth_unix.h b/lib/libc/hidden/rpc/auth_unix.h new file mode 100644 index 00000000000..46513a548c4 --- /dev/null +++ b/lib/libc/hidden/rpc/auth_unix.h @@ -0,0 +1,25 @@ +/* $OpenBSD: auth_unix.h,v 1.1 2015/09/13 15:36:56 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_RPC_AUTH_UNIX_H +#define _LIBC_RPC_AUTH_UNIX_H + +#include_next <rpc/auth_unix.h> + +PROTO_NORMAL(xdr_authunix_parms); + +#endif /* !_LIBC_RPC_AUTH_UNIX_H */ diff --git a/lib/libc/hidden/rpc/clnt.h b/lib/libc/hidden/rpc/clnt.h new file mode 100644 index 00000000000..96a93ad307c --- /dev/null +++ b/lib/libc/hidden/rpc/clnt.h @@ -0,0 +1,35 @@ +/* $OpenBSD: clnt.h,v 1.1 2015/09/13 15:36:56 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_RPC_CLNT_H_ +#define _LIBC_RPC_CLNT_H_ + +#include_next <rpc/clnt.h> + +PROTO_DEPRECATED(clnt_create); +PROTO_NORMAL(clnt_pcreateerror); +PROTO_DEPRECATED(clnt_perrno); +PROTO_NORMAL(clnt_perror); +PROTO_NORMAL(clnt_spcreateerror); +PROTO_NORMAL(clnt_sperrno); +PROTO_NORMAL(clnt_sperror); +PROTO_DEPRECATED(clntraw_create); +PROTO_NORMAL(clnttcp_create); +PROTO_NORMAL(clntudp_bufcreate); +PROTO_NORMAL(clntudp_create); + +#endif /* !_LIBC_RPC_CLNT_H */ diff --git a/lib/libc/hidden/rpc/pmap_clnt.h b/lib/libc/hidden/rpc/pmap_clnt.h new file mode 100644 index 00000000000..458a4338c5d --- /dev/null +++ b/lib/libc/hidden/rpc/pmap_clnt.h @@ -0,0 +1,30 @@ +/* $OpenBSD: pmap_clnt.h,v 1.1 2015/09/13 15:36:56 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_RPC_PMAPCLNT_H +#define _LIBC_RPC_PMAPCLNT_H + +#include_next <rpc/pmap_clnt.h> + +PROTO_DEPRECATED(clnt_broadcast); +PROTO_DEPRECATED(pmap_getmaps); +PROTO_NORMAL(pmap_getport); +PROTO_DEPRECATED(pmap_rmtcall); +PROTO_NORMAL(pmap_set); +PROTO_NORMAL(pmap_unset); + +#endif /* !_LIBC_RPC_PMAPCLNT_H */ diff --git a/lib/libc/hidden/rpc/pmap_prot.h b/lib/libc/hidden/rpc/pmap_prot.h new file mode 100644 index 00000000000..f0a0a2c963d --- /dev/null +++ b/lib/libc/hidden/rpc/pmap_prot.h @@ -0,0 +1,26 @@ +/* $OpenBSD: pmap_prot.h,v 1.1 2015/09/13 15:36:56 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_RPC_PMAPPROT_H +#define _LIBC_RPC_PMAPPROT_H + +#include_next <rpc/pmap_prot.h> + +PROTO_NORMAL(xdr_pmap); +PROTO_NORMAL(xdr_pmaplist); + +#endif /* !_LIBC_RPC_PMAPPROT_H */ diff --git a/lib/libc/hidden/rpc/pmap_rmt.h b/lib/libc/hidden/rpc/pmap_rmt.h new file mode 100644 index 00000000000..2b7b0e34b36 --- /dev/null +++ b/lib/libc/hidden/rpc/pmap_rmt.h @@ -0,0 +1,26 @@ +/* $OpenBSD: pmap_rmt.h,v 1.1 2015/09/13 15:36:56 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_RPC_PMAPRMT_H +#define _LIBC_RPC_PMAPRMT_H + +#include_next <rpc/pmap_rmt.h> + +PROTO_NORMAL(xdr_rmtcall_args); +PROTO_NORMAL(xdr_rmtcallres); + +#endif /* !_LIBC_RPC_PMAPRMT_H */ diff --git a/lib/libc/hidden/rpc/rpc.h b/lib/libc/hidden/rpc/rpc.h new file mode 100644 index 00000000000..2c2d1abebda --- /dev/null +++ b/lib/libc/hidden/rpc/rpc.h @@ -0,0 +1,34 @@ +/* $OpenBSD: rpc.h,v 1.1 2015/09/13 15:36:56 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_RPC_RPC_H +#define _LIBC_RPC_RPC_H + +#include_next <rpc/rpc.h> + +PROTO_DEPRECATED(callrpc); +PROTO_NORMAL(endrpcent); +PROTO_NORMAL(get_myaddress); +PROTO_DEPRECATED(getrpcbyname); +PROTO_DEPRECATED(getrpcbynumber); +PROTO_NORMAL(getrpcent); +PROTO_DEPRECATED(getrpcport); +PROTO_DEPRECATED(registerrpc); +PROTO_NORMAL(setrpcent); +PROTO_NORMAL(xdr_opaque_auth); + +#endif /* !_LIBC_RPC_RPC_H */ diff --git a/lib/libc/hidden/rpc/rpc_msg.h b/lib/libc/hidden/rpc/rpc_msg.h new file mode 100644 index 00000000000..e7a19535114 --- /dev/null +++ b/lib/libc/hidden/rpc/rpc_msg.h @@ -0,0 +1,30 @@ +/* $OpenBSD: rpc_msg.h,v 1.1 2015/09/13 15:36:56 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_RPC_RPCMSG_H +#define _LIBC_RPC_RPCMSG_H + +#include_next <rpc/rpc_msg.h> + +PROTO_NORMAL(_seterr_reply); +PROTO_NORMAL(xdr_callhdr); +PROTO_NORMAL(xdr_callmsg); +PROTO_NORMAL(xdr_accepted_reply); +PROTO_NORMAL(xdr_rejected_reply); +PROTO_NORMAL(xdr_replymsg); + +#endif /* !_LIBC_RPC_RPCMSG_H */ diff --git a/lib/libc/hidden/rpc/svc.h b/lib/libc/hidden/rpc/svc.h new file mode 100644 index 00000000000..95ae46a27eb --- /dev/null +++ b/lib/libc/hidden/rpc/svc.h @@ -0,0 +1,52 @@ +/* $OpenBSD: svc.h,v 1.1 2015/09/13 15:36:56 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_RPC_SVC_H +#define _LIBC_RPC_SVC_H + +#include_next <rpc/svc.h> + +__BEGIN_HIDDEN_DECLS +int __xprt_register(SVCXPRT *); +__END_HIDDEN_DECLS + +PROTO_NORMAL(svc_getreq); +PROTO_NORMAL(svc_getreq_common); +PROTO_NORMAL(svc_getreq_poll); +PROTO_DEPRECATED(svc_getreqset); +PROTO_NORMAL(svc_getreqset2); +PROTO_NORMAL(svc_register); +PROTO_DEPRECATED(svc_run); +PROTO_NORMAL(svc_sendreply); +PROTO_DEPRECATED(svc_unregister); +PROTO_NORMAL(svcerr_auth); +PROTO_NORMAL(svcerr_decode); +PROTO_DEPRECATED(svcerr_noproc); +PROTO_NORMAL(svcerr_noprog); +PROTO_NORMAL(svcerr_progvers); +PROTO_DEPRECATED(svcerr_systemerr); +PROTO_DEPRECATED(svcerr_weakauth); +PROTO_DEPRECATED(svcfd_create); +PROTO_DEPRECATED(svcraw_create); +PROTO_NORMAL(svctcp_create); +PROTO_NORMAL(svcudp_bufcreate); +PROTO_NORMAL(svcudp_create); +PROTO_DEPRECATED(svcudp_enablecache); +PROTO_DEPRECATED(xprt_register); +PROTO_NORMAL(xprt_unregister); + +#endif /* !_LIBC_RPC_SVC_H */ diff --git a/lib/libc/hidden/rpc/svc_auth.h b/lib/libc/hidden/rpc/svc_auth.h new file mode 100644 index 00000000000..82590775e9c --- /dev/null +++ b/lib/libc/hidden/rpc/svc_auth.h @@ -0,0 +1,35 @@ +/* $OpenBSD: svc_auth.h,v 1.1 2015/09/13 15:36:56 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_RPC_SVCAUTH_H +#define _LIBC_RPC_SVCAUTH_H + +#include_next <rpc/svc_auth.h> + +__BEGIN_HIDDEN_DECLS +enum auth_stat _authenticate(struct svc_req *, struct rpc_msg *); +__END_HIDDEN_DECLS + +__BEGIN_DECLS +enum auth_stat _svcauth_unix(struct svc_req *, struct rpc_msg *); +enum auth_stat _svcauth_short(struct svc_req *, struct rpc_msg *); +__END_DECLS + +PROTO_NORMAL(_svcauth_unix); +PROTO_NORMAL(_svcauth_short); + +#endif /* !_LIBC_RPC_SVCAUTH_H */ diff --git a/lib/libc/hidden/rpc/xdr.h b/lib/libc/hidden/rpc/xdr.h new file mode 100644 index 00000000000..b576b9a5e78 --- /dev/null +++ b/lib/libc/hidden/rpc/xdr.h @@ -0,0 +1,62 @@ +/* $OpenBSD: xdr.h,v 1.1 2015/09/13 15:36:56 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_RPC_XDR_H +#define _LIBC_RPC_XDR_H + +#include_next <rpc/xdr.h> + +PROTO_NORMAL(xdr_array); +PROTO_NORMAL(xdr_bool); +PROTO_NORMAL(xdr_bytes); +PROTO_DEPRECATED(xdr_char); +PROTO_DEPRECATED(xdr_double); +PROTO_NORMAL(xdr_enum); +PROTO_DEPRECATED(xdr_float); +PROTO_NORMAL(xdr_free); +PROTO_NORMAL(xdr_int); +PROTO_DEPRECATED(xdr_int16_t); +PROTO_DEPRECATED(xdr_int32_t); +PROTO_DEPRECATED(xdr_int64_t); +PROTO_NORMAL(xdr_long); +PROTO_DEPRECATED(xdr_netobj); +PROTO_NORMAL(xdr_opaque); +PROTO_NORMAL(xdr_pointer); +PROTO_NORMAL(xdr_reference); +PROTO_NORMAL(xdr_short); +PROTO_NORMAL(xdr_string); +PROTO_DEPRECATED(xdr_u_char); +PROTO_NORMAL(xdr_u_int); +PROTO_DEPRECATED(xdr_u_int16_t); +PROTO_NORMAL(xdr_u_int32_t); +PROTO_DEPRECATED(xdr_u_int64_t); +PROTO_NORMAL(xdr_u_long); +PROTO_NORMAL(xdr_u_short); +PROTO_NORMAL(xdr_union); +PROTO_DEPRECATED(xdr_vector); +PROTO_NORMAL(xdr_void); +PROTO_DEPRECATED(xdr_wrapstring); +PROTO_NORMAL(xdrmem_create); +PROTO_NORMAL(xdrrec_create); +PROTO_NORMAL(xdrrec_endofrecord); +PROTO_NORMAL(xdrrec_eof); +PROTO_NORMAL(xdrrec_skiprecord); +#ifdef _STDIO_H_ +PROTO_DEPRECATED(xdrstdio_create); +#endif + +#endif /* !_LIBC_RPC_XDR_H */ 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); |