Include shlib-compat.h in many sunrpc/nis source files.

Every file that uses libc_hidden_nolink_sunrpc or
libnsl_hidden_nolink_def needs to include shlib-compat.h.  Currently,
most of them are getting it via stdio.h, because libio.h refers to
SHLIB_COMPAT when _LIBC is defined, so it includes shlib-compat.h.  My
experimental patch to not install libio.h breaks that chain; stdio.h
no longer pulls in libio.h even for internal users.

Accordingly, this patch adds #include <shlib-compat.h> to many files
in sunrpc/ and nis/.  There are also a small number of really obvious
fixups to includes that caught my eye while proofreading the patch -
not including headers twice in a row, not worrying about portability
to Ultrix anymore, sort of thing.

	* nis/nis_add.c, nis/nis_addmember.c, nis/nis_call.c
	* nis/nis_checkpoint.c, nis/nis_clone_dir.c, nis/nis_clone_obj.c
	* nis/nis_clone_res.c, nis/nis_creategroup.c, nis/nis_defaults.c
	* nis/nis_destroygroup.c, nis/nis_domain_of.c
	* nis/nis_domain_of_r.c, nis/nis_error.c, nis/nis_file.c
	* nis/nis_free.c, nis/nis_getservlist.c, nis/nis_ismember.c
	* nis/nis_local_names.c, nis/nis_lookup.c, nis/nis_mkdir.c
	* nis/nis_modify.c, nis/nis_ping.c, nis/nis_print.c
	* nis/nis_print_group_entry.c, nis/nis_remove.c
	* nis/nis_removemember.c, nis/nis_rmdir.c, nis/nis_server.c
	* nis/nis_subr.c, nis/nis_table.c, nis/nis_util.c
	* nis/nis_verifygroup.c, nis/nis_xdr.c, nis/yp_xdr.c
	* nis/ypclnt.c, nis/ypupdate_xdr.c, sunrpc/auth_des.c
	* sunrpc/auth_none.c, sunrpc/auth_unix.c, sunrpc/authdes_prot.c
	* sunrpc/authuxprot.c, sunrpc/clnt_gen.c, sunrpc/clnt_perr.c
	* sunrpc/clnt_raw.c, sunrpc/clnt_simp.c, sunrpc/clnt_tcp.c
	* sunrpc/clnt_udp.c, sunrpc/clnt_unix.c, sunrpc/des_crypt.c
	* sunrpc/des_soft.c, sunrpc/get_myaddr.c, sunrpc/key_call.c
	* sunrpc/key_prot.c, sunrpc/netname.c, sunrpc/pm_getmaps.c
	* sunrpc/pm_getport.c, sunrpc/pmap_clnt.c, sunrpc/pmap_prot.c
	* sunrpc/pmap_prot2.c, sunrpc/pmap_rmt.c, sunrpc/publickey.c
	* sunrpc/rpc_cmsg.c, sunrpc/rpc_dtable.c, sunrpc/rpc_prot.c
	* sunrpc/rpc_thread.c, sunrpc/rtime.c, sunrpc/svc.c
	* sunrpc/svc_auth.c, sunrpc/svc_raw.c, sunrpc/svc_run.c
	* sunrpc/svc_tcp.c, sunrpc/svc_udp.c, sunrpc/svc_unix.c
	* sunrpc/svcauth_des.c, sunrpc/xdr.c, sunrpc/xdr_array.c
	* sunrpc/xdr_float.c, sunrpc/xdr_intXX_t.c, sunrpc/xdr_mem.c
	* sunrpc/xdr_rec.c, sunrpc/xdr_ref.c, sunrpc/xdr_sizeof.c
	* sunrpc/xdr_stdio.c: Include shlib-compat.h.

	* sunrpc/des_crypt.c, sunrpc/des_soft.c: No need to include
	abi-versions.h as well as shlib-compat.h.
	* sunrpc/get_myaddr.c: Remove obsolete comment.
	* sunrpc/pmap_rmt.c: Remove obsolete comment and #undef.
	* sunrpc/rpc_thread.c: Include libc-lock.h only once.
	* resolv/res_libc.c: Include shlib-compat.h only once.
This commit is contained in:
Zack Weinberg 2017-06-04 11:14:43 -04:00
parent 363911ce13
commit 82f43dd2d1
84 changed files with 89 additions and 10 deletions

