1From 9c97b5db237a793e0d1b6b0241570bdc6e35ee24 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 7 Aug 2022 17:42:24 -0700
4Subject: [PATCH] Fix implicit-function-declaration warnings
5
6These are seen with clang-15+
7
8Upstream-Status: Inappropriate [upstream is dead]
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 hosts_access.c | 3 +++
12 safe_finger.c  | 1 +
13 shell_cmd.c    | 3 +++
14 tcpd.c         | 2 +-
15 tcpdchk.c      | 1 +
16 workarounds.c  | 1 +
17 6 files changed, 10 insertions(+), 1 deletion(-)
18
19diff --git a/hosts_access.c b/hosts_access.c
20index 0133e5e..58697ea 100644
21--- a/hosts_access.c
22+++ b/hosts_access.c
23@@ -33,6 +33,12 @@ static char sccsid[] = "@(#) hosts_access.c 1.21 97/02/12 02:13:22";
24 #endif
25 #include <netinet/in.h>
26 #include <arpa/inet.h>
27+#ifdef USE_GETDOMAIN
28+/* defined in workarounds.c */
29+extern int     yp_get_default_domain(char **ptr);
30+#else
31+#  include <rpcsvc/ypclnt.h>
32+#endif	/* USE_GETDOMAIN */
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include <syslog.h>
36@@ -45,6 +46,8 @@ static char sccsid[] = "@(#) hosts_access.c 1.21 97/02/12 02:13:22";
37 #endif
38
39 extern int errno;
40+extern int match_pattern_ylo(const char *s, const char *pattern);
41+extern unsigned long cidr_mask_addr(char* str);
42
43 #ifndef	INADDR_NONE
44 #define	INADDR_NONE	(-1)		/* XXX should be 0xffffffff */
45diff --git a/safe_finger.c b/safe_finger.c
46index 23afab1..a6458fb 100644
47--- a/safe_finger.c
48+++ b/safe_finger.c
49@@ -34,6 +34,7 @@ static char sccsid[] = "@(#) safe_finger.c 1.4 94/12/28 17:42:41";
50 #include <syslog.h>
51
52 extern void exit();
53+extern int pipe_stdin(char  **argv);
54
55 /* Local stuff */
56
57diff --git a/shell_cmd.c b/shell_cmd.c
58index 62d31bc..a566092 100644
59--- a/shell_cmd.c
60+++ b/shell_cmd.c
61@@ -16,10 +16,13 @@ static char sccsid[] = "@(#) shell_cmd.c 1.5 94/12/28 17:42:44";
62
63 #include <sys/types.h>
64 #include <sys/param.h>
65+#include <sys/wait.h>
66+#include <fcntl.h>
67 #include <signal.h>
68 #include <stdio.h>
69 #include <syslog.h>
70 #include <string.h>
71+#include <unistd.h>
72
73 extern void exit();
74
75diff --git a/tcpd.c b/tcpd.c
76index dc9ff17..4353caa 100644
77--- a/tcpd.c
78+++ b/tcpd.c
79@@ -46,7 +46,7 @@ void fix_options(struct request_info *);
80 int     allow_severity = SEVERITY;	/* run-time adjustable */
81 int     deny_severity = LOG_WARNING;	/* ditto */
82
83-main(argc, argv)
84+void main(argc, argv)
85 int     argc;
86 char  **argv;
87 {
88diff --git a/tcpdchk.c b/tcpdchk.c
89index 5dca8bd..67c12ce 100644
90--- a/tcpdchk.c
91+++ b/tcpdchk.c
92@@ -38,6 +38,7 @@ static char sccsid[] = "@(#) tcpdchk.c 1.8 97/02/12 02:13:25";
93
94 extern int errno;
95 extern void exit();
96+extern unsigned long cidr_mask_addr(char* str);
97 extern int optind;
98 extern char *optarg;
99
100diff --git a/workarounds.c b/workarounds.c
101index b22b378..6335049 100644
102--- a/workarounds.c
103+++ b/workarounds.c
104@@ -21,6 +21,7 @@ char    sccsid[] = "@(#) workarounds.c 1.6 96/03/19 16:22:25";
105 #include <stdio.h>
106 #include <syslog.h>
107 #include <string.h>
108+#include <unistd.h>
109
110 extern int errno;
111
112--
1132.37.1
114
115