Blame SOURCES/tcp_wrappers-7.6-shared.patch

c863fc
diff -up tcp_wrappers_7.6/Makefile.patch11 tcp_wrappers_7.6/Makefile
c863fc
--- tcp_wrappers_7.6/Makefile.patch11	2008-08-29 09:45:12.000000000 +0200
c863fc
+++ tcp_wrappers_7.6/Makefile	2008-08-29 09:45:12.000000000 +0200
c863fc
@@ -150,8 +150,8 @@ netbsd:
c863fc
 
c863fc
 linux:
c863fc
 	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
c863fc
-	LIBS="-lnsl" RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
c863fc
-	NETGROUP="-DNETGROUP" TLI= EXTRA_CFLAGS="$(RPM_OPT_FLAGS) -DUSE_STRERROR -DSYS_ERRLIST_DEFINED -DBROKEN_SO_LINGER -Dss_family=__ss_family -Dss_len=__ss_len" all
c863fc
+	LIBS="-lnsl" RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
c863fc
+	NETGROUP="-DNETGROUP" TLI= EXTRA_CFLAGS="$(RPM_OPT_FLAGS)  -fPIC -DPIC -D_REENTRANT -DUSE_STRERROR -DSYS_ERRLIST_DEFINED -DBROKEN_SO_LINGER -Dss_family=__ss_family -Dss_len=__ss_len -DHAVE_WEAKSYMS" all
c863fc
 
c863fc
 linux-old:
c863fc
 	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
c863fc
@@ -249,7 +249,7 @@ tandem:
c863fc
 
c863fc
 # Amdahl UTS 2.1.5 (Richard.Richmond@bridge.bst.bls.com)
c863fc
 uts215:
c863fc
-	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \   
c863fc
+	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
c863fc
 	LIBS="-lsocket" RANLIB=echo \
c863fc
 	ARFLAGS=rv AUX_OBJ=setenv.o NETGROUP=-DNO_NETGROUP TLI= all
c863fc
 
c863fc
@@ -706,8 +706,9 @@ KIT	= README miscd.c tcpd.c fromhost.c h
c863fc
 	scaffold.h tcpdmatch.8 README.NIS
c863fc
 
c863fc
 LIB	= libwrap.a
c863fc
+SHLIB 	= libwrap.so
c863fc
 
c863fc
-all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
c863fc
+all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(SHLIB)
c863fc
 
c863fc
 # Invalidate all object files when the compiler options (CFLAGS) have changed.
c863fc
 
