Fri Aug 16 19:25:32 2019 UTC ()
Pull up following revision(s) (requested by kamil in ticket #70):

	usr.sbin/rpc.statd/statd.c: revision 1.33
	usr.sbin/rpc.lockd/lockd.c: revision 1.13
	usr.sbin/rpc.bootparamd/bootparamd.c: revision 1.47

Stop defining _rpcsvcdirty in bss and data

_rpcsvcdirty is already defined in the generated code from rpcgen(1).

Detected during the build with Address Sanitizer (MKSANITIZER).


(martin)
diff -r1.46 -r1.46.44.1 src/usr.sbin/rpc.bootparamd/bootparamd.c
diff -r1.12 -r1.12.34.1 src/usr.sbin/rpc.lockd/lockd.c
diff -r1.32 -r1.32.6.1 src/usr.sbin/rpc.statd/statd.c

cvs diff -r1.46 -r1.46.44.1 src/usr.sbin/rpc.bootparamd/bootparamd.c (expand / switch to unified diff)

--- src/usr.sbin/rpc.bootparamd/bootparamd.c 2011/08/30 20:29:41 1.46
+++ src/usr.sbin/rpc.bootparamd/bootparamd.c 2019/08/16 19:25:31 1.46.44.1
@@ -1,27 +1,27 @@ @@ -1,27 +1,27 @@
1/* $NetBSD: bootparamd.c,v 1.46 2011/08/30 20:29:41 joerg Exp $ */ 1/* $NetBSD: bootparamd.c,v 1.46.44.1 2019/08/16 19:25:31 martin Exp $ */
2 2
3/* 3/*
4 * This code is not copyright, and is placed in the public domain. 4 * This code is not copyright, and is placed in the public domain.
5 * Feel free to use and modify. Please send modifications and/or 5 * Feel free to use and modify. Please send modifications and/or
6 * suggestions + bug fixes to Klas Heggemann <klas@nada.kth.se> 6 * suggestions + bug fixes to Klas Heggemann <klas@nada.kth.se>
7 * 7 *
8 * Various small changes by Theo de Raadt <deraadt@fsa.ca> 8 * Various small changes by Theo de Raadt <deraadt@fsa.ca>
9 * Parser rewritten (adding YP support) by Roland McGrath <roland@frob.com> 9 * Parser rewritten (adding YP support) by Roland McGrath <roland@frob.com>
10 */ 10 */
11 11
12#include <sys/cdefs.h> 12#include <sys/cdefs.h>
13#ifndef lint 13#ifndef lint
14__RCSID("$NetBSD: bootparamd.c,v 1.46 2011/08/30 20:29:41 joerg Exp $"); 14__RCSID("$NetBSD: bootparamd.c,v 1.46.44.1 2019/08/16 19:25:31 martin Exp $");
15#endif 15#endif
16 16
17#include <sys/types.h> 17#include <sys/types.h>
18#include <sys/ioctl.h> 18#include <sys/ioctl.h>
19#include <sys/stat.h> 19#include <sys/stat.h>
20#include <sys/socket.h> 20#include <sys/socket.h>
21 21
22#include <assert.h> 22#include <assert.h>
23#include <ctype.h> 23#include <ctype.h>
24#include <errno.h> 24#include <errno.h>
25#include <err.h> 25#include <err.h>
26#include <fnmatch.h> 26#include <fnmatch.h>
27#include <netdb.h> 27#include <netdb.h>
@@ -45,27 +45,27 @@ __RCSID("$NetBSD: bootparamd.c,v 1.46 20 @@ -45,27 +45,27 @@ __RCSID("$NetBSD: bootparamd.c,v 1.46 20
45#include <rpcsvc/ypclnt.h> 45#include <rpcsvc/ypclnt.h>
46#endif 46#endif
47 47
48#include "pathnames.h" 48#include "pathnames.h"
49 49
50#define MAXLEN 800 50#define MAXLEN 800
51 51
52static char hostname[MAX_MACHINE_NAME]; 52static char hostname[MAX_MACHINE_NAME];
53static char askname[MAX_MACHINE_NAME]; 53static char askname[MAX_MACHINE_NAME];
54static char domain_name[MAX_MACHINE_NAME]; 54static char domain_name[MAX_MACHINE_NAME];
55 55
56extern void bootparamprog_1(struct svc_req *, SVCXPRT *); 56extern void bootparamprog_1(struct svc_req *, SVCXPRT *);
57 57
58int _rpcsvcdirty = 0; 58extern int _rpcsvcdirty;
59int _rpcpmstart = 0; 59int _rpcpmstart = 0;
60int debug = 0; 60int debug = 0;
61int dolog = 0; 61int dolog = 0;
62struct in_addr route_addr; 62struct in_addr route_addr;
63struct sockaddr_in my_addr; 63struct sockaddr_in my_addr;
64const char *bootpfile = _PATH_BOOTPARAMS; 64const char *bootpfile = _PATH_BOOTPARAMS;
65char *iface = NULL; 65char *iface = NULL;
66 66
67static int lookup_bootparam(char *, char *, char *, char **, char **); 67static int lookup_bootparam(char *, char *, char *, char **, char **);
68__dead static void usage(void); 68__dead static void usage(void);
69static int get_localaddr(const char *, struct sockaddr_in *); 69static int get_localaddr(const char *, struct sockaddr_in *);
70 70
71 71

cvs diff -r1.12 -r1.12.34.1 src/usr.sbin/rpc.lockd/lockd.c (expand / switch to unified diff)

--- src/usr.sbin/rpc.lockd/lockd.c 2012/08/13 12:37:18 1.12
+++ src/usr.sbin/rpc.lockd/lockd.c 2019/08/16 19:25:31 1.12.34.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: lockd.c,v 1.12 2012/08/13 12:37:18 wiz Exp $ */ 1/* $NetBSD: lockd.c,v 1.12.34.1 2019/08/16 19:25:31 martin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1995 4 * Copyright (c) 1995
5 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved. 5 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -25,27 +25,27 @@ @@ -25,27 +25,27 @@
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 * 33 *
34 */ 34 */
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37#ifndef lint 37#ifndef lint
38__RCSID("$NetBSD: lockd.c,v 1.12 2012/08/13 12:37:18 wiz Exp $"); 38__RCSID("$NetBSD: lockd.c,v 1.12.34.1 2019/08/16 19:25:31 martin Exp $");
39#endif 39#endif
40 40
41/* 41/*
42 * main() function for NFS lock daemon. Most of the code in this 42 * main() function for NFS lock daemon. Most of the code in this
43 * file was generated by running rpcgen /usr/include/rpcsvc/nlm_prot.x. 43 * file was generated by running rpcgen /usr/include/rpcsvc/nlm_prot.x.
44 * 44 *
45 * The actual program logic is in the file lock_proc.c 45 * The actual program logic is in the file lock_proc.c
46 */ 46 */
47 47
48#include <sys/types.h> 48#include <sys/types.h>
49#include <sys/socket.h> 49#include <sys/socket.h>
50 50
51#include <err.h> 51#include <err.h>
@@ -57,27 +57,27 @@ __RCSID("$NetBSD: lockd.c,v 1.12 2012/08 @@ -57,27 +57,27 @@ __RCSID("$NetBSD: lockd.c,v 1.12 2012/08
57#include <signal.h> 57#include <signal.h>
58#include <string.h> 58#include <string.h>
59#include <unistd.h> 59#include <unistd.h>
60#include <util.h> 60#include <util.h>
61#include <netconfig.h> 61#include <netconfig.h>
62 62
63#include <rpc/rpc.h> 63#include <rpc/rpc.h>
64#include <rpcsvc/sm_inter.h> 64#include <rpcsvc/sm_inter.h>
65 65
66#include "lockd.h" 66#include "lockd.h"
67#include <rpcsvc/nlm_prot.h> 67#include <rpcsvc/nlm_prot.h>
68 68
69int debug_level = 0; /* 0 = no debugging syslog() calls */ 69int debug_level = 0; /* 0 = no debugging syslog() calls */
70int _rpcsvcdirty = 0; 70extern int _rpcsvcdirty;
71 71
72int grace_expired; 72int grace_expired;
73 73
74void nlm_prog_0(struct svc_req *, SVCXPRT *); 74void nlm_prog_0(struct svc_req *, SVCXPRT *);
75void nlm_prog_1(struct svc_req *, SVCXPRT *); 75void nlm_prog_1(struct svc_req *, SVCXPRT *);
76void nlm_prog_3(struct svc_req *, SVCXPRT *); 76void nlm_prog_3(struct svc_req *, SVCXPRT *);
77void nlm_prog_4(struct svc_req *, SVCXPRT *); 77void nlm_prog_4(struct svc_req *, SVCXPRT *);
78static void usage(void) __dead; 78static void usage(void) __dead;
79 79
80static void sigalarm_handler(int); 80static void sigalarm_handler(int);
81 81
82static const char *transports[] = { "udp", "tcp", "udp6", "tcp6" }; 82static const char *transports[] = { "udp", "tcp", "udp6", "tcp6" };
83 83

cvs diff -r1.32 -r1.32.6.1 src/usr.sbin/rpc.statd/statd.c (expand / switch to unified diff)

--- src/usr.sbin/rpc.statd/statd.c 2018/01/23 21:06:26 1.32
+++ src/usr.sbin/rpc.statd/statd.c 2019/08/16 19:25:31 1.32.6.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: statd.c,v 1.32 2018/01/23 21:06:26 sevan Exp $ */ 1/* $NetBSD: statd.c,v 1.32.6.1 2019/08/16 19:25:31 martin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1995 4 * Copyright (c) 1995
5 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved. 5 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -26,27 +26,27 @@ @@ -26,27 +26,27 @@
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 26 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE. 33 * SUCH DAMAGE.
34 * 34 *
35 */ 35 */
36 36
37#include <sys/cdefs.h> 37#include <sys/cdefs.h>
38#ifndef lint 38#ifndef lint
39__RCSID("$NetBSD: statd.c,v 1.32 2018/01/23 21:06:26 sevan Exp $"); 39__RCSID("$NetBSD: statd.c,v 1.32.6.1 2019/08/16 19:25:31 martin Exp $");
40#endif 40#endif
41 41
42/* main() function for status monitor daemon. Some of the code in this */ 42/* main() function for status monitor daemon. Some of the code in this */
43/* file was generated by running rpcgen /usr/include/rpcsvc/sm_inter.x */ 43/* file was generated by running rpcgen /usr/include/rpcsvc/sm_inter.x */
44/* The actual program logic is in the file procs.c */ 44/* The actual program logic is in the file procs.c */
45 45
46#include <sys/param.h> 46#include <sys/param.h>
47#include <sys/wait.h> 47#include <sys/wait.h>
48 48
49#include <err.h> 49#include <err.h>
50#include <ctype.h> 50#include <ctype.h>
51#include <errno.h> 51#include <errno.h>
52#include <fcntl.h> 52#include <fcntl.h>
@@ -56,27 +56,27 @@ __RCSID("$NetBSD: statd.c,v 1.32 2018/01 @@ -56,27 +56,27 @@ __RCSID("$NetBSD: statd.c,v 1.32 2018/01
56#include <string.h> 56#include <string.h>
57#include <syslog.h> 57#include <syslog.h>
58#include <unistd.h> 58#include <unistd.h>
59#include <util.h> 59#include <util.h>
60#include <db.h> 60#include <db.h>
61#include <netconfig.h> 61#include <netconfig.h>
62 62
63#include <rpc/rpc.h> 63#include <rpc/rpc.h>
64 64
65#include "statd.h" 65#include "statd.h"
66 66
67struct sigaction sa; 67struct sigaction sa;
68int debug = 0; /* Controls syslog() for debug msgs */ 68int debug = 0; /* Controls syslog() for debug msgs */
69int _rpcsvcdirty = 0; /* XXX ??? */ 69extern int _rpcsvcdirty;
70static DB *db; /* Database file */ 70static DB *db; /* Database file */
71 71
72Header status_info; 72Header status_info;
73 73
74static char undefdata[] = "\0\1\2\3\4\5\6\7"; 74static char undefdata[] = "\0\1\2\3\4\5\6\7";
75static DBT undefkey = { 75static DBT undefkey = {
76 undefdata, 76 undefdata,
77 sizeof(undefdata) 77 sizeof(undefdata)
78}; 78};
79 79
80 80
81/* statd.c */ 81/* statd.c */
82static int walk_one(int (*fun )(DBT *, HostInfo *, void *), DBT *, DBT *, void *); 82static int walk_one(int (*fun )(DBT *, HostInfo *, void *), DBT *, DBT *, void *);