Browse code

Adding audit and its dependent packages

dthaluru authored on 2015/09/01 02:50:26
Showing 5 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,98 @@
0
+Summary:	Kernel Audit Tool
1
+Name:		audit
2
+Version:	2.4.4
3
+Release:	1%{?dist}
4
+Source0:	http://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz
5
+%define sha1 audit=ad38f3352e21716e86d73b4e06cc41a5e85882ee
6
+License:	GPLv2+
7
+Group:		System Environment/Security
8
+URL:		http://people.redhat.com/sgrubb/audit/
9
+Vendor:		VMware, Inc.
10
+Distribution:	Photon
11
+BuildRequires:	python2-devel
12
+BuildRequires:	python2-libs
13
+BuildRequires:	krb5
14
+BuildRequires:	openldap
15
+BuildRequires:	go
16
+BuildRequires:	tcp_wrappers-devel
17
+BuildRequires:	libcap-ng-devel
18
+BuildRequires:	swig
19
+Requires:	krb5
20
+Requires:	openldap
21
+Requires:	python2
22
+Requires:	tcp_wrappers
23
+Requires:	libcap-ng
24
+
25
+%description
26
+The audit package contains the user space utilities for
27
+storing and searching the audit records generate by
28
+the audit subsystem in the Linux 2.6 kernel.
29
+
30
+%package devel
31
+Summary:	The libraries and header files needed for audit development.
32
+Requires: 	%{name} = %{version}-%{release}
33
+
34
+%description devel
35
+The libraries and header files needed for audit development.
36
+
37
+%prep
38
+%setup -q
39
+
40
+%build
41
+./configure \
42
+	--prefix=%{_prefix} \
43
+	--exec_prefix=/usr \
44
+	--sbindir=%{_sbindir} \
45
+	--libdir=%{_libdir} \
46
+	--sysconfdir=%{_sysconfdir} \
47
+	--with-python=yes \
48
+	--without-python3 \
49
+        --with-libwrap \
50
+	--enable-gssapi-krb5=yes \
51
+        --with-libcap-ng=yes \
52
+	--with-aarch64 \
53
+        --enable-zos-remote \
54
+	--with-golang \
55
+	--enable-systemd
56
+
57
+make %{?_smp_mflags}
58
+
59
+%install
60
+make install DESTDIR=%{buildroot}
61
+
62
+%post
63
+/sbin/ldconfig
64
+%systemd_post auditd.service
65
+
66
+%preun
67
+%systemd_preun auditd.service
68
+
69
+%postun
70
+/sbin/ldconfig
71
+
72
+%files 
73
+%defattr(-,root,root)
74
+%{_bindir}/*
75
+%{_sbindir}/*
76
+%{_libdir}/*.so.*
77
+%{_libdir}/*.a
78
+%{_libdir}/*.la
79
+%{_libdir}/python*/*
80
+%{_libdir}/golang/*
81
+%{_libdir}/systemd/system/auditd.service
82
+%{_libexecdir}/*
83
+%{_mandir}/man3/*
84
+%{_mandir}/man5/*
85
+%{_mandir}/man7/*
86
+%{_mandir}/man8/*
87
+%{_sysconfdir}/*
88
+
89
+%files devel
90
+%defattr(-,root,root)
91
+%{_libdir}/*.so
92
+%{_libdir}/pkgconfig/*.pc
93
+%{_includedir}/*.h
94
+
95
+%changelog
96
+* Fri Aug 28 2015 Divya Thaluru <dthaluru@vmware.com> 2.4.4-1
97
+- Initial version
0 98
new file mode 100644
... ...
@@ -0,0 +1,60 @@
0
+Summary:	POSIX capability Library
1
+Name:		libcap-ng
2
+Version:	0.7.7
3
+Release:	1%{?dist}
4
+License: 	LGPLv2+
5
+Group: 		System Environment/Libraries
6
+URL: 		http://people.redhat.com/sgrubb/libcap-ng
7
+Source0: 	http://people.redhat.com/sgrubb/libcap-ng/%{name}-%{version}.tar.gz
8
+%define sha1 libcap-ng=de8ea2c89cb1506a578de7cb032da34c970dd035
9
+BuildRequires:	python2-devel
10
+BuildRequires:	python2-libs
11
+Requires:	python2
12
+
13
+%description
14
+The libcap-ng library is intended to make programming with posix capabilities much easier than the traditional libcap library. It includes utilities that can analyse all currently running applications and print out any capabilities and whether or not it has an open ended bounding set. An open bounding set without the securebits "NOROOT" flag will allow full capabilities escalation for apps retaining uid 0 simply by calling execve.
15
+
16
+%package devel
17
+Summary:	The libraries and header files needed for libcap-ng development.
18
+Requires: 	%{name} = %{version}-%{release}
19
+
20
+%description devel
21
+The libraries and header files needed for libcap_ng development.
22
+
23
+%prep
24
+%setup -q
25
+
26
+%build
27
+./configure \
28
+	--prefix=%{_prefix} \
29
+	--libdir=%{_libdir} \
30
+	--with-python \
31
+	--without-python3
32
+
33
+make %{?_smp_mflags}
34
+%install
35
+make DESTDIR=%{buildroot} install 
36
+
37
+%post	-p /sbin/ldconfig
38
+%postun	-p /sbin/ldconfig
39
+
40
+%files
41
+%defattr(-, root, root)
42
+%{_libdir}/*.so.*
43
+%{_libdir}/*.a
44
+%{_libdir}/*.la
45
+%{_bindir}/*
46
+%{_mandir}/man3/*
47
+%{_mandir}/man8/*
48
+%{_datadir}/aclocal/*.m4
49
+
50
+%files devel
51
+%defattr(-, root, root)
52
+%{_libdir}/*.so
53
+%{_libdir}/pkgconfig/*.pc
54
+%{_includedir}/*.h
55
+
56
+%changelog
57
+* 	Fri Aug 28 2015 Divya Thaluru <dthaluru@vmware.com> 0.7.7-1
58
+- 	Initial version
59
+
0 60
new file mode 100644
... ...
@@ -0,0 +1,1035 @@
0
+Submitted By: Tushar Teredesai <tushar@linuxfromscratch.org>
1
+Date: 2003-10-04
2
+Initial Package Version: 7.6
3
+Origin: http://archives.linuxfromscratch.org/mail-archives/blfs-dev/2003-January/001960.html
4
+Description: The patch was created from the tcp_wrappers modified package by Mark Heerdink.
5
+This patch provides the following improvements:
6
+    * Install libwrap.so along with libwrap.a.
7
+    * Create an install target for tcp_wrappers.
8
+    * Compilation and security fixes.
9
+    * Documentation fixes.
10
+diff -Naur tcp_wrappers_7.6/Makefile tcp_wrappers_7.6.gimli/Makefile
11
+--- tcp_wrappers_7.6/Makefile	1997-03-21 12:27:21.000000000 -0600
12
+@@ -1,5 +1,10 @@
13
++GLIBC=$(shell grep -s -c __GLIBC__ /usr/include/features.h)
14
++
15
+ # @(#) Makefile 1.23 97/03/21 19:27:20
16
+ 
17
++# unset the HOSTNAME environment variable
18
++HOSTNAME =
19
++
20
+ what:
21
+ 	@echo
22
+ 	@echo "Usage: edit the REAL_DAEMON_DIR definition in the Makefile then:"
23
+@@ -19,7 +24,7 @@
24
+ 	@echo "	generic (most bsd-ish systems with sys5 compatibility)"
25
+ 	@echo "	386bsd aix alpha apollo bsdos convex-ultranet dell-gcc dgux dgux543"
26
+ 	@echo "	dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix"
27
+-	@echo "	linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
28
++	@echo "	linux gnu machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
29
+ 	@echo "	ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4"
30
+ 	@echo "	sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2"
31
+ 	@echo "	uts215 uxp"
32
+@@ -43,8 +48,8 @@
33
+ # Ultrix 4.x SunOS 4.x ConvexOS 10.x Dynix/ptx
34
+ #REAL_DAEMON_DIR=/usr/etc
35
+ #
36
+-# SysV.4 Solaris 2.x OSF AIX
37
+-#REAL_DAEMON_DIR=/usr/sbin
38
++# SysV.4 Solaris 2.x OSF AIX Linux
39
++REAL_DAEMON_DIR=/usr/sbin
40
+ #
41
+ # BSD 4.4
42
+ #REAL_DAEMON_DIR=/usr/libexec
43
+@@ -141,10 +146,21 @@
44
+ 	LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
45
+ 	EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
46
+ 
47
++ifneq ($(GLIBC),0)
48
++MYLIB=-lnsl
49
++endif
50
++
51
+ linux:
52
+ 	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
53
+-	LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
54
+-	NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all
55
++	LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
56
++	NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
57
++	EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT"
58
++
59
++gnu:
60
++	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
61
++	LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
62
++	NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
63
++	EXTRA_CFLAGS="-DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT"
64
+ 
65
+ # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
66
+ hpux hpux8 hpux9 hpux10:
67
+@@ -391,7 +407,7 @@
68
+ # the ones provided with this source distribution. The environ.c module
69
+ # implements setenv(), getenv(), and putenv().
70
+ 
71
+-AUX_OBJ= setenv.o
72
++#AUX_OBJ= setenv.o
73
+ #AUX_OBJ= environ.o
74
+ #AUX_OBJ= environ.o strcasecmp.o
75
+ 
76
+@@ -454,7 +470,8 @@
77
+ # host name aliases. Compile with -DSOLARIS_24_GETHOSTBYNAME_BUG to work
78
+ # around this. The workaround does no harm on other Solaris versions.
79
+ 
80
+-BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
81
++BUGS =
82
++#BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
83
+ #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DINET_ADDR_BUG
84
+ #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DSOLARIS_24_GETHOSTBYNAME_BUG
85
+ 
86
+@@ -464,7 +481,7 @@
87
+ # If your system supports NIS or YP-style netgroups, enable the following
88
+ # macro definition. Netgroups are used only for host access control.
89
+ #
90
+-#NETGROUP= -DNETGROUP
91
++NETGROUP= -DNETGROUP
92
+ 
93
+ ###############################################################
94
+ # System dependencies: whether or not your system has vsyslog()
95
+@@ -491,7 +508,7 @@
96
+ # Uncomment the next definition to turn on the language extensions
97
+ # (examples: allow, deny, banners, twist and spawn).
98
+ # 
99
+-#STYLE	= -DPROCESS_OPTIONS	# Enable language extensions.
100
++STYLE	= -DPROCESS_OPTIONS	# Enable language extensions.
101
+ 
102
+ ################################################################
103
+ # Optional: Changing the default disposition of logfile records
104
+@@ -514,7 +531,7 @@
105
+ #
106
+ # The LOG_XXX names below are taken from the /usr/include/syslog.h file.
107
+ 
108
+-FACILITY= LOG_MAIL	# LOG_MAIL is what most sendmail daemons use
109
++FACILITY= LOG_DAEMON	# LOG_MAIL is what most sendmail daemons use
110
+ 
111
+ # The syslog priority at which successful connections are logged.
112
+ 
113
+@@ -610,7 +627,7 @@
114
+ # Paranoid mode implies hostname lookup. In order to disable hostname
115
+ # lookups altogether, see the next section.
116
+ 
117
+-PARANOID= -DPARANOID
118
++#PARANOID= -DPARANOID
119
+ 
120
+ ########################################
121
+ # Optional: turning off hostname lookups
122
+@@ -623,7 +640,7 @@
123
+ # In order to perform selective hostname lookups, disable paranoid
124
+ # mode (see previous section) and comment out the following definition.
125
+ 
126
+-HOSTNAME= -DALWAYS_HOSTNAME
127
++#HOSTNAME= -DALWAYS_HOSTNAME
128
+ 
129
+ #############################################
130
+ # Optional: Turning on host ADDRESS checking
131
+@@ -649,28 +666,46 @@
132
+ # source-routed traffic in the kernel. Examples: 4.4BSD derivatives,
133
+ # Solaris 2.x, and Linux. See your system documentation for details.
134
+ #
135
+-# KILL_OPT= -DKILL_IP_OPTIONS
136
++KILL_OPT= -DKILL_IP_OPTIONS
137
+ 
138
+ ## End configuration options
139
+ ############################
140
+ 
141
+ # Protection against weird shells or weird make programs.
142
+ 
143
++CC	= gcc
144
+ SHELL	= /bin/sh
145
+-.c.o:;	$(CC) $(CFLAGS) -c $*.c
146
++.c.o:;	$(CC) $(CFLAGS) -o $*.o -c $*.c
147
++
148
++SOMAJOR = 0
149
++SOMINOR = 7.6
150
++
151
++LIB	= libwrap.a
152
++SHLIB	= shared/libwrap.so.$(SOMAJOR).$(SOMINOR)
153
++SHLIBSOMAJ= shared/libwrap.so.$(SOMAJOR)
154
++SHLIBSO	= shared/libwrap.so
155
++SHLIBFLAGS = -Lshared -lwrap
156
+ 
157
+-CFLAGS	= -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
158
++shared/%.o: %.c
159
++	$(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
160
++
161
++CFLAGS	= -O2 -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
162
+ 	$(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
163
+ 	-DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
164
+ 	-DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
165
+ 	$(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
166
+ 	$(VSYSLOG) $(HOSTNAME)
167
+ 
168
++SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS)
169
++SHCFLAGS = -fPIC -shared -D_REENTRANT
170
++
171
+ LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \
172
+ 	hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \
173
+ 	$(FROM_OBJ) fix_options.o socket.o tli.o workarounds.o \
174
+ 	update.o misc.o diag.o percent_m.o myvsyslog.o
175
+ 
176
++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
177
++
178
+ FROM_OBJ= fromhost.o
179
+ 
180
+ KIT	= README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \
181
+@@ -684,46 +719,80 @@
182
+ 	refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \
183
+ 	scaffold.h tcpdmatch.8 README.NIS
184
+ 
185
+-LIB	= libwrap.a
186
+-
187
+-all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
188
++all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
189
+ 
190
+ # Invalidate all object files when the compiler options (CFLAGS) have changed.
191
+ 
192
+ config-check:
193
+ 	@set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; }
194
+-	@set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \
195
+-	if cmp cflags /tmp/cflags.$$$$ ; \
196
+-	then rm /tmp/cflags.$$$$ ; \
197
+-	else mv /tmp/cflags.$$$$ cflags ; \
198
++	@set +e; echo $(CFLAGS) >cflags.new ; \
199
++	if cmp cflags cflags.new ; \
200
++	then rm cflags.new ; \
201
++	else mv cflags.new cflags ; \
202
+ 	fi >/dev/null 2>/dev/null
203
++	@if [ ! -d shared ]; then mkdir shared; fi
204
+ 
205
+ $(LIB):	$(LIB_OBJ)
206
+ 	rm -f $(LIB)
207
+ 	$(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
208
+ 	-$(RANLIB) $(LIB)
209
+ 
210
+-tcpd:	tcpd.o $(LIB)
211
+-	$(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
212
++$(SHLIB): $(SHLIB_OBJ)
213
++	rm -f $(SHLIB)
214
++	$(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
215
++	ln -s $(notdir $(SHLIB)) $(SHLIBSOMAJ)
216
++	ln -s $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
217
++
218
++tcpd:	tcpd.o $(SHLIB)
219
++	$(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
220
+ 
221
+-miscd:	miscd.o $(LIB)
222
+-	$(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
223
++miscd:	miscd.o $(SHLIB)
224
++	$(CC) $(CFLAGS) -o $@ miscd.o $(SHLIBFLAGS)
225
+ 
226
+-safe_finger: safe_finger.o $(LIB)
227
+-	$(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
228
++safe_finger: safe_finger.o $(SHLIB)
229
++	$(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
230
+ 
231
+ TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
232
+ 
233
+-tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
234
+-	$(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
235
++tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
236
++	$(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
237
+ 
238
+-try-from: try-from.o fakelog.o $(LIB)
239
+-	$(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
240
++try-from: try-from.o fakelog.o $(SHLIB)
241
++	$(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
242
+ 
243
+ TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
244
+ 
245
+-tcpdchk: $(TCPDCHK_OBJ) $(LIB)
246
+-	$(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
247
++tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
248
++	$(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
249
++
250
++install: install-lib install-bin install-dev
251
++
252
++install-lib:
253
++	install -o root -g root -m 0755 $(SHLIB) ${DESTDIR}/usr/lib/
254
++	ln -sf $(notdir $(SHLIB)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSOMAJ))
255
++	ln -sf $(notdir $(SHLIBSOMAJ)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSO))
256
++
257
++install-bin:
258
++	install -o root -g root -m 0755 tcpd ${DESTDIR}/usr/sbin/
259
++	install -o root -g root -m 0755 tcpdchk ${DESTDIR}/usr/sbin/
260
++	install -o root -g root -m 0755 tcpdmatch ${DESTDIR}/usr/sbin/
261
++	install -o root -g root -m 0755 try-from ${DESTDIR}/usr/sbin/
262
++	install -o root -g root -m 0755 safe_finger ${DESTDIR}/usr/sbin/
263
++	install -o root -g root -m 0644 tcpd.8 ${DESTDIR}/usr/share/man/man8/
264
++	install -o root -g root -m 0644 tcpdchk.8 ${DESTDIR}/usr/share/man/man8/
265
++	install -o root -g root -m 0644 try-from.8 ${DESTDIR}/usr/share/man/man8/
266
++	install -o root -g root -m 0644 tcpdmatch.8 ${DESTDIR}/usr/share/man/man8/
267
++	install -o root -g root -m 0644 safe_finger.8 ${DESTDIR}/usr/share/man/man8/
268
++	install -o root -g root -m 0644 hosts_access.5 ${DESTDIR}/usr/share/man/man5/
269
++	install -o root -g root -m 0644 hosts_options.5 ${DESTDIR}/usr/share/man/man5/
270
++
271
++install-dev:
272
++	install -o root -g root -m 0644 hosts_access.3 ${DESTDIR}/usr/share/man/man3/
273
++	install -o root -g root -m 0644 tcpd.h ${DESTDIR}/usr/include/
274
++	install -o root -g root -m 0644 $(LIB) ${DESTDIR}/usr/lib/
275
++	ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/hosts_ctl.3
276
++	ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_init.3
277
++	ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_set.3
278
+ 
279
+ shar:	$(KIT)
280
+ 	@shar $(KIT)
281
+@@ -739,7 +808,8 @@
282
+ 
283
+ clean:
284
+ 	rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \
285
+-	cflags
286
++	cflags libwrap*.so*
287
++	rm -rf shared
288
+ 
289
+ tidy:	clean
290
+ 	chmod -R a+r .
291
+@@ -885,5 +955,6 @@
292
+ update.o: mystdarg.h
293
+ update.o: tcpd.h
294
+ vfprintf.o: cflags
295
++weak_symbols.o: tcpd.h
296
+ workarounds.o: cflags
297
+ workarounds.o: tcpd.h
298
+diff -Naur tcp_wrappers_7.6/fix_options.c tcp_wrappers_7.6.gimli/fix_options.c
299
+--- tcp_wrappers_7.6/fix_options.c	1997-04-07 19:29:19.000000000 -0500
300
+@@ -35,7 +35,12 @@
301
+ #ifdef IP_OPTIONS
302
+     unsigned char optbuf[BUFFER_SIZE / 3], *cp;
303
+     char    lbuf[BUFFER_SIZE], *lp;
304
++#if !defined(__GLIBC__)
305
+     int     optsize = sizeof(optbuf), ipproto;
306
++#else /* __GLIBC__ */
307
++    size_t  optsize = sizeof(optbuf);
308
++    int     ipproto;
309
++#endif /* __GLIBC__ */
310
+     struct protoent *ip;
311
+     int     fd = request->fd;
312
+     unsigned int opt;
313
+diff -Naur tcp_wrappers_7.6/hosts_access.3 tcp_wrappers_7.6.gimli/hosts_access.3
314
+--- tcp_wrappers_7.6/hosts_access.3	1996-02-11 10:01:27.000000000 -0600
315
+@@ -3,7 +3,7 @@
316
+ hosts_access, hosts_ctl, request_init, request_set \- access control library
317
+ .SH SYNOPSIS
318
+ .nf
319
+-#include "tcpd.h"
320
++#include <tcpd.h>
321
+ 
322
+ extern int allow_severity;
323
+ extern int deny_severity;
324
+diff -Naur tcp_wrappers_7.6/hosts_access.5 tcp_wrappers_7.6.gimli/hosts_access.5
325
+--- tcp_wrappers_7.6/hosts_access.5	1995-01-30 12:51:47.000000000 -0600
326
+@@ -8,9 +8,9 @@
327
+ impatient reader is encouraged to skip to the EXAMPLES section for a
328
+ quick introduction.
329
+ .PP
330
+-An extended version of the access control language is described in the
331
+-\fIhosts_options\fR(5) document. The extensions are turned on at
332
+-program build time by building with -DPROCESS_OPTIONS.
333
++The extended version of the access control language is described in the
334
++\fIhosts_options\fR(5) document. \fBNote that this language supersedes
335
++the meaning of \fIshell_command\fB as documented below.\fR
336
+ .PP
337
+ In the following text, \fIdaemon\fR is the the process name of a
338
+ network daemon process, and \fIclient\fR is the name and/or address of
339
+@@ -40,7 +40,7 @@
340
+ character. This permits you to break up long lines so that they are
341
+ easier to edit.
342
+ .IP \(bu
343
+-Blank lines or lines that begin with a `#\' character are ignored.
344
++Blank lines or lines that begin with a `#' character are ignored.
345
+ This permits you to insert comments and whitespace so that the tables
346
+ are easier to read.
347
+ .IP \(bu
348
+@@ -69,26 +69,33 @@
349
+ .SH PATTERNS
350
+ The access control language implements the following patterns:
351
+ .IP \(bu
352
+-A string that begins with a `.\' character. A host name is matched if
353
++A string that begins with a `.' character. A host name is matched if
354
+ the last components of its name match the specified pattern.  For
355
+-example, the pattern `.tue.nl\' matches the host name
356
+-`wzv.win.tue.nl\'.
357
++example, the pattern `.tue.nl' matches the host name
358
++`wzv.win.tue.nl'.
359
+ .IP \(bu
360
+-A string that ends with a `.\' character. A host address is matched if
361
++A string that ends with a `.' character. A host address is matched if
362
+ its first numeric fields match the given string.  For example, the
363
+-pattern `131.155.\' matches the address of (almost) every host on the
364
++pattern `131.155.' matches the address of (almost) every host on the
365
+ Eind\%hoven University network (131.155.x.x).
366
+ .IP \(bu
367
+-A string that begins with an `@\' character is treated as an NIS
368
++A string that begins with an `@' character is treated as an NIS
369
+ (formerly YP) netgroup name. A host name is matched if it is a host
370
+ member of the specified netgroup. Netgroup matches are not supported
371
+ for daemon process names or for client user names.
372
+ .IP \(bu
373
+-An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a
374
+-`net/mask\' pair. A host address is matched if `net\' is equal to the
375
+-bitwise AND of the address and the `mask\'. For example, the net/mask
376
+-pattern `131.155.72.0/255.255.254.0\' matches every address in the
377
+-range `131.155.72.0\' through `131.155.73.255\'.
378
++An expression of the form `n.n.n.n/m.m.m.m' is interpreted as a
379
++`net/mask' pair. A host address is matched if `net' is equal to the
380
++bitwise AND of the address and the `mask'. For example, the net/mask
381
++pattern `131.155.72.0/255.255.254.0' matches every address in the
382
++range `131.155.72.0' through `131.155.73.255'.
383
++.IP \(bu
384
++A string that begins with a `/' character is treated as a file
385
++name. A host name or address is matched if it matches any host name
386
++or address pattern listed in the named file. The file format is
387
++zero or more lines with zero or more host name or address patterns
388
++separated by whitespace.  A file name pattern can be used anywhere
389
++a host name or address pattern can be used.
390
+ .SH WILDCARDS
391
+ The access control language supports explicit wildcards:
392
+ .IP ALL
393
+@@ -115,19 +122,19 @@
394
+ .ne 6
395
+ .SH OPERATORS
396
+ .IP EXCEPT
397
+-Intended use is of the form: `list_1 EXCEPT list_2\'; this construct
398
++Intended use is of the form: `list_1 EXCEPT list_2'; this construct
399
+ matches anything that matches \fIlist_1\fR unless it matches
400
+ \fIlist_2\fR.  The EXCEPT operator can be used in daemon_lists and in
401
+ client_lists. The EXCEPT operator can be nested: if the control
402
+-language would permit the use of parentheses, `a EXCEPT b EXCEPT c\'
403
+-would parse as `(a EXCEPT (b EXCEPT c))\'.
404
++language would permit the use of parentheses, `a EXCEPT b EXCEPT c'
405
++would parse as `(a EXCEPT (b EXCEPT c))'.
406
+ .br
407
+ .ne 6
408
+ .SH SHELL COMMANDS
409
+ If the first-matched access control rule contains a shell command, that
410
+ command is subjected to %<letter> substitutions (see next section).
411
+ The result is executed by a \fI/bin/sh\fR child process with standard
412
+-input, output and error connected to \fI/dev/null\fR.  Specify an `&\'
413
++input, output and error connected to \fI/dev/null\fR.  Specify an `&'
414
+ at the end of the command if you do not want to wait until it has
415
+ completed.
416
+ .PP
417
+@@ -159,7 +166,7 @@
418
+ .IP %u
419
+ The client user name (or "unknown").
420
+ .IP %%
421
+-Expands to a single `%\' character.
422
++Expands to a single `%' character.
423
+ .PP
424
+ Characters in % expansions that may confuse the shell are replaced by
425
+ underscores.
426
+@@ -243,9 +250,9 @@
427
+ less trustworthy. It is possible for an intruder to spoof both the
428
+ client connection and the IDENT lookup, although doing so is much
429
+ harder than spoofing just a client connection. It may also be that
430
+-the client\'s IDENT server is lying.
431
++the client's IDENT server is lying.
432
+ .PP
433
+-Note: IDENT lookups don\'t work with UDP services. 
434
++Note: IDENT lookups don't work with UDP services. 
435
+ .SH EXAMPLES
436
+ The language is flexible enough that different types of access control
437
+ policy can be expressed with a minimum of fuss. Although the language
438
+@@ -285,7 +292,7 @@
439
+ .br
440
+ ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
441
+ .PP
442
+-The first rule permits access from hosts in the local domain (no `.\'
443
++The first rule permits access from hosts in the local domain (no `.'
444
+ in the host name) and from members of the \fIsome_netgroup\fP
445
+ netgroup.  The second rule permits access from all hosts in the
446
+ \fIfoobar.edu\fP domain (notice the leading dot), with the exception of
447
+@@ -322,8 +329,8 @@
448
+ /etc/hosts.deny:
449
+ .in +3
450
+ .nf
451
+-in.tftpd: ALL: (/some/where/safe_finger -l @%h | \\
452
+-	/usr/ucb/mail -s %d-%h root) &
453
++in.tftpd: ALL: (/usr/sbin/safe_finger -l @%h | \\
454
++	/usr/bin/mail -s %d-%h root) &
455
+ .fi
456
+ .PP
457
+ The safe_finger command comes with the tcpd wrapper and should be
458
+@@ -349,7 +356,7 @@
459
+ capacity of an internal buffer; when an access control rule is not
460
+ terminated by a newline character; when the result of %<letter>
461
+ expansion would overflow an internal buffer; when a system call fails
462
+-that shouldn\'t.  All problems are reported via the syslog daemon.
463
++that shouldn't.  All problems are reported via the syslog daemon.
464
+ .SH FILES
465
+ .na
466
+ .nf
467
+diff -Naur tcp_wrappers_7.6/hosts_access.c tcp_wrappers_7.6.gimli/hosts_access.c
468
+--- tcp_wrappers_7.6/hosts_access.c	1997-02-11 19:13:23.000000000 -0600
469
+@@ -240,6 +240,26 @@
470
+     }
471
+ }
472
+ 
473
++/* hostfile_match - look up host patterns from file */
474
++
475
++static int hostfile_match(path, host)
476
++char   *path;
477
++struct hosts_info *host;
478
++{
479
++    char    tok[BUFSIZ];
480
++    int     match = NO;
481
++    FILE   *fp;
482
++
483
++    if ((fp = fopen(path, "r")) != 0) {
484
++        while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host)))
485
++            /* void */ ;
486
++        fclose(fp);
487
++    } else if (errno != ENOENT) {
488
++        tcpd_warn("open %s: %m", path);
489
++    }
490
++    return (match);
491
++}
492
++
493
+ /* host_match - match host name and/or address against pattern */
494
+ 
495
+ static int host_match(tok, host)
496
+@@ -267,6 +287,8 @@
497
+ 	tcpd_warn("netgroup support is disabled");	/* not tcpd_jump() */
498
+ 	return (NO);
499
+ #endif
500
++    } else if (tok[0] == '/') {                         /* /file hack */
501
++        return (hostfile_match(tok, host));
502
+     } else if (STR_EQ(tok, "KNOWN")) {		/* check address and name */
503
+ 	char   *name = eval_hostname(host);
504
+ 	return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name));
505
+diff -Naur tcp_wrappers_7.6/hosts_options.5 tcp_wrappers_7.6.gimli/hosts_options.5
506
+--- tcp_wrappers_7.6/hosts_options.5	1994-12-28 10:42:29.000000000 -0600
507
+@@ -58,12 +58,12 @@
508
+ Execute, in a child process, the specified shell command, after
509
+ performing the %<letter> expansions described in the hosts_access(5)
510
+ manual page.  The command is executed with stdin, stdout and stderr
511
+-connected to the null device, so that it won\'t mess up the
512
++connected to the null device, so that it won't mess up the
513
+ conversation with the client host. Example:
514
+ .sp
515
+ .nf
516
+ .ti +3
517
+-spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) &
518
++spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) &
519
+ .fi
520
+ .sp
521
+ executes, in a background child process, the shell command "safe_finger
522
+diff -Naur tcp_wrappers_7.6/options.c tcp_wrappers_7.6.gimli/options.c
523
+--- tcp_wrappers_7.6/options.c	1996-02-11 10:01:32.000000000 -0600
524
+@@ -473,6 +473,9 @@
525
+ #ifdef LOG_CRON
526
+     "cron", LOG_CRON,
527
+ #endif
528
++#ifdef LOG_FTP
529
++    "ftp", LOG_FTP,
530
++#endif
531
+ #ifdef LOG_LOCAL0
532
+     "local0", LOG_LOCAL0,
533
+ #endif
534
+diff -Naur tcp_wrappers_7.6/percent_m.c tcp_wrappers_7.6.gimli/percent_m.c
535
+--- tcp_wrappers_7.6/percent_m.c	1994-12-28 10:42:37.000000000 -0600
536
+@@ -13,7 +13,7 @@
537
+ #include <string.h>
538
+ 
539
+ extern int errno;
540
+-#ifndef SYS_ERRLIST_DEFINED
541
++#if !defined(SYS_ERRLIST_DEFINED) && !defined(HAVE_STRERROR)
542
+ extern char *sys_errlist[];
543
+ extern int sys_nerr;
544
+ #endif
545
+@@ -29,11 +29,15 @@
546
+ 
547
+     while (*bp = *cp)
548
+ 	if (*cp == '%' && cp[1] == 'm') {
549
++#ifdef HAVE_STRERROR
550
++            strcpy(bp, strerror(errno));
551
++#else
552
+ 	    if (errno < sys_nerr && errno > 0) {
553
+ 		strcpy(bp, sys_errlist[errno]);
554
+ 	    } else {
555
+ 		sprintf(bp, "Unknown error %d", errno);
556
+ 	    }
557
++#endif
558
+ 	    bp += strlen(bp);
559
+ 	    cp += 2;
560
+ 	} else {
561
+diff -Naur tcp_wrappers_7.6/rfc931.c tcp_wrappers_7.6.gimli/rfc931.c
562
+--- tcp_wrappers_7.6/rfc931.c	1995-01-02 09:11:34.000000000 -0600
563
+@@ -33,7 +33,7 @@
564
+ 
565
+ int     rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */
566
+ 
567
+-static jmp_buf timebuf;
568
++static sigjmp_buf timebuf;
569
+ 
570
+ /* fsocket - open stdio stream on top of socket */
571
+ 
572
+@@ -62,7 +62,7 @@
573
+ static void timeout(sig)
574
+ int     sig;
575
+ {
576
+-    longjmp(timebuf, sig);
577
++    siglongjmp(timebuf, sig);
578
+ }
579
+ 
580
+ /* rfc931 - return remote user name, given socket structures */
581
+@@ -99,7 +99,7 @@
582
+ 	 * Set up a timer so we won't get stuck while waiting for the server.
583
+ 	 */
584
+ 
585
+-	if (setjmp(timebuf) == 0) {
586
++	if (sigsetjmp(timebuf,1) == 0) {
587
+ 	    signal(SIGALRM, timeout);
588
+ 	    alarm(rfc931_timeout);
589
+ 
590
+diff -Naur tcp_wrappers_7.6/safe_finger.8 tcp_wrappers_7.6.gimli/safe_finger.8
591
+--- tcp_wrappers_7.6/safe_finger.8	1969-12-31 18:00:00.000000000 -0600
592
+@@ -0,0 +1,34 @@
593
++.TH SAFE_FINGER 8 "21th June 1997" Linux "Linux Programmer's Manual"
594
++.SH NAME
595
++safe_finger \- finger client wrapper that protects against nasty stuff
596
++from finger servers
597
++.SH SYNOPSIS
598
++.B safe_finger [finger_options]
599
++.SH DESCRIPTION
600
++The
601
++.B safe_finger
602
++command protects against nasty stuff from finger servers. Use this
603
++program for automatic reverse finger probes from the
604
++.B tcp_wrapper
605
++.B (tcpd)
606
++, not the raw finger command. The
607
++.B safe_finger
608
++command makes sure that the finger client is not run with root
609
++privileges. It also runs the finger client with a defined PATH
610
++environment.
611
++.B safe_finger
612
++will also protect you from problems caused by the output of some
613
++finger servers. The problem: some programs may react to stuff in
614
++the first column. Other programs may get upset by thrash anywhere
615
++on a line. File systems may fill up as the finger server keeps
616
++sending data. Text editors may bomb out on extremely long lines.
617
++The finger server may take forever because it is somehow wedged.
618
++.B safe_finger
619
++takes care of all this badness.
620
++.SH SEE ALSO
621
++.BR hosts_access (5),
622
++.BR hosts_options (5),
623
++.BR tcpd (8)
624
++.SH AUTHOR
625
++Wietse Venema, Eindhoven University of Technology, The Netherlands.
626
++
627
+diff -Naur tcp_wrappers_7.6/safe_finger.c tcp_wrappers_7.6.gimli/safe_finger.c
628
+--- tcp_wrappers_7.6/safe_finger.c	1994-12-28 10:42:42.000000000 -0600
629
+@@ -26,21 +26,24 @@
630
+ #include <stdio.h>
631
+ #include <ctype.h>
632
+ #include <pwd.h>
633
++#include <syslog.h>
634
+ 
635
+ extern void exit();
636
+ 
637
+ /* Local stuff */
638
+ 
639
+-char    path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin";
640
++char    path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin";
641
+ 
642
+ #define	TIME_LIMIT	60		/* Do not keep listinging forever */
643
+ #define	INPUT_LENGTH	100000		/* Do not keep listinging forever */
644
+ #define	LINE_LENGTH	128		/* Editors can choke on long lines */
645
+ #define	FINGER_PROGRAM	"finger"	/* Most, if not all, UNIX systems */
646
+ #define	UNPRIV_NAME	"nobody"	/* Preferred privilege level */
647
+-#define	UNPRIV_UGID	32767		/* Default uid and gid */
648
++#define	UNPRIV_UGID	65534		/* Default uid and gid */
649
+ 
650
+ int     finger_pid;
651
++int	allow_severity = SEVERITY;
652
++int	deny_severity = LOG_WARNING;
653
+ 
654
+ void    cleanup(sig)
655
+ int     sig;
656
+diff -Naur tcp_wrappers_7.6/scaffold.c tcp_wrappers_7.6.gimli/scaffold.c
657
+--- tcp_wrappers_7.6/scaffold.c	1997-03-21 12:27:24.000000000 -0600
658
+@@ -180,10 +180,12 @@
659
+ 
660
+ /* ARGSUSED */
661
+ 
662
+-void    rfc931(request)
663
+-struct request_info *request;
664
++void    rfc931(rmt_sin, our_sin, dest)
665
++struct sockaddr_in *rmt_sin;
666
++struct sockaddr_in *our_sin;
667
++char   *dest;
668
+ {
669
+-    strcpy(request->user, unknown);
670
++    strcpy(dest, unknown);
671
+ }
672
+ 
673
+ /* check_path - examine accessibility */
674
+diff -Naur tcp_wrappers_7.6/socket.c tcp_wrappers_7.6.gimli/socket.c
675
+--- tcp_wrappers_7.6/socket.c	1997-03-21 12:27:25.000000000 -0600
676
+@@ -76,7 +76,11 @@
677
+ {
678
+     static struct sockaddr_in client;
679
+     static struct sockaddr_in server;
680
++#if !defined (__GLIBC__)
681
+     int     len;
682
++#else /* __GLIBC__ */
683
++    size_t  len;
684
++#endif /* __GLIBC__ */
685
+     char    buf[BUFSIZ];
686
+     int     fd = request->fd;
687
+ 
688
+@@ -224,7 +228,11 @@
689
+ {
690
+     char    buf[BUFSIZ];
691
+     struct sockaddr_in sin;
692
++#if !defined(__GLIBC__)
693
+     int     size = sizeof(sin);
694
++#else /* __GLIBC__ */
695
++    size_t  size = sizeof(sin);
696
++#endif /* __GLIBC__ */
697
+ 
698
+     /*
699
+      * Eat up the not-yet received datagram. Some systems insist on a
700
+diff -Naur tcp_wrappers_7.6/tcpd.8 tcp_wrappers_7.6.gimli/tcpd.8
701
+--- tcp_wrappers_7.6/tcpd.8	1996-02-21 09:39:16.000000000 -0600
702
+@@ -94,7 +94,7 @@
703
+ .PP
704
+ The example assumes that the network daemons live in /usr/etc. On some
705
+ systems, network daemons live in /usr/sbin or in /usr/libexec, or have
706
+-no `in.\' prefix to their name.
707
++no `in.' prefix to their name.
708
+ .SH EXAMPLE 2
709
+ This example applies when \fItcpd\fR expects that the network daemons
710
+ are left in their original place.
711
+@@ -110,26 +110,26 @@
712
+ becomes:
713
+ .sp
714
+ .ti +5
715
+-finger  stream  tcp  nowait  nobody  /some/where/tcpd     in.fingerd
716
++finger  stream  tcp  nowait  nobody  /usr/sbin/tcpd       in.fingerd
717
+ .sp
718
+ .fi
719
+ .PP
720
+ The example assumes that the network daemons live in /usr/etc. On some
721
+ systems, network daemons live in /usr/sbin or in /usr/libexec, the
722
+-daemons have no `in.\' prefix to their name, or there is no userid
723
++daemons have no `in.' prefix to their name, or there is no userid
724
+ field in the inetd configuration file.
725
+ .PP
726
+ Similar changes will be needed for the other services that are to be
727
+-covered by \fItcpd\fR.  Send a `kill -HUP\' to the \fIinetd\fR(8)
728
++covered by \fItcpd\fR.  Send a `kill -HUP' to the \fIinetd\fR(8)
729
+ process to make the changes effective. AIX users may also have to
730
+-execute the `inetimp\' command.
731
++execute the `inetimp' command.
732
+ .SH EXAMPLE 3
733
+ In the case of daemons that do not live in a common directory ("secret"
734
+ or otherwise), edit the \fIinetd\fR configuration file so that it
735
+ specifies an absolute path name for the process name field. For example:
736
+ .nf
737
+ .sp
738
+-    ntalk  dgram  udp  wait  root  /some/where/tcpd  /usr/local/lib/ntalkd
739
++    ntalk  dgram  udp  wait  root  /usr/sbin/tcpd  /usr/sbin/in.ntalkd
740
+ .sp
741
+ .fi
742
+ .PP
743
+diff -Naur tcp_wrappers_7.6/tcpd.h tcp_wrappers_7.6.gimli/tcpd.h
744
+--- tcp_wrappers_7.6/tcpd.h	1996-03-19 09:22:25.000000000 -0600
745
+@@ -4,6 +4,25 @@
746
+   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
747
+   */
748
+ 
749
++#ifndef _TCPWRAPPERS_TCPD_H
750
++#define _TCPWRAPPERS_TCPD_H
751
++
752
++/* someone else may have defined this */
753
++#undef  __P
754
++
755
++/* use prototypes if we have an ANSI C compiler or are using C++ */
756
++#if defined(__STDC__) || defined(__cplusplus)
757
++#define __P(args)       args
758
++#else
759
++#define __P(args)       ()
760
++#endif
761
++
762
++/* Need definitions of struct sockaddr_in and FILE. */
763
++#include <netinet/in.h>
764
++#include <stdio.h>
765
++
766
++__BEGIN_DECLS
767
++
768
+ /* Structure to describe one communications endpoint. */
769
+ 
770
+ #define STRING_LENGTH	128		/* hosts, users, processes */
771
+@@ -25,10 +44,10 @@
772
+     char    pid[10];			/* access via eval_pid(request) */
773
+     struct host_info client[1];		/* client endpoint info */
774
+     struct host_info server[1];		/* server endpoint info */
775
+-    void  (*sink) ();			/* datagram sink function or 0 */
776
+-    void  (*hostname) ();		/* address to printable hostname */
777
+-    void  (*hostaddr) ();		/* address to printable address */
778
+-    void  (*cleanup) ();		/* cleanup function or 0 */
779
++    void  (*sink) __P((int));		/* datagram sink function or 0 */
780
++    void  (*hostname) __P((struct host_info *)); /* address to printable hostname */
781
++    void  (*hostaddr) __P((struct host_info *)); /* address to printable address */
782
++    void  (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */
783
+     struct netconfig *config;		/* netdir handle */
784
+ };
785
+ 
786
+@@ -61,25 +80,30 @@
787
+ /* Global functions. */
788
+ 
789
+ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
790
+-extern void fromhost();			/* get/validate client host info */
791
++extern void fromhost __P((struct request_info *));	/* get/validate client host info */
792
+ #else
793
+ #define fromhost sock_host		/* no TLI support needed */
794
+ #endif
795
+ 
796
+-extern int hosts_access();		/* access control */
797
+-extern void shell_cmd();		/* execute shell command */
798
+-extern char *percent_x();		/* do %<char> expansion */
799
+-extern void rfc931();			/* client name from RFC 931 daemon */
800
+-extern void clean_exit();		/* clean up and exit */
801
+-extern void refuse();			/* clean up and exit */
802
+-extern char *xgets();			/* fgets() on steroids */
803
+-extern char *split_at();		/* strchr() and split */
804
+-extern unsigned long dot_quad_addr();	/* restricted inet_addr() */
805
++extern void shell_cmd __P((char *));	/* execute shell command */
806
++extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do %<char> expansion */
807
++extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */
808
++extern void clean_exit __P((struct request_info *)); /* clean up and exit */
809
++extern void refuse __P((struct request_info *));	/* clean up and exit */
810
++extern char *xgets __P((char *, int, FILE *));	/* fgets() on steroids */
811
++extern char *split_at __P((char *, int));	/* strchr() and split */
812
++extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */
813
+ 
814
+ /* Global variables. */
815
+ 
816
++#ifdef HAVE_WEAKSYMS
817
++extern int allow_severity __attribute__ ((weak)); /* for connection logging */
818
++extern int deny_severity __attribute__ ((weak)); /* for connection logging */
819
++#else
820
+ extern int allow_severity;		/* for connection logging */
821
+ extern int deny_severity;		/* for connection logging */
822
++#endif
823
++
824
+ extern char *hosts_allow_table;		/* for verification mode redirection */
825
+ extern char *hosts_deny_table;		/* for verification mode redirection */
826
+ extern int hosts_access_verbose;	/* for verbose matching mode */
827
+@@ -92,9 +116,14 @@
828
+   */
829
+ 
830
+ #ifdef __STDC__
831
++extern int hosts_access(struct request_info *request);
832
++extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, 
833
++                     char *client_user);
834
+ extern struct request_info *request_init(struct request_info *,...);
835
+ extern struct request_info *request_set(struct request_info *,...);
836
+ #else
837
++extern int hosts_access();
838
++extern int hosts_ctl();
839
+ extern struct request_info *request_init();	/* initialize request */
840
+ extern struct request_info *request_set();	/* update request structure */
841
+ #endif
842
+@@ -117,27 +146,31 @@
843
+   * host_info structures serve as caches for the lookup results.
844
+   */
845
+ 
846
+-extern char *eval_user();		/* client user */
847
+-extern char *eval_hostname();		/* printable hostname */
848
+-extern char *eval_hostaddr();		/* printable host address */
849
+-extern char *eval_hostinfo();		/* host name or address */
850
+-extern char *eval_client();		/* whatever is available */
851
+-extern char *eval_server();		/* whatever is available */
852
++extern char *eval_user __P((struct request_info *));	/* client user */
853
++extern char *eval_hostname __P((struct host_info *));	/* printable hostname */
854
++extern char *eval_hostaddr __P((struct host_info *));	/* printable host address */
855
++extern char *eval_hostinfo __P((struct host_info *));	/* host name or address */
856
++extern char *eval_client __P((struct request_info *));	/* whatever is available */
857
++extern char *eval_server __P((struct request_info *));	/* whatever is available */
858
+ #define eval_daemon(r)	((r)->daemon)	/* daemon process name */
859
+ #define eval_pid(r)	((r)->pid)	/* process id */
860
+ 
861
+ /* Socket-specific methods, including DNS hostname lookups. */
862
+ 
863
+-extern void sock_host();		/* look up endpoint addresses */
864
+-extern void sock_hostname();		/* translate address to hostname */
865
+-extern void sock_hostaddr();		/* address to printable address */
866
++/* look up endpoint addresses */
867
++extern void sock_host __P((struct request_info *));
868
++/* translate address to hostname */
869
++extern void sock_hostname __P((struct host_info *));
870
++/* address to printable address */
871
++extern void sock_hostaddr __P((struct host_info *));
872
++
873
+ #define sock_methods(r) \
874
+ 	{ (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
875
+ 
876
+ /* The System V Transport-Level Interface (TLI) interface. */
877
+ 
878
+ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
879
+-extern void tli_host();			/* look up endpoint addresses etc. */
880
++extern void tli_host __P((struct request_info *));	/* look up endpoint addresses etc. */
881
+ #endif
882
+ 
883
+  /*
884
+@@ -178,7 +211,7 @@
885
+   * behavior.
886
+   */
887
+ 
888
+-extern void process_options();		/* execute options */
889
++extern void process_options __P((char *, struct request_info *)); /* execute options */
890
+ extern int dry_run;			/* verification flag */
891
+ 
892
+ /* Bug workarounds. */
893
+@@ -217,3 +250,7 @@
894
+ #define strtok	my_strtok
895
+ extern char *my_strtok();
896
+ #endif
897
++
898
++__END_DECLS
899
++
900
++#endif /* tcpd.h */
901
+diff -Naur tcp_wrappers_7.6/tcpdchk.c tcp_wrappers_7.6.gimli/tcpdchk.c
902
+--- tcp_wrappers_7.6/tcpdchk.c	1997-02-11 19:13:25.000000000 -0600
903
+@@ -350,6 +350,8 @@
904
+ {
905
+     if (pat[0] == '@') {
906
+ 	tcpd_warn("%s: daemon name begins with \"@\"", pat);
907
++    } else if (pat[0] == '/') {
908
++        tcpd_warn("%s: daemon name begins with \"/\"", pat);
909
+     } else if (pat[0] == '.') {
910
+ 	tcpd_warn("%s: daemon name begins with dot", pat);
911
+     } else if (pat[strlen(pat) - 1] == '.') {
912
+@@ -382,6 +384,8 @@
913
+ {
914
+     if (pat[0] == '@') {			/* @netgroup */
915
+ 	tcpd_warn("%s: user name begins with \"@\"", pat);
916
++    } else if (pat[0] == '/') {
917
++        tcpd_warn("%s: user name begins with \"/\"", pat);
918
+     } else if (pat[0] == '.') {
919
+ 	tcpd_warn("%s: user name begins with dot", pat);
920
+     } else if (pat[strlen(pat) - 1] == '.') {
921
+@@ -402,8 +406,13 @@
922
+ static int check_host(pat)
923
+ char   *pat;
924
+ {
925
++    char    buf[BUFSIZ];
926
+     char   *mask;
927
+     int     addr_count = 1;
928
++    FILE   *fp;
929
++    struct tcpd_context saved_context;
930
++    char   *cp;
931
++    char   *wsp = " \t\r\n";
932
+ 
933
+     if (pat[0] == '@') {			/* @netgroup */
934
+ #ifdef NO_NETGRENT
935
+@@ -422,6 +431,21 @@
936
+ 	tcpd_warn("netgroup support disabled");
937
+ #endif
938
+ #endif
939
++    } else if (pat[0] == '/') {                 /* /path/name */
940
++        if ((fp = fopen(pat, "r")) != 0) {
941
++            saved_context = tcpd_context;
942
++            tcpd_context.file = pat;
943
++            tcpd_context.line = 0;
944
++            while (fgets(buf, sizeof(buf), fp)) {
945
++                tcpd_context.line++;
946
++                for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp))
947
++                    check_host(cp);
948
++            }
949
++            tcpd_context = saved_context;
950
++            fclose(fp);
951
++        } else if (errno != ENOENT) {
952
++            tcpd_warn("open %s: %m", pat);
953
++        }
954
+     } else if (mask = split_at(pat, '/')) {	/* network/netmask */
955
+ 	if (dot_quad_addr(pat) == INADDR_NONE
956
+ 	    || dot_quad_addr(mask) == INADDR_NONE)
957
+diff -Naur tcp_wrappers_7.6/try-from.8 tcp_wrappers_7.6.gimli/try-from.8
958
+--- tcp_wrappers_7.6/try-from.8	1969-12-31 18:00:00.000000000 -0600
959
+@@ -0,0 +1,28 @@
960
++.TH TRY-FROM 8 "21th June 1997" Linux "Linux Programmer's Manual"
961
++.SH NAME
962
++try-from \- test program for the tcp_wrapper
963
++.SH SYNOPSIS
964
++.B try-from
965
++.SH DESCRIPTION
966
++The
967
++.B try-from
968
++command can be called via a remote shell command to find out
969
++if the hostname and address are properly recognized
970
++by the
971
++.B tcp_wrapper
972
++library, if username lookup works, and (SysV only) if the TLI
973
++on top of IP heuristics work. Diagnostics are reported through
974
++.BR syslog (3)
975
++and redirected to stderr.
976
++
977
++Example:
978
++
979
++rsh host /some/where/try-from
980
++
981
++.SH SEE ALSO
982
++.BR hosts_access (5),
983
++.BR hosts_options (5),
984
++.BR tcpd (8)
985
++.SH AUTHOR
986
++Wietse Venema, Eindhoven University of Technology, The Netherlands.
987
++
988
+diff -Naur tcp_wrappers_7.6/weak_symbols.c tcp_wrappers_7.6.gimli/weak_symbols.c
989
+--- tcp_wrappers_7.6/weak_symbols.c	1969-12-31 18:00:00.000000000 -0600
990
+@@ -0,0 +1,11 @@
991
++ /*
992
++  * @(#) weak_symbols.h 1.5 99/12/29 23:50
993
++  * 
994
++  * Author: Anthony Towns <ajt@debian.org>
995
++  */
996
++
997
++#ifdef HAVE_WEAKSYMS
998
++#include <syslog.h>
999
++int deny_severity = LOG_WARNING;
1000
++int allow_severity = SEVERITY; 
1001
++#endif
1002
+diff -Naur tcp_wrappers_7.6/workarounds.c tcp_wrappers_7.6.gimli/workarounds.c
1003
+--- tcp_wrappers_7.6/workarounds.c	1996-03-19 09:22:26.000000000 -0600
1004
+@@ -163,7 +163,11 @@
1005
+ int     fix_getpeername(sock, sa, len)
1006
+ int     sock;
1007
+ struct sockaddr *sa;
1008
++#if !defined(__GLIBC__)
1009
+ int    *len;
1010
++#else /* __GLIBC__ */
1011
++size_t *len;
1012
++#endif /* __GLIBC__ */
1013
+ {
1014
+     int     ret;
1015
+     struct sockaddr_in *sin = (struct sockaddr_in *) sa;
0 1016
new file mode 100644
... ...
@@ -0,0 +1,57 @@
0
+Summary:	TCP/IP daemon wrapper package
1
+Name:		tcp_wrappers
2
+Version:	7.6
3
+Release:	1%{?dist}
4
+License: 	BSD
5
+Group: 		System Environment/Networking
6
+URL: 		ftp://ftp.porcupine.org/pub/security/index.html
7
+Source0: 	ftp://ftp.porcupine.org/pub/security/%{name}_%{version}.tar.gz
8
+%define sha1 tcp_wrappers=61689ec85b80f4ca0560aef3473eccd9e9e80481
9
+Patch0:		http://www.linuxfromscratch.org/patches/blfs/6.3/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch
10
+
11
+%description
12
+The TCP Wrapper package provides daemon wrapper programs that report the name of the client requesting network services and the requested service. 
13
+
14
+%package devel
15
+Summary:	The libraries and header files needed for tcp_wrappers development.
16
+Requires: 	%{name} = %{version}-%{release}
17
+
18
+%description devel
19
+The libraries and header files needed for tcp_wrappers development.
20
+
21
+%prep
22
+%setup -qn %{name}_%{version}
23
+%patch0 -p1
24
+
25
+%build
26
+sed -i -e "s,^extern char \*malloc();,/* & */," scaffold.c &&
27
+make REAL_DAEMON_DIR=%{_sbindir}STYLE=-DPROCESS_OPTIONS linux
28
+
29
+%install
30
+mkdir -p %{buildroot}%{_libdir}
31
+mkdir -p %{buildroot}%{_sbindir}
32
+mkdir -p %{buildroot}%{_mandir}/man{3,5,8}
33
+mkdir -p %{buildroot}%{_includedir}
34
+make DESTDIR=%{buildroot} install 
35
+
36
+%post	-p /sbin/ldconfig
37
+%postun	-p /sbin/ldconfig
38
+
39
+%files
40
+%defattr(-, root, root)
41
+%{_libdir}/*.so.*
42
+%{_libdir}/*.a
43
+%{_sbindir}/*
44
+%{_mandir}/man3/*
45
+%{_mandir}/man5/*
46
+%{_mandir}/man8/*
47
+
48
+%files devel
49
+%defattr(-, root, root)
50
+%{_libdir}/*.so
51
+%{_includedir}/*.h
52
+
53
+%changelog
54
+* Fri Aug 28 2015 Divya Thaluru <dthaluru@vmware.com> 7.6-1
55
+- Initial version
56
+
... ...
@@ -25,7 +25,8 @@
25 25
                 "haveged", "haveged-devel", "vim-extra",
26 26
                 "postgresql", "openjdk", "apr", "apr-util", "httpd", "openvswitch", "eventlog", "syslog-ng", "syslog-ng-devel", "zookeeper", "fuse", "fleet",
27 27
                 "nss-altfiles", "apache-maven", "subversion", "mesos", "python3", "python3-libs", "python3-devel", "python3-tools", "fakeroot-ng", "ctags",
28
-                "libtirpc", "libtirpc-devel", "lsof", "nfs-utils", "cve-check-tool", "flannel", "rpm-build", "dkms", "openssl-perl", "xinetd", "tftp", "tftp-server"]
28
+                "libtirpc", "libtirpc-devel", "lsof", "nfs-utils", "cve-check-tool", "flannel", "rpm-build", "dkms", "openssl-perl", "xinetd", "tftp", "tftp-server",
29
+		"audit","audit-devel","libcap-ng","libcap-ng-devel","tcp_wrappers","tcp_wrappers-devel"]
29 30
 }
30 31
 
31 32