]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / tcp-wrappers / tcp-wrappers-7.6 / 13_shlib_weaksym
1 diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile
2 --- tcp_wrappers_7.6.orig/Makefile      2004-05-02 15:37:59.000000000 +0200
3 +++ tcp_wrappers_7.6/Makefile   2004-05-02 15:31:09.000000000 +0200
4 @@ -150,15 +150,15 @@
5  
6  linux:
7         @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
8 -       LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
9 +       LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
10         NETGROUP="-DNETGROUP" TLI= VSYSLOG= BUGS= \
11 -       EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all
12 +       EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all
13  
14  gnu:
15         @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
16 -       LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
17 +       LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
18         NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= \
19 -       EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR" all
20 +       EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT" all
21  
22  # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
23  hpux hpux8 hpux9 hpux10:
24 @@ -713,7 +713,22 @@
25  
26  LIB    = libwrap.a
27  
28 -all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
29 +shared/%.o: %.c
30 +       $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
31 +
32 +SOMAJOR = 0
33 +SOMINOR = 7.6
34 +
35 +SHLIB          = shared/libwrap.so.$(SOMAJOR).$(SOMINOR)
36 +SHLIBSOMAJ     = shared/libwrap.so.$(SOMAJOR)
37 +SHLIBSO                = shared/libwrap.so
38 +SHLIBFLAGS     = -Lshared -lwrap
39 +
40 +SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS)
41 +SHCFLAGS = -fPIC -shared -D_REENTRANT
42 +SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
43 +
44 +all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
45  
46  # Invalidate all object files when the compiler options (CFLAGS) have changed.
47  
48 @@ -731,27 +746,33 @@
49         $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
50         -$(RANLIB) $(LIB)
51  
52 -tcpd:  tcpd.o $(LIB)
53 -       $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
54 +$(SHLIB): $(SHLIB_OBJ)
55 +       rm -f $(SHLIB)
56 +       $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
57 +       ln -sf $(notdir $(SHLIB)) $(SHLIBSOMAJ)
58 +       ln -sf $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
59 +
60 +tcpd:  tcpd.o $(SHLIB)
61 +       $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
62  
63  miscd: miscd.o $(LIB)
64         $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
65  
66 -safe_finger: safe_finger.o $(LIB)
67 -       $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
68 +safe_finger: safe_finger.o $(SHLIB)
69 +       $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
70  
71  TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
72  
73 -tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
74 -       $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
75 +tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
76 +       $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
77  
78 -try-from: try-from.o fakelog.o $(LIB)
79 -       $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
80 +try-from: try-from.o fakelog.o $(SHLIB)
81 +       $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
82  
83  TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
84  
85 -tcpdchk: $(TCPDCHK_OBJ) $(LIB)
86 -       $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
87 +tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
88 +       $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
89  
90  shar:  $(KIT)
91         @shar $(KIT)
92 @@ -767,7 +788,9 @@
93  
94  clean:
95         rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \
96 +       libwrap*.so* \
97         cflags
98 +       rm -rf shared/
99  
100  tidy:  clean
101         chmod -R a+r .
102 @@ -913,5 +936,6 @@
103  update.o: mystdarg.h
104  update.o: tcpd.h
105  vfprintf.o: cflags
106 +weak_symbols.o: tcpd.h
107  workarounds.o: cflags
108  workarounds.o: tcpd.h
109 diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
110 --- tcp_wrappers_7.6.orig/tcpd.h        2004-05-02 15:37:59.000000000 +0200
111 +++ tcp_wrappers_7.6/tcpd.h     2004-05-02 15:37:49.000000000 +0200
112 @@ -4,6 +4,15 @@
113    * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
114    */
115  
116 +#ifndef _TCPWRAPPERS_TCPD_H
117 +#define _TCPWRAPPERS_TCPD_H
118 +
119 +/* Need definitions of struct sockaddr_in and FILE. */
120 +#include <netinet/in.h>
121 +#include <stdio.h>
122 +
123 +__BEGIN_DECLS
124 +
125  /* Structure to describe one communications endpoint. */
126  
127  #define STRING_LENGTH  128             /* hosts, users, processes */
128 @@ -29,10 +38,10 @@
129      char    pid[10];                   /* access via eval_pid(request) */
130      struct host_info client[1];                /* client endpoint info */
131      struct host_info server[1];                /* server endpoint info */
132 -    void  (*sink) ();                  /* datagram sink function or 0 */
133 -    void  (*hostname) ();              /* address to printable hostname */
134 -    void  (*hostaddr) ();              /* address to printable address */
135 -    void  (*cleanup) ();               /* cleanup function or 0 */
136 +    void  (*sink) (int);               /* datagram sink function or 0 */
137 +    void  (*hostname) (struct host_info *); /* address to printable hostname */
138 +    void  (*hostaddr) (struct host_info *); /* address to printable address */
139 +    void  (*cleanup) (struct request_info *); /* cleanup function or 0 */
140      struct netconfig *config;          /* netdir handle */
141  };
142  
143 @@ -70,20 +79,27 @@
144  #define fromhost sock_host             /* no TLI support needed */
145  #endif
146  
147 -extern int hosts_access();             /* access control */
148 -extern void shell_cmd();               /* execute shell command */
149 -extern char *percent_x();              /* do %<char> expansion */
150 -extern void rfc931();                  /* client name from RFC 931 daemon */
151 -extern void clean_exit();              /* clean up and exit */
152 -extern void refuse();                  /* clean up and exit */
153 -extern char *xgets();                  /* fgets() on steroids */
154 -extern char *split_at();               /* strchr() and split */
155 -extern unsigned long dot_quad_addr();  /* restricted inet_addr() */
156 +extern int hosts_access(struct request_info *request); /* access control */
157 +extern void shell_cmd(char *);         /* execute shell command */
158 +extern char *percent_x(char *, int, char *, struct request_info *);
159 +                                       /* do %<char> expansion */
160 +extern void rfc931(struct sockaddr *, struct sockaddr *, char *);
161 +                                       /* client name from RFC 931 daemon */
162 +extern void clean_exit(struct request_info *); /* clean up and exit */
163 +extern void refuse(struct request_info *);     /* clean up and exit */
164 +extern char *xgets(char *, int, FILE *);       /* fgets() on steroids */
165 +extern char *split_at(char *, int);            /* strchr() and split */
166 +extern unsigned long dot_quad_addr(char *);    /* restricted inet_addr() */
167  
168  /* Global variables. */
169  
170 +#ifdef HAVE_WEAKSYMS
171 +extern int allow_severity __attribute__ ((weak)); /* for connection logging */
172 +extern int deny_severity __attribute__ ((weak)); /* for connection logging */
173 +#else
174  extern int allow_severity;             /* for connection logging */
175  extern int deny_severity;              /* for connection logging */
176 +#endif
177  extern char *hosts_allow_table;                /* for verification mode redirection */
178  extern char *hosts_deny_table;         /* for verification mode redirection */
179  extern int hosts_access_verbose;       /* for verbose matching mode */
180 @@ -98,6 +114,8 @@
181  #ifdef __STDC__
182  extern struct request_info *request_init(struct request_info *,...);
183  extern struct request_info *request_set(struct request_info *,...);
184 +extern int hosts_ctl(char *daemon, char *client_name, char *client_addr,
185 +               char *client_user);
186  #else
187  extern struct request_info *request_init();    /* initialize request */
188  extern struct request_info *request_set();     /* update request structure */
189 @@ -121,20 +139,23 @@
190    * host_info structures serve as caches for the lookup results.
191    */
192  
193 -extern char *eval_user();              /* client user */
194 -extern char *eval_hostname();          /* printable hostname */
195 -extern char *eval_hostaddr();          /* printable host address */
196 -extern char *eval_hostinfo();          /* host name or address */
197 -extern char *eval_client();            /* whatever is available */
198 -extern char *eval_server();            /* whatever is available */
199 +extern char *eval_user(struct request_info *); /* client user */
200 +extern char *eval_hostname(struct host_info *);        /* printable hostname */
201 +extern char *eval_hostaddr(struct host_info *);        /* printable host address */
202 +extern char *eval_hostinfo(struct host_info *);        /* host name or address */
203 +extern char *eval_client(struct request_info *);/* whatever is available */
204 +extern char *eval_server(struct request_info *);/* whatever is available */
205  #define eval_daemon(r) ((r)->daemon)   /* daemon process name */
206  #define eval_pid(r)    ((r)->pid)      /* process id */
207  
208  /* Socket-specific methods, including DNS hostname lookups. */
209  
210 -extern void sock_host();               /* look up endpoint addresses */
211 -extern void sock_hostname();           /* translate address to hostname */
212 -extern void sock_hostaddr();           /* address to printable address */
213 +/* look up endpoint addresses */
214 +extern void sock_host(struct request_info *);
215 +/* translate address to hostname */
216 +extern void sock_hostname(struct host_info *);
217 +/* address to printable address */
218 +extern void sock_hostaddr(struct host_info *);
219  #define sock_methods(r) \
220         { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
221  
222 @@ -182,7 +203,7 @@
223    * behavior.
224    */
225  
226 -extern void process_options();         /* execute options */
227 +extern void process_options(char *, struct request_info *);/* execute options */
228  extern int dry_run;                    /* verification flag */
229  
230  /* Bug workarounds. */
231 @@ -221,3 +242,7 @@
232  #define strtok my_strtok
233  extern char *my_strtok();
234  #endif
235 +
236 +__END_DECLS
237 +
238 +#endif
239 diff -ruN tcp_wrappers_7.6.orig/weak_symbols.c tcp_wrappers_7.6/weak_symbols.c
240 --- tcp_wrappers_7.6.orig/weak_symbols.c        1970-01-01 01:00:00.000000000 +0100
241 +++ tcp_wrappers_7.6/weak_symbols.c     2004-05-02 15:31:09.000000000 +0200
242 @@ -0,0 +1,11 @@
243 + /*
244 +  * @(#) weak_symbols.h 1.5 99/12/29 23:50
245 +  * 
246 +  * Author: Anthony Towns <ajt@debian.org>
247 +  */
248 +
249 +#ifdef HAVE_WEAKSYMS
250 +#include <syslog.h>
251 +int deny_severity = LOG_WARNING;
252 +int allow_severity = SEVERITY; 
253 +#endif