View File

@ -18,6 +18,7 @@
#include <string.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#include "nis_xdr.h"
#include "nis_intern.h"

View File

@ -19,6 +19,7 @@
#include <assert.h>
#include <string.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
nis_error
nis_addmember (const_nis_name member, const_nis_name group)

View File

@ -33,6 +33,7 @@
#include "nis_xdr.h"
#include "nis_intern.h"
#include <libnsl.h>
#include <shlib-compat.h>
static const struct timeval RPCTIMEOUT = {10, 0};
static const struct timeval UDPTIMEOUT = {5, 0};

View File

@ -18,6 +18,7 @@
#include <string.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#include "nis_xdr.h"
#include "nis_intern.h"

View File

@ -19,6 +19,7 @@
#include <string.h>
#include <rpc/rpc.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#include "nis_xdr.h"

View File

@ -19,6 +19,7 @@
#include <string.h>
#include <rpc/rpc.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#include "nis_xdr.h"

View File

@ -19,6 +19,7 @@
#include <string.h>
#include <rpc/rpc.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#include "nis_xdr.h"

View File

@ -19,6 +19,7 @@
#include <time.h>
#include <string.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
nis_error
nis_creategroup (const_nis_name group, unsigned int flags)

View File

@ -24,6 +24,7 @@
#include <sys/types.h>
#include <rpc/rpc.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#define DEFAULT_TTL 43200

View File

@ -18,6 +18,7 @@
#include <string.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
nis_error
nis_destroygroup (const_nis_name group)

View File

@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
nis_name
nis_domain_of (const_nis_name name)

View File

@ -19,6 +19,7 @@
#include <errno.h>
#include <string.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
nis_name
nis_domain_of_r (const_nis_name name, char *buffer, size_t buflen)

View File

@ -21,6 +21,7 @@
#include <string.h>
#include <libintl.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#define MF(line) MF1 (line)

View File

@ -20,6 +20,7 @@
#include <stdlib.h>
#include <string.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#include "nis_xdr.h"
typedef bool_t (*iofct_t) (XDR *, void *);

View File

@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#include "nis_xdr.h"
void

View File

@ -18,6 +18,7 @@
#include <string.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#include "nis_xdr.h"
#include "nis_intern.h"

View File

@ -18,6 +18,7 @@
#include <string.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
/* internal_nis_ismember ()
return codes: -1 principal is in -group

View File

@ -21,6 +21,7 @@
#include <unistd.h>
#include <libintl.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
nis_name
nis_local_group (void)

View File

@ -21,6 +21,7 @@
#include "nis_xdr.h"
#include "nis_intern.h"
#include <libnsl.h>
#include <shlib-compat.h>
nis_result *

View File

@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#include "nis_xdr.h"
#include "nis_intern.h"

View File

@ -18,6 +18,7 @@
#include <string.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#include "nis_xdr.h"
#include "nis_intern.h"

View File

@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#include "nis_xdr.h"
#include "nis_intern.h"

View File

@ -22,6 +22,7 @@
#include <stdint.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
static const char *
nis_nstype2str (const nstype type)

View File

@ -20,6 +20,7 @@
#include <string.h>
#include <libintl.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
void
nis_print_group_entry (const_nis_name group)

View File

@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#include "nis_xdr.h"
#include "nis_intern.h"

View File

@ -19,6 +19,7 @@
#include <assert.h>
#include <string.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
nis_error
nis_removemember (const_nis_name member, const_nis_name group)

View File

@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#include "nis_xdr.h"
#include "nis_intern.h"

View File

@ -18,6 +18,7 @@
#include <string.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#include "nis_xdr.h"
#include "nis_intern.h"

View File

@ -19,6 +19,7 @@
#include <errno.h>
#include <string.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
nis_name
nis_leaf_of (const_nis_name name)

View File

@ -20,6 +20,7 @@
#include <string.h>
#include <rpcsvc/nis.h>
#include <libc-diag.h>
#include <shlib-compat.h>
#include "nis_xdr.h"
#include "nis_intern.h"

View File

@ -18,6 +18,7 @@
#include <string.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
#include "nis_xdr.h"
#include "nis_intern.h"

View File

@ -18,6 +18,7 @@
#include <string.h>
#include <rpcsvc/nis.h>
#include <shlib-compat.h>
nis_error
nis_verifygroup (const_nis_name group)

View File

@ -19,6 +19,7 @@
#include <stdint.h>
#include <rpcsvc/nis.h>
#include <rpcsvc/nis_callback.h> /* for "official" Solaris xdr functions */
#include <shlib-compat.h>
/* This functions do exist without beginning "_" under Solaris 2.x, but
we have no prototypes for them. To avoid the same problems as with the

View File

@ -31,6 +31,7 @@
#include <rpcsvc/yp.h>
#include <rpcsvc/ypclnt.h>
#include <shlib-compat.h>
/* The NIS v2 protocol suggests 1024 bytes as a maximum length of all fields.
Current Linux systems don't use this limit. To remain compatible with

View File

@ -29,6 +29,7 @@
#include <sys/socket.h>
#include <sys/uio.h>
#include <libc-lock.h>
#include <shlib-compat.h>
/* This should only be defined on systems with a BSD compatible ypbind */
#ifndef BINDINGDIR