c863fc
@@ -724,6 +725,12 @@ $(LIB):	$(LIB_OBJ)
c863fc
 	$(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
c863fc
 	-$(RANLIB) $(LIB)
c863fc
 
c863fc
+$(SHLIB): $(LIB_OBJ)
c863fc
+	gcc -shared -fPIC -Wl,-soname -Wl,$(SHLIB).$(MAJOR) \
c863fc
+		-o $(SHLIB).$(MAJOR).$(MINOR).$(REL) $^ $(LIBS)
c863fc
+	ln -s $(SHLIB).$(MAJOR).$(MINOR).$(REL) $(SHLIB).$(MAJOR)
c863fc
+	ln -s $(SHLIB).$(MAJOR).$(MINOR).$(REL) $(SHLIB)
c863fc
+
c863fc
 tcpd:	tcpd.o $(LIB)
c863fc
 	$(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
c863fc
 
c863fc
@@ -906,5 +913,6 @@ update.o: cflags
c863fc
 update.o: mystdarg.h
c863fc
 update.o: tcpd.h
c863fc
 vfprintf.o: cflags
c863fc
+weak_symbols.o: tcpd.h
c863fc
 workarounds.o: cflags
c863fc
 workarounds.o: tcpd.h
c863fc
diff -up tcp_wrappers_7.6/tcpd.h.patch11 tcp_wrappers_7.6/tcpd.h
c863fc
--- tcp_wrappers_7.6/tcpd.h.patch11	2008-08-29 09:45:12.000000000 +0200
c863fc
+++ tcp_wrappers_7.6/tcpd.h	2008-08-29 09:45:12.000000000 +0200
c863fc
@@ -4,6 +4,25 @@
c863fc
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
c863fc
   */
c863fc
 
c863fc
+#ifndef _TCPWRAPPERS_TCPD_H
c863fc
+#define _TCPWRAPPERS_TCPD_H
c863fc
+
c863fc
+/* someone else may have defined this */
c863fc
+#undef  __P
c863fc
+
c863fc
+/* use prototypes if we have an ANSI C compiler or are using C++ */
c863fc
+#if defined(__STDC__) || defined(__cplusplus)
c863fc
+#define __P(args)       args
c863fc
+#else
c863fc
+#define __P(args)       ()
c863fc
+#endif
c863fc
+
c863fc
+/* Need definitions of struct sockaddr_in and FILE. */
c863fc
+#include <netinet/in.h>
c863fc
+#include <stdio.h>
c863fc
+
c863fc
+__BEGIN_DECLS
c863fc
+
c863fc
 /* Structure to describe one communications endpoint. */
c863fc
 
c863fc
 #define STRING_LENGTH	128		/* hosts, users, processes */
c863fc
@@ -92,10 +111,10 @@ struct request_info {
c863fc
     char    pid[10];			/* access via eval_pid(request) */
c863fc
     struct host_info client[1];		/* client endpoint info */
c863fc
     struct host_info server[1];		/* server endpoint info */
c863fc
-    void  (*sink) ();			/* datagram sink function or 0 */
c863fc
-    void  (*hostname) ();		/* address to printable hostname */
c863fc
-    void  (*hostaddr) ();		/* address to printable address */
c863fc
-    void  (*cleanup) ();		/* cleanup function or 0 */
c863fc
+    void  (*sink) __P((int));		/* datagram sink function or 0 */
c863fc
+    void  (*hostname) __P((struct host_info *)); /* address to printable hostname */
c863fc
+    void  (*hostaddr) __P((struct host_info *)); /* address to printable address */
c863fc
+    void  (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */
c863fc
     struct netconfig *config;		/* netdir handle */
c863fc
 };
c863fc
 
c863fc
@@ -132,33 +151,38 @@ extern char paranoid[];
c863fc
 /* Global functions. */
c863fc
 
c863fc
 #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
c863fc
-extern void fromhost();			/* get/validate client host info */
c863fc
+extern void fromhost __P((struct request_info *));			/* get/validate client host info */
c863fc
 #else
c863fc
 #define fromhost sock_host		/* no TLI support needed */
c863fc
 #endif
c863fc
 
c863fc
-extern int hosts_access();		/* access control */
c863fc
-extern void shell_cmd();		/* execute shell command */
c863fc
-extern char *percent_x();		/* do %<char> expansion */
c863fc
-extern void rfc931();			/* client name from RFC 931 daemon */
c863fc
-extern void clean_exit();		/* clean up and exit */
c863fc
-extern void refuse();			/* clean up and exit */
c863fc
-extern char *xgets();			/* fgets() on steroids */
c863fc
-extern char *split_at();		/* strchr() and split */
c863fc
-extern unsigned long dot_quad_addr();	/* restricted inet_addr() */
c863fc
-extern int numeric_addr();		/* IP4/IP6 inet_addr (restricted) */
c863fc
-extern struct hostent *tcpd_gethostbyname();
c863fc
+extern void shell_cmd __P((char *));		/* execute shell command */
c863fc
+extern char *percent_x __P((char *, int, char *, struct request_info *));		/* do %<char> expansion */
c863fc
+extern void rfc931 __P((struct sockaddr_gen *, struct sockaddr_gen *, char *));			/* client name from RFC 931 daemon */
c863fc
+extern void clean_exit __P((struct request_info *));		/* clean up and exit */
c863fc
+extern void refuse __P((struct request_info *));			/* clean up and exit */
c863fc
+extern char *xgets __P((char *, int, FILE *));			/* fgets() on steroids */
c863fc
+extern char *split_at __P((char *, int));		/* strchr() and split */
c863fc
+extern unsigned long dot_quad_addr __P((char *));	/* restricted inet_addr() */
c863fc
+extern int numeric_addr __P((char *, union gen_addr *, int *, int *));		/* IP4/IP6 inet_addr (restricted) */
c863fc
+extern struct hostent *tcpd_gethostbyname __P((char *, int));
c863fc
 					/* IP4/IP6 gethostbyname */
c863fc
 #ifdef HAVE_IPV6
c863fc
-extern char *skip_ipv6_addrs();		/* skip over colons in IPv6 addrs */
c863fc
+extern char *skip_ipv6_addrs __P((char *));		/* skip over colons in IPv6 addrs */
c863fc
 #else
c863fc
 #define skip_ipv6_addrs(x)	x
c863fc
 #endif
c863fc
 
c863fc
 /* Global variables. */
c863fc
 
c863fc
+#ifdef HAVE_WEAKSYMS
c863fc
+extern int allow_severity __attribute__ ((weak)); /* for connection logging */
c863fc
+extern int deny_severity __attribute__ ((weak)); /* for connection logging */
c863fc
+#else
c863fc
 extern int allow_severity;		/* for connection logging */
c863fc
 extern int deny_severity;		/* for connection logging */
c863fc
+#endif
c863fc
+
c863fc
 extern char *hosts_allow_table;		/* for verification mode redirection */
c863fc
 extern char *hosts_deny_table;		/* for verification mode redirection */
c863fc
 extern int hosts_access_verbose;	/* for verbose matching mode */
c863fc
@@ -171,9 +195,14 @@ extern int resident;			/* > 0 if residen
c863fc
   */
c863fc
 
c863fc
 #ifdef __STDC__
c863fc
+extern int hosts_access(struct request_info *request);
c863fc
+extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, 
c863fc
+                     char *client_user);
c863fc
 extern struct request_info *request_init(struct request_info *,...);
c863fc
 extern struct request_info *request_set(struct request_info *,...);
c863fc
 #else
c863fc
+extern int hosts_access();
c863fc
+extern int hosts_ctl();
c863fc
 extern struct request_info *request_init();	/* initialize request */
c863fc
 extern struct request_info *request_set();	/* update request structure */
c863fc
 #endif
c863fc
@@ -196,27 +225,31 @@ extern struct request_info *request_set(
c863fc
   * host_info structures serve as caches for the lookup results.
c863fc
   */
c863fc
 
c863fc
-extern char *eval_user();		/* client user */
c863fc
-extern char *eval_hostname();		/* printable hostname */
c863fc
-extern char *eval_hostaddr();		/* printable host address */
c863fc
-extern char *eval_hostinfo();		/* host name or address */
c863fc
-extern char *eval_client();		/* whatever is available */
c863fc
-extern char *eval_server();		/* whatever is available */
c863fc
+extern char *eval_user __P((struct request_info *));	/* client user */
c863fc
+extern char *eval_hostname __P((struct host_info *));	/* printable hostname */
c863fc
+extern char *eval_hostaddr __P((struct host_info *));	/* printable host address */
c863fc
+extern char *eval_hostinfo __P((struct host_info *));	/* host name or address */
c863fc
+extern char *eval_client __P((struct request_info *));	/* whatever is available */
c863fc
+extern char *eval_server __P((struct request_info *));	/* whatever is available */
c863fc
 #define eval_daemon(r)	((r)->daemon)	/* daemon process name */
c863fc
 #define eval_pid(r)	((r)->pid)	/* process id */
c863fc
 
c863fc
 /* Socket-specific methods, including DNS hostname lookups. */
c863fc
 
c863fc
-extern void sock_host();		/* look up endpoint addresses */
c863fc
-extern void sock_hostname();		/* translate address to hostname */
c863fc
-extern void sock_hostaddr();		/* address to printable address */
c863fc
+/* look up endpoint addresses */
c863fc
+extern void sock_host __P((struct request_info *));
c863fc
+/* translate address to hostname */
c863fc
+extern void sock_hostname __P((struct host_info *));
c863fc
+/* address to printable address */
c863fc
+extern void sock_hostaddr __P((struct host_info *));
c863fc
+
c863fc
 #define sock_methods(r) \
c863fc
 	{ (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
c863fc
 
c863fc
 /* The System V Transport-Level Interface (TLI) interface. */
c863fc
 
c863fc
 #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
c863fc
-extern void tli_host();			/* look up endpoint addresses etc. */
c863fc
+extern void tli_host __P((struct request_info *));	/* look up endpoint addresses etc. */
c863fc
 #endif
c863fc
 
c863fc
  /*
c863fc
@@ -257,7 +290,7 @@ extern struct tcpd_context tcpd_context;
c863fc
   * behavior.
c863fc
   */
c863fc
 
c863fc
-extern void process_options();		/* execute options */
c863fc
+extern void process_options __P((char *, struct request_info *)); /* execute options */
c863fc
 extern int dry_run;			/* verification flag */
c863fc
 
c863fc
 /* Bug workarounds. */
c863fc
@@ -296,3 +329,7 @@ extern char *fix_strtok();
c863fc
 #define strtok	my_strtok
c863fc
 extern char *my_strtok();
c863fc
 #endif
c863fc
+
c863fc
+__END_DECLS
c863fc
+
c863fc
+#endif /* tcpd.h */
c863fc
diff -up /dev/null tcp_wrappers_7.6/weak_symbols.c
c863fc
--- /dev/null	2008-08-29 10:35:15.589003986 +0200
c863fc
+++ tcp_wrappers_7.6/weak_symbols.c	2008-08-29 09:45:12.000000000 +0200
c863fc
@@ -0,0 +1,11 @@
c863fc
+ /*
c863fc
+  * @(#) weak_symbols.h 1.5 99/12/29 23:50
c863fc
+  * 
c863fc
+  * Author: Anthony Towns <ajt@debian.org>
c863fc
+  */
c863fc
+
c863fc
+#ifdef HAVE_WEAKSYMS
c863fc
+#include <syslog.h>
c863fc
+int deny_severity = LOG_WARNING;
c863fc
+int allow_severity = SEVERITY; 
c863fc
+#endif
c863fc
diff -up tcp_wrappers_7.6/scaffold.c.patch11 tcp_wrappers_7.6/scaffold.c
c863fc
--- tcp_wrappers_7.6/scaffold.c.patch11	2013-01-28 11:08:48.598273563 +0100
c863fc
+++ tcp_wrappers_7.6/scaffold.c	2013-01-28 11:08:56.069316992 +0100
c863fc
@@ -25,7 +25,7 @@ static char sccs_id[] = "@(#) scaffold.c
c863fc
 #define	INADDR_NONE	(-1)		/* XXX should be 0xffffffff */
c863fc
 #endif
c863fc
 
c863fc
-extern char *malloc();
c863fc
+extern void *malloc(size_t);
c863fc
 
c863fc
 /* Application-specific. */
c863fc
 
c863fc
@@ -180,10 +180,12 @@ struct request_info *request;
c863fc
 
c863fc
 /* ARGSUSED */
c863fc
 
c863fc
-void    rfc931(request)
c863fc
-struct request_info *request;
c863fc
+void    rfc931(rmt_sin, our_sin, dest)
c863fc
+struct sockaddr_gen *rmt_sin;
c863fc
+struct sockaddr_gen *our_sin;
c863fc
+char   *dest;
c863fc
 {
c863fc
-    strcpy(request->user, unknown);
c863fc
+    strcpy(dest, unknown);
c863fc
 }
c863fc
 
c863fc
 /* check_path - examine accessibility */