diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2022-02-14 03:39:00 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2022-02-14 03:39:00 +0000 |
commit | 492d59e10c6cf446d78efdf7eb89665d70d3247f (patch) | |
tree | cf307e440a4c841033c3249e5cfcc4acd6d4b53c /lib/libc | |
parent | f27b8b57416c30b6f7ebf5d2a5efde4ff11eebb0 (diff) |
Mark all the rpc 'ops' vectors, for auth, client, service, and xdr,
as const, moving them from .data to .data.rel.ro. The other BSDs
did this a long time ago; NetBSD did a chunk in 1998, which is long
enough I didn't bother to get exact dates for others.
ok deraadt@ millert@
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/rpc/auth_none.c | 4 | ||||
-rw-r--r-- | lib/libc/rpc/auth_unix.c | 4 | ||||
-rw-r--r-- | lib/libc/rpc/clnt_raw.c | 4 | ||||
-rw-r--r-- | lib/libc/rpc/clnt_tcp.c | 4 | ||||
-rw-r--r-- | lib/libc/rpc/clnt_udp.c | 4 | ||||
-rw-r--r-- | lib/libc/rpc/svc_raw.c | 4 | ||||
-rw-r--r-- | lib/libc/rpc/svc_tcp.c | 6 | ||||
-rw-r--r-- | lib/libc/rpc/svc_udp.c | 4 | ||||
-rw-r--r-- | lib/libc/rpc/xdr_mem.c | 6 | ||||
-rw-r--r-- | lib/libc/rpc/xdr_rec.c | 4 | ||||
-rw-r--r-- | lib/libc/rpc/xdr_stdio.c | 4 |
11 files changed, 24 insertions, 24 deletions
diff --git a/lib/libc/rpc/auth_none.c b/lib/libc/rpc/auth_none.c index 8ba7b71da27..b9bd8083596 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.14 2015/11/01 03:45:29 guenther Exp $ */ +/* $OpenBSD: auth_none.c,v 1.15 2022/02/14 03:38:59 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -53,7 +53,7 @@ static bool_t authnone_validate(struct __rpc_auth *, struct opaque_auth *); static bool_t authnone_marshal(struct __rpc_auth *, XDR *); static bool_t authnone_refresh(struct __rpc_auth *); -static struct auth_ops ops = { +static const struct auth_ops ops = { authnone_verf, authnone_marshal, authnone_validate, diff --git a/lib/libc/rpc/auth_unix.c b/lib/libc/rpc/auth_unix.c index e1288dc6fc7..32ead395d0f 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.29 2022/01/28 05:54:02 guenther Exp $ */ +/* $OpenBSD: auth_unix.c,v 1.30 2022/02/14 03:38:59 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -61,7 +61,7 @@ static bool_t authunix_validate(struct __rpc_auth *, struct opaque_auth *); static bool_t authunix_refresh(struct __rpc_auth *); static void authunix_destroy(struct __rpc_auth *); -static struct auth_ops auth_unix_ops = { +static const struct auth_ops auth_unix_ops = { authunix_nextverf, authunix_marshal, authunix_validate, diff --git a/lib/libc/rpc/clnt_raw.c b/lib/libc/rpc/clnt_raw.c index 92076ba97d7..59eb0f810a9 100644 --- a/lib/libc/rpc/clnt_raw.c +++ b/lib/libc/rpc/clnt_raw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clnt_raw.c,v 1.20 2015/11/01 03:45:29 guenther Exp $ */ +/* $OpenBSD: clnt_raw.c,v 1.21 2022/02/14 03:38:59 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -66,7 +66,7 @@ static bool_t clntraw_freeres(CLIENT *, xdrproc_t, caddr_t); static bool_t clntraw_control(CLIENT *, u_int, void *); static void clntraw_destroy(CLIENT *); -static struct clnt_ops client_ops = { +static const struct clnt_ops client_ops = { clntraw_call, clntraw_abort, clntraw_geterr, diff --git a/lib/libc/rpc/clnt_tcp.c b/lib/libc/rpc/clnt_tcp.c index b9c3191f514..f1b4d9c0fcd 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.34 2020/07/06 13:33:06 pirofti Exp $ */ +/* $OpenBSD: clnt_tcp.c,v 1.35 2022/02/14 03:38:59 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -68,7 +68,7 @@ static bool_t clnttcp_freeres(CLIENT *, xdrproc_t, caddr_t); static bool_t clnttcp_control(CLIENT *, u_int, void *); static void clnttcp_destroy(CLIENT *); -static struct clnt_ops tcp_ops = { +static const struct clnt_ops tcp_ops = { clnttcp_call, clnttcp_abort, clnttcp_geterr, diff --git a/lib/libc/rpc/clnt_udp.c b/lib/libc/rpc/clnt_udp.c index 196583423e7..56443a932b4 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.37 2020/07/06 13:33:06 pirofti Exp $ */ +/* $OpenBSD: clnt_udp.c,v 1.38 2022/02/14 03:38:59 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -57,7 +57,7 @@ static bool_t clntudp_freeres(CLIENT *, xdrproc_t, caddr_t); static bool_t clntudp_control(CLIENT *, u_int, void *); static void clntudp_destroy(CLIENT *); -static struct clnt_ops udp_ops = { +static const struct clnt_ops udp_ops = { clntudp_call, clntudp_abort, clntudp_geterr, diff --git a/lib/libc/rpc/svc_raw.c b/lib/libc/rpc/svc_raw.c index d573440e6bd..cfef6fd069f 100644 --- a/lib/libc/rpc/svc_raw.c +++ b/lib/libc/rpc/svc_raw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svc_raw.c,v 1.12 2015/11/01 03:45:29 guenther Exp $ */ +/* $OpenBSD: svc_raw.c,v 1.13 2022/02/14 03:38:59 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -61,7 +61,7 @@ static bool_t svcraw_freeargs(SVCXPRT *xprt, xdrproc_t xdr_args, caddr_t args_ptr); static void svcraw_destroy(SVCXPRT *xprt); -static struct xp_ops server_ops = { +static const struct xp_ops server_ops = { svcraw_recv, svcraw_stat, svcraw_getargs, diff --git a/lib/libc/rpc/svc_tcp.c b/lib/libc/rpc/svc_tcp.c index d1501770e14..9dbd44abe3a 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.41 2020/07/06 13:33:06 pirofti Exp $ */ +/* $OpenBSD: svc_tcp.c,v 1.42 2022/02/14 03:38:59 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -63,7 +63,7 @@ static bool_t svctcp_freeargs(SVCXPRT *xprt, xdrproc_t xdr_args, caddr_t args_ptr); static void svctcp_destroy(SVCXPRT *xprt); -static struct xp_ops svctcp_op = { +static const struct xp_ops svctcp_op = { svctcp_recv, svctcp_stat, svctcp_getargs, @@ -78,7 +78,7 @@ static struct xp_ops svctcp_op = { static bool_t rendezvous_request(SVCXPRT *xprt, struct rpc_msg *); static enum xprt_stat rendezvous_stat(SVCXPRT *xprt); -static struct xp_ops svctcp_rendezvous_op = { +static const struct xp_ops svctcp_rendezvous_op = { rendezvous_request, rendezvous_stat, /* XXX abort illegal in library */ diff --git a/lib/libc/rpc/svc_udp.c b/lib/libc/rpc/svc_udp.c index ccd00f3c4ab..7966d256bf9 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.26 2019/06/28 13:32:42 deraadt Exp $ */ +/* $OpenBSD: svc_udp.c,v 1.27 2022/02/14 03:38:59 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -60,7 +60,7 @@ static void cache_set(SVCXPRT *, u_long); static int cache_get(SVCXPRT *, struct rpc_msg *, char **, u_long *); -static struct xp_ops svcudp_op = { +static const struct xp_ops svcudp_op = { svcudp_recv, svcudp_stat, svcudp_getargs, diff --git a/lib/libc/rpc/xdr_mem.c b/lib/libc/rpc/xdr_mem.c index c82642c8de7..fef897e81e9 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.17 2015/11/01 03:45:29 guenther Exp $ */ +/* $OpenBSD: xdr_mem.c,v 1.18 2022/02/14 03:38:59 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -59,7 +59,7 @@ static int32_t *xdrmem_inline_aligned(XDR *, u_int); static int32_t *xdrmem_inline_unaligned(XDR *, u_int); static void xdrmem_destroy(XDR *); -static struct xdr_ops xdrmem_ops_aligned = { +static const struct xdr_ops xdrmem_ops_aligned = { xdrmem_getlong_aligned, xdrmem_putlong_aligned, xdrmem_getbytes, @@ -71,7 +71,7 @@ static struct xdr_ops xdrmem_ops_aligned = { NULL, /* xdrmem_control */ }; -static struct xdr_ops xdrmem_ops_unaligned = { +static const struct xdr_ops xdrmem_ops_unaligned = { xdrmem_getlong_unaligned, xdrmem_putlong_unaligned, xdrmem_getbytes, diff --git a/lib/libc/rpc/xdr_rec.c b/lib/libc/rpc/xdr_rec.c index 8feeb0d3468..0af0d9570df 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.22 2016/09/21 04:38:56 guenther Exp $ */ +/* $OpenBSD: xdr_rec.c,v 1.23 2022/02/14 03:38:59 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -80,7 +80,7 @@ PROTO_NORMAL(__xdrrec_getrec); struct ct_data; -static struct xdr_ops xdrrec_ops = { +static const struct xdr_ops xdrrec_ops = { xdrrec_getlong, xdrrec_putlong, xdrrec_getbytes, diff --git a/lib/libc/rpc/xdr_stdio.c b/lib/libc/rpc/xdr_stdio.c index d010a8a4e53..692dcf99a1b 100644 --- a/lib/libc/rpc/xdr_stdio.c +++ b/lib/libc/rpc/xdr_stdio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_stdio.c,v 1.15 2019/06/28 13:32:42 deraadt Exp $ */ +/* $OpenBSD: xdr_stdio.c,v 1.16 2022/02/14 03:38:59 guenther Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -55,7 +55,7 @@ static void xdrstdio_destroy(XDR *); /* * Ops vector for stdio type XDR */ -static struct xdr_ops xdrstdio_ops = { +static const struct xdr_ops xdrstdio_ops = { xdrstdio_getlong, /* deserialize a long int */ xdrstdio_putlong, /* serialize a long int */ xdrstdio_getbytes, /* deserialize counted bytes */ |