View File

@ -30,6 +30,7 @@
*/
#include <rpcsvc/ypupd.h>
#include <shlib-compat.h>
bool_t
xdr_yp_buf (XDR *xdrs, yp_buf *objp)

View File

@ -127,15 +127,14 @@ __thread struct __res_state *__resp = &_res;
extern __thread struct __res_state *__libc_resp
__attribute__ ((alias ("__resp"))) attribute_hidden;
#include <shlib-compat.h>
/* We declare this with compat_symbol so that it's not
visible at link time. Programs must use the accessor functions. */
#ifdef SHARED
# include <shlib-compat.h>
compat_symbol (libc, _res, _res, GLIBC_2_0);
#endif
#include <shlib-compat.h>
#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2)
# undef res_init
extern int __res_init_weak (void);

View File

@ -41,6 +41,7 @@
#include <rpc/xdr.h>
#include <netinet/in.h> /* XXX: just to get htonl() and ntohl() */
#include <sys/socket.h>
#include <shlib-compat.h>
#define MILLION 1000000L
#define RTIME_TIMEOUT 5 /* seconds to wait for sync */

View File

@ -36,6 +36,7 @@
#include <rpc/rpc.h>
#include <libc-lock.h>
#include <shlib-compat.h>
#define MAX_MARSHAL_SIZE 20

View File

@ -46,6 +46,7 @@
#include <libintl.h>
#include <sys/param.h>
#include <wchar.h>
#include <shlib-compat.h>
#include <rpc/types.h>
#include <rpc/xdr.h>

View File

@ -36,6 +36,7 @@
#include <rpc/xdr.h>
#include <rpc/auth.h>
#include <rpc/auth_des.h>
#include <shlib-compat.h>
#define ATTEMPT(xdr_op) if (!(xdr_op)) return (FALSE)

View File

@ -37,6 +37,7 @@
#include <rpc/xdr.h>
#include <rpc/auth.h>
#include <rpc/auth_unix.h>
#include <shlib-compat.h>
/*
* XDR for unix authentication parameters.

View File

@ -35,6 +35,7 @@
#include <rpc/rpc.h>
#include <sys/socket.h>
#include <netdb.h>
#include <shlib-compat.h>
/*
* Generic client creation: takes (hostname, program-number, protocol) and

View File

@ -36,6 +36,7 @@
#include <rpc/rpc.h>
#include <wchar.h>
#include <libio/iolibio.h>
#include <shlib-compat.h>
static char *auth_errmsg (enum auth_stat stat) internal_function;

View File

@ -40,6 +40,7 @@
#include <rpc/svc.h>
#include <rpc/xdr.h>
#include <libintl.h>
#include <shlib-compat.h>
#define MCALL_MSG_SIZE 24

View File

@ -40,6 +40,7 @@
#include <sys/socket.h>
#include <netdb.h>
#include <string.h>
#include <shlib-compat.h>
struct callrpc_private_s
{

View File

@ -54,6 +54,7 @@
#include <sys/socket.h>
#include <rpc/pmap_clnt.h>
#include <wchar.h>
#include <shlib-compat.h>
extern u_long _create_xid (void);

View File

@ -56,6 +56,7 @@
#include <kernel-features.h>
#include <inet/net-internal.h>
#include <shlib-compat.h>
extern u_long _create_xid (void);

View File

@ -55,6 +55,7 @@
#include <sys/socket.h>
#include <rpc/pmap_clnt.h>
#include <wchar.h>
#include <shlib-compat.h>
extern u_long _create_xid (void);

View File

@ -32,7 +32,7 @@
#include <sys/types.h>
#include <rpc/des_crypt.h>
#include <abi-versions.h>
#include <shlib-compat.h>
#include "des.h"
extern int _des_crypt (char *, unsigned, struct desparams *);

View File

@ -32,7 +32,8 @@ static char sccsid[] = "@(#)des_soft.c 2.2 88/08/10 4.0 RPCSRC; from 1.13 88/02/
*/
#include <rpc/des_crypt.h>
#include <abi-versions.h>
#include <shlib-compat.h>
/*
* Table giving odd parity in the low bit for ASCII characters
*/

