]> git.pld-linux.org Git - packages/tcp_wrappers.git/blob - tcp_wrappers-shared.patch
- full blown shared lib with proper header files
[packages/tcp_wrappers.git] / tcp_wrappers-shared.patch
1 diff -urN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile
2 --- tcp_wrappers_7.6.orig/Makefile      Mon Dec 13 13:58:15 1999
3 +++ tcp_wrappers_7.6/Makefile   Mon Dec 13 14:07:48 1999
4 @@ -152,7 +152,7 @@
5  linux:
6         @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
7         LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
8 -       NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all
9 +       NETGROUP= TLI= EXTRA_CFLAGS="-DHAVE_WEAKSYMS -DBROKEN_SO_LINGER -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all
10  
11  linux-old:
12         @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
13 @@ -373,6 +374,10 @@
14         NETGROUP= TLI= all
15  
16  ###############################################################
17 +LIBTOOL = libtool
18 +PREFIX  = /usr/local
19 +LIBDIR = $(PREFIX)/lib
20 +###############################################################
21  # System dependencies: TLI (transport-level interface) support.
22  # 
23  # Uncomment the following macro if your system has System V.4-style TLI
24 @@ -670,9 +674,11 @@
25  # Protection against weird shells or weird make programs.
26  
27  SHELL  = /bin/sh
28 -.c.o:; $(CC) $(CFLAGS) -c $*.c
29 +.c.o:; $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $*.c
30 +
31 +%.lo:; $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $*.c
32  
33 -CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
34 +CFLAGS = -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
35         $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
36         -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
37         -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
38 @@ -679,12 +685,12 @@
39         $(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
40         $(VSYSLOG) $(HOSTNAME)
41  
42 -LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \
43 -       hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \
44 -       $(FROM_OBJ) fix_options.o socket.o tli.o workarounds.o \
45 -       update.o misc.o diag.o percent_m.o myvsyslog.o
46 +LIB_OBJ= hosts_access.lo options.lo shell_cmd.lo rfc931.lo eval.lo \
47 +       hosts_ctl.lo refuse.lo percent_x.lo clean_exit.lo $(AUX_OBJ) \
48 +       $(FROM_OBJ) fix_options.lo socket.lo tli.lo workarounds.lo \
49 +       update.lo misc.lo diag.lo percent_m.lo myvsyslog.lo weak_symbols.lo
50  
51 -FROM_OBJ= fromhost.o
52 +FROM_OBJ= fromhost.lo
53  
54  KIT    = README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \
55         tcpd.h tcpdmatch.c Makefile hosts_access.5 strcasecmp.c BLURB rfc931.c \
56 @@ -697,7 +703,7 @@
57         refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \
58         scaffold.h tcpdmatch.8 README.NIS
59  
60 -LIB    = libwrap.a
61 +LIB    = libwrap.la
62  
63  all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
64  
65 @@ -713,30 +719,29 @@
66  
67  $(LIB):        $(LIB_OBJ)
68         rm -f $(LIB)
69 -       $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
70 -       -$(RANLIB) $(LIB)
71 +       $(LIBTOOL) --mode=link $(CC) -o $(LDFLAGS) $(LIB) $(LIB_OBJ) -rpath $(LIBDIR)
72  
73  tcpd:  tcpd.o $(LIB)
74 -       $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
75 +       $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o $@ tcpd.o $(LDFLAGS) $(LIB) $(LIBS)
76  
77  miscd: miscd.o $(LIB)
78 -       $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
79 +       $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o $@ miscd.o $(LDFLAGS) $(LIB) $(LIBS)
80  
81  safe_finger: safe_finger.o $(LIB)
82 -       $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
83 +       $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o $@ safe_finger.o $(LDFLAGS) $(LIB) $(LIBS)
84  
85  TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
86  
87  tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
88 -       $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
89 +       $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LDFLAGS) $(LIB) $(LIBS)
90  
91  try-from: try-from.o fakelog.o $(LIB)
92 -       $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
93 +       $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LDFLAGS) $(LIB) $(LIBS)
94  
95  TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
96  
97  tcpdchk: $(TCPDCHK_OBJ) $(LIB)
98 -       $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
99 +       $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LDFLAGS) $(LIB) $(LIBS)
100  
101  shar:  $(KIT)
102         @shar $(KIT)
103 @@ -757,6 +762,14 @@
104  tidy:  clean
105         chmod -R a+r .
106         chmod 755 .
107 +
108 +install:
109 +       -install -d $(PREFIX)/{sbin,include}
110 +       $(LIBTOOL) --mode=install install -c $(LIB) $(LIBDIR)/$(LIB)
111 +       $(LIBTOOL) --mode=finish $(LIBDIR)
112 +       for PROG in safe_finger tcpdchk try-from tcpd tcpdmatch ; do \
113 +               $(LIBTOOL) --mode=install install -c $$PROG $(PREFIX)/sbin/$$PROG ; done
114 +       install tcpd.h $(PREFIX)/include/
115  
116  # Enable all bells and whistles for linting.
117  
118 @@ -906,5 +913,6 @@
119  update.o: mystdarg.h
120  update.o: tcpd.h
121  vfprintf.o: cflags
122 +weak_symbols.o: tcpd.h
123  workarounds.o: cflags
124  workarounds.o: tcpd.h
125 --- tcp_wrappers_7.6/tcpd.h.shared      2003-02-10 20:12:26.000000000 +0100
126 +++ tcp_wrappers_7.6/tcpd.h     2003-02-10 20:12:26.000000000 +0100
127 @@ -4,6 +4,25 @@
128    * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
129    */
130  
131 +#ifndef _TCPWRAPPERS_TCPD_H
132 +#define _TCPWRAPPERS_TCPD_H
133 +
134 +/* someone else may have defined this */
135 +#undef  __P
136 +
137 +/* use prototypes if we have an ANSI C compiler or are using C++ */
138 +#if defined(__STDC__) || defined(__cplusplus)
139 +#define __P(args)       args
140 +#else
141 +#define __P(args)       ()
142 +#endif
143 +
144 +/* Need definitions of struct sockaddr_in and FILE. */
145 +#include <netinet/in.h>
146 +#include <stdio.h>
147 +
148 +__BEGIN_DECLS
149 +
150  /* Structure to describe one communications endpoint. */
151  
152  #define STRING_LENGTH  128             /* hosts, users, processes */
153 @@ -29,10 +48,10 @@
154      char    pid[10];                   /* access via eval_pid(request) */
155      struct host_info client[1];                /* client endpoint info */
156      struct host_info server[1];                /* server endpoint info */
157 -    void  (*sink) ();                  /* datagram sink function or 0 */
158 -    void  (*hostname) ();              /* address to printable hostname */
159 -    void  (*hostaddr) ();              /* address to printable address */
160 -    void  (*cleanup) ();               /* cleanup function or 0 */
161 +    void  (*sink) __P((int));          /* datagram sink function or 0 */
162 +    void  (*hostname) __P((struct host_info *)); /* address to printable hostname */
163 +    void  (*hostaddr) __P((struct host_info *)); /* address to printable address */
164 +    void  (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */
165      struct netconfig *config;          /* netdir handle */
166  };
167  
168 @@ -65,25 +84,34 @@
169  /* Global functions. */
170  
171  #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
172 -extern void fromhost();                        /* get/validate client host info */
173 +extern void fromhost __P((struct request_info *));     /* get/validate client host info */
174  #else
175  #define fromhost sock_host             /* no TLI support needed */
176  #endif
177  
178 -extern int hosts_access();             /* access control */
179 -extern void shell_cmd();               /* execute shell command */
180 -extern char *percent_x();              /* do %<char> expansion */
181 -extern void rfc931();                  /* client name from RFC 931 daemon */
182 -extern void clean_exit();              /* clean up and exit */
183 -extern void refuse();                  /* clean up and exit */
184 -extern char *xgets();                  /* fgets() on steroids */
185 -extern char *split_at();               /* strchr() and split */
186 -extern unsigned long dot_quad_addr();  /* restricted inet_addr() */
187 +extern void shell_cmd __P((char *));   /* execute shell command */
188 +extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do %<char> expansion */
189 +#ifdef INET6
190 +extern void rfc931 __P((struct sockaddr *, struct sockaddr *, char *)); /* client name from RFC 931 daemon */
191 +#else
192 +extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */
193 +#endif
194 +extern void clean_exit __P((struct request_info *)); /* clean up and exit */
195 +extern void refuse __P((struct request_info *));       /* clean up and exit */
196 +extern char *xgets __P((char *, int, FILE *)); /* fgets() on steroids */
197 +extern char *split_at __P((char *, int));      /* strchr() and split */
198 +extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */
199  
200  /* Global variables. */
201  
202 +#ifdef HAVE_WEAKSYMS
203 +extern int allow_severity __attribute__ ((weak)); /* for connection logging */
204 +extern int deny_severity __attribute__ ((weak)); /* for connection logging */
205 +#else
206  extern int allow_severity;             /* for connection logging */
207  extern int deny_severity;              /* for connection logging */
208 +#endif
209 +
210  extern char *hosts_allow_table;                /* for verification mode redirection */
211  extern char *hosts_deny_table;         /* for verification mode redirection */
212  extern int hosts_access_verbose;       /* for verbose matching mode */
213 @@ -96,9 +124,14 @@
214    */
215  
216  #ifdef __STDC__
217 +extern int hosts_access(struct request_info *request);
218 +extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, 
219 +                     char *client_user);
220  extern struct request_info *request_init(struct request_info *,...);
221  extern struct request_info *request_set(struct request_info *,...);
222  #else
223 +extern int hosts_access();
224 +extern int hosts_ctl();
225  extern struct request_info *request_init();    /* initialize request */
226  extern struct request_info *request_set();     /* update request structure */
227  #endif
228 @@ -121,27 +154,31 @@
229    * host_info structures serve as caches for the lookup results.
230    */
231  
232 -extern char *eval_user();              /* client user */
233 -extern char *eval_hostname();          /* printable hostname */
234 -extern char *eval_hostaddr();          /* printable host address */
235 -extern char *eval_hostinfo();          /* host name or address */
236 -extern char *eval_client();            /* whatever is available */
237 -extern char *eval_server();            /* whatever is available */
238 +extern char *eval_user __P((struct request_info *));   /* client user */
239 +extern char *eval_hostname __P((struct host_info *));  /* printable hostname */
240 +extern char *eval_hostaddr __P((struct host_info *));  /* printable host address */
241 +extern char *eval_hostinfo __P((struct host_info *));  /* host name or address */
242 +extern char *eval_client __P((struct request_info *)); /* whatever is available */
243 +extern char *eval_server __P((struct request_info *)); /* whatever is available */
244  #define eval_daemon(r) ((r)->daemon)   /* daemon process name */
245  #define eval_pid(r)    ((r)->pid)      /* process id */
246  
247  /* Socket-specific methods, including DNS hostname lookups. */
248  
249 -extern void sock_host();               /* look up endpoint addresses */
250 -extern void sock_hostname();           /* translate address to hostname */
251 -extern void sock_hostaddr();           /* address to printable address */
252 +/* look up endpoint addresses */
253 +extern void sock_host __P((struct request_info *));
254 +/* translate address to hostname */
255 +extern void sock_hostname __P((struct host_info *));
256 +/* address to printable address */
257 +extern void sock_hostaddr __P((struct host_info *));
258 +
259  #define sock_methods(r) \
260         { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
261  
262  /* The System V Transport-Level Interface (TLI) interface. */
263  
264  #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
265 -extern void tli_host();                        /* look up endpoint addresses etc. */
266 +extern void tli_host __P((struct request_info *));     /* look up endpoint addresses etc. */
267  #endif
268  
269   /*
270 @@ -182,7 +219,7 @@
271    * behavior.
272    */
273  
274 -extern void process_options();         /* execute options */
275 +extern void process_options __P((char *, struct request_info *)); /* execute options */
276  extern int dry_run;                    /* verification flag */
277  
278  /* Bug workarounds. */
279 @@ -221,3 +258,7 @@
280  #define strtok my_strtok
281  extern char *my_strtok();
282  #endif
283 +
284 +__END_DECLS
285 +
286 +#endif /* tcpd.h */
287 --- tcp_wrappers_7.6/scaffold.c.shared  2003-02-10 20:12:26.000000000 +0100
288 +++ tcp_wrappers_7.6/scaffold.c 2003-02-10 20:12:26.000000000 +0100
289 @@ -237,10 +237,17 @@
290  
291  /* ARGSUSED */
292  
293 -void    rfc931(request)
294 -struct request_info *request;
295 +void    rfc931(rmt_sin, our_sin, dest)
296 +#ifndef INET6
297 +struct sockaddr_in *rmt_sin;
298 +struct sockaddr_in *our_sin;
299 +#else
300 +struct sockaddr *rmt_sin;
301 +struct sockaddr *our_sin;
302 +#endif
303 +char   *dest;
304  {
305 -    strcpy(request->user, unknown);
306 +    strcpy(dest, unknown);
307  }
308  
309  /* check_path - examine accessibility */
310 diff -Nur tcp_wrappers_7.6.orig/weak_symbols.c tcp_wrappers_7.6/weak_symbols.c
311 --- tcp_wrappers_7.6.orig/weak_symbols.c        1970-01-01 01:00:00.000000000 +0100
312 +++ tcp_wrappers_7.6/weak_symbols.c     2003-08-23 07:40:03.717139736 +0200
313 @@ -0,0 +1,11 @@
314 +/*
315 + * @(#) weak_symbols.h 1.5 99/12/29 23:50
316 + *
317 + * Author: Anthony Towns <ajt@debian.org>
318 + */
319 +
320 +#ifdef HAVE_WEAKSYMS
321 +#include <syslog.h>
322 +int deny_severity __attribute__((weak)) = LOG_WARNING;
323 +int allow_severity __attribute__((weak)) = SEVERITY;
324 +#endif
This page took 0.153702 seconds and 4 git commands to generate.