1 diff -ruN tcp_wrappers_7.6.orig/eval.c tcp_wrappers_7.6/eval.c
2 --- tcp_wrappers_7.6.orig/eval.c 1995-01-30 19:51:46.000000000 +0100
3 +++ tcp_wrappers_7.6/eval.c 2004-11-04 13:59:01.000000000 +0100
8 +/* eval_port - return string with the port */
9 +char *eval_port(saddr)
11 +struct sockaddr *saddr;
13 +struct sockaddr_in *saddr;
16 + static char port[16];
20 + ntohs(((struct sockaddr_in *)saddr)->sin_port));
22 + ntohs(saddr->sin_port));
30 /* eval_client - return string with as much about the client as we know */
32 char *eval_client(request)
33 diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
34 --- tcp_wrappers_7.6.orig/hosts_access.5 2004-11-04 13:17:45.000000000 +0100
35 +++ tcp_wrappers_7.6/hosts_access.5 2004-11-04 13:55:32.000000000 +0100
39 The client (server) host name (or "unknown" or "paranoid").
41 +The clients (servers) port number (or "0").
43 The daemon process id.
45 diff -ruN tcp_wrappers_7.6.orig/percent_x.c tcp_wrappers_7.6/percent_x.c
46 --- tcp_wrappers_7.6.orig/percent_x.c 1994-12-28 17:42:38.000000000 +0100
47 +++ tcp_wrappers_7.6/percent_x.c 2004-11-04 13:19:29.000000000 +0100
49 ch == 'n' ? eval_hostname(request->client) :
50 ch == 'N' ? eval_hostname(request->server) :
51 ch == 'p' ? eval_pid(request) :
52 + ch == 'r' ? eval_port(request->client->sin) :
53 + ch == 'R' ? eval_port(request->server->sin) :
54 ch == 's' ? eval_server(request) :
55 ch == 'u' ? eval_user(request) :
56 ch == '%' ? "%" : (tcpd_warn("unrecognized %%%c", ch), "");
57 diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
58 --- tcp_wrappers_7.6.orig/tcpd.h 2004-11-04 13:17:45.000000000 +0100
59 +++ tcp_wrappers_7.6/tcpd.h 2004-11-04 13:19:13.000000000 +0100
61 extern char *eval_hostinfo(struct host_info *); /* host name or address */
62 extern char *eval_client(struct request_info *);/* whatever is available */
63 extern char *eval_server(struct request_info *);/* whatever is available */
65 +extern char *eval_port(struct sockaddr *);
67 +extern char *eval_port(struct sockaddr_in *);
69 #define eval_daemon(r) ((r)->daemon) /* daemon process name */
70 #define eval_pid(r) ((r)->pid) /* process id */