View File

@ -42,9 +42,9 @@
#include <net/if.h>
#include <ifaddrs.h>
#include <sys/ioctl.h>
/* Order of following two #includes reversed by roland@gnu */
#include <netinet/in.h>
#include <arpa/inet.h>
#include <shlib-compat.h>
/*
* don't use gethostbyname, which would invoke yellow pages

View File

@ -49,6 +49,7 @@
#include <sys/socket.h>
#include <rpc/key_prot.h>
#include <libc-lock.h>
#include <shlib-compat.h>
#define KEY_TIMEOUT 5 /* per-try timeout in seconds */
#define KEY_NRETRY 12 /* number of retries */

View File

@ -29,6 +29,7 @@
*/
#include <rpc/key_prot.h>
#include <shlib-compat.h>
bool_t
xdr_keystatus (XDR * xdrs, keystatus * objp)

View File

@ -20,6 +20,7 @@
#include <unistd.h>
#include <string.h>
#include <rpc/rpc.h>
#include <shlib-compat.h>
#include "nsswitch.h"

View File

@ -44,6 +44,7 @@
#include <libintl.h>
#include <unistd.h>
#include <not-cancel.h>
#include <shlib-compat.h>
/*

View File

@ -38,6 +38,7 @@
#include <rpc/pmap_prot.h>
#include <rpc/pmap_clnt.h>
#include <sys/socket.h>
#include <shlib-compat.h>
/*
* Create a socket that is locally bound to a non-reserve port. For

View File

@ -45,6 +45,7 @@
#include <rpc/rpc.h>
#include <rpc/pmap_prot.h>
#include <rpc/pmap_clnt.h>
#include <shlib-compat.h>
/*
* Same as get_myaddress, but we try to use the loopback

View File

@ -35,6 +35,7 @@
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/pmap_prot.h>
#include <shlib-compat.h>
bool_t

View File

@ -35,6 +35,7 @@
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/pmap_prot.h>
#include <shlib-compat.h>
/*

View File

@ -44,12 +44,13 @@
#include <sys/socket.h>
#include <stdio.h>
#include <errno.h>
#undef _POSIX_SOURCE /* Ultrix <sys/param.h> needs --roland@gnu */
#include <sys/param.h> /* Ultrix needs before net/if --roland@gnu */
#include <sys/param.h>
#include <net/if.h>
#include <ifaddrs.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
#include <shlib-compat.h>
#define MAX_BROADCAST_SIZE 1400
extern u_long _create_xid (void);

View File

@ -20,6 +20,7 @@
#include <errno.h>
#include <rpc/netdb.h>
#include <rpc/auth_des.h>
#include <shlib-compat.h>
#include "nsswitch.h"

View File

@ -34,6 +34,7 @@
#include <string.h>
#include <sys/param.h>
#include <rpc/rpc.h>
#include <shlib-compat.h>
/*
* XDR a call message

View File

@ -31,6 +31,7 @@
#include <unistd.h>
#include <rpc/clnt.h>
#include <shlib-compat.h>
/*
* Cache the result of getdtablesize(), so we don't have to do an

View File

@ -39,8 +39,8 @@
*/
#include <sys/param.h>
#include <rpc/rpc.h>
#include <shlib-compat.h>
/* * * * * * * * * * * * * * XDR Authentication * * * * * * * * * * * */

View File

@ -1,10 +1,10 @@
#include <stdio.h>
#include <libc-lock.h>
#include <rpc/rpc.h>
#include <assert.h>
#include <libc-lock.h>
#include <libc-tsd.h>
#include <shlib-compat.h>
#ifdef _RPC_THREAD_SAFE_

View File

@ -49,6 +49,7 @@
#include <rpc/auth_des.h>
#include <errno.h>
#include <netinet/in.h>
#include <shlib-compat.h>
#define NYEARS (u_long)(1970 - 1900)
#define TOFFSET (u_long)(60*60*24*(365*NYEARS + (NYEARS/4)))

View File

@ -59,6 +59,7 @@
#include <rpc/pmap_clnt.h>
#include <sys/poll.h>
#include <time.h>
#include <shlib-compat.h>
#ifdef _RPC_THREAD_SAFE_
#define xports RPC_THREAD_VARIABLE(svc_xports_s)

View File

@ -34,6 +34,7 @@
#include <rpc/rpc.h>
#include <rpc/svc.h>
#include <rpc/svc_auth.h>
#include <shlib-compat.h>
/*
* svcauthsw is the bdevsw of server side authentication.

View File

@ -36,6 +36,7 @@
#include <rpc/rpc.h>
#include <rpc/svc.h>
#include <shlib-compat.h>
/*
* This is the "network" that we will be moving data over

View File

@ -36,6 +36,7 @@
#include <libintl.h>
#include <sys/poll.h>
#include <rpc/rpc.h>
#include <shlib-compat.h>
/* This function can be used as a signal handler to terminate the
server loop. */

View File

@ -64,6 +64,7 @@
#include <wchar.h>
#include <libio/iolibio.h>
#include <shlib-compat.h>
/*
* Ops vector for TCP/IP based rpc service handle

View File

@ -64,6 +64,7 @@
#include <wchar.h>
#include <libio/iolibio.h>
#include <shlib-compat.h>
#define rpc_buffer(xprt) ((xprt)->xp_p1)
#ifndef MAX

View File

@ -64,6 +64,7 @@
#include <stdlib.h>
#include <libintl.h>
#include <wchar.h>
#include <shlib-compat.h>
/*
* Ops vector for AF_UNIX based rpc service handle

View File

@ -53,6 +53,7 @@
#include <rpc/svc_auth.h>
#include <rpc/svc.h>
#include <rpc/des_crypt.h>
#include <shlib-compat.h>
#define debug(msg) /*printf("svcauth_des: %s\n", msg) */

View File

@ -44,6 +44,7 @@
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <shlib-compat.h>
/*

View File

@ -41,6 +41,7 @@
#include <libintl.h>
#include <limits.h>
#include <wchar.h>
#include <shlib-compat.h>
#define LASTUNSIGNED ((u_int)0-1)

View File

@ -40,6 +40,7 @@
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <shlib-compat.h>
/*
* NB: Not portable.

View File

@ -22,6 +22,7 @@
#include <rpc/xdr.h>
#include <stdint.h>
#include <shlib-compat.h>
/* XDR 64bit integers */
bool_t

View File

@ -38,6 +38,7 @@
#include <string.h>
#include <limits.h>
#include <rpc/rpc.h>
#include <shlib-compat.h>
static bool_t xdrmem_getlong (XDR *, long *);
static bool_t xdrmem_putlong (XDR *, const long *);

View File

@ -50,6 +50,7 @@
#include <libintl.h>
#include <wchar.h>
#include <libio/iolibio.h>
#include <shlib-compat.h>
static bool_t xdrrec_getlong (XDR *, long *);
static bool_t xdrrec_putlong (XDR *, const long *);

View File

@ -41,6 +41,7 @@
#include <libintl.h>
#include <wchar.h>
#include <libio/iolibio.h>
#include <shlib-compat.h>
#define LASTUNSIGNED ((u_int)0-1)

View File

@ -38,6 +38,7 @@
#include <rpc/xdr.h>
#include <sys/types.h>
#include <stdlib.h>
#include <shlib-compat.h>
/* ARGSUSED */
static bool_t

View File

@ -40,6 +40,8 @@
#include <rpc/xdr.h>
#include <libio/iolibio.h>
#include <shlib-compat.h>
#define fflush(s) _IO_fflush (s)
#define fread(p, m, n, s) _IO_fread (p, m, n, s)
#define ftell(s) _IO_ftell (s)