- added restore_sigalarm and siglongjmp patches from Debian, fixes #205129

This commit is contained in:
Tomas Janousek 2007-04-16 10:54:34 +00:00
parent cb39a2a78f
commit b3e2e257d0
3 changed files with 75 additions and 1 deletions

View File

@ -0,0 +1,37 @@
diff -ruN tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c
--- tcp_wrappers_7.6.orig/rfc931.c 2004-08-29 18:40:08.000000000 +0200
+++ tcp_wrappers_7.6/rfc931.c 2004-08-29 18:40:02.000000000 +0200
@@ -92,6 +92,8 @@
char *cp;
char *result = unknown;
FILE *fp;
+ unsigned saved_timeout;
+ struct sigaction nact, oact;
#ifdef INET6
/* address family must be the same */
@@ -134,7 +136,12 @@
*/
if (setjmp(timebuf) == 0) {
- signal(SIGALRM, timeout);
+ /* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
+ saved_timeout = alarm(0);
+ nact.sa_handler = timeout;
+ nact.sa_flags = 0;
+ (void) sigemptyset(&nact.sa_mask);
+ (void) sigaction(SIGALRM, &nact, &oact);
alarm(rfc931_timeout);
/*
@@ -223,6 +230,10 @@
}
alarm(0);
}
+ /* Restore SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
+ (void) sigaction(SIGALRM, &oact, NULL);
+ if (saved_timeout > 0)
+ alarm(saved_timeout);
fclose(fp);
}
STRN_CPY(dest, result, STRING_LENGTH);

View File

@ -0,0 +1,30 @@
diff -ruNp tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c
--- tcp_wrappers_7.6.orig/rfc931.c 2004-08-29 18:42:25.000000000 +0200
+++ tcp_wrappers_7.6/rfc931.c 2004-08-29 18:41:04.000000000 +0200
@@ -33,7 +33,7 @@ static char sccsid[] = "@(#) rfc931.c 1.
int rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */
-static jmp_buf timebuf;
+static sigjmp_buf timebuf;
/* fsocket - open stdio stream on top of socket */
@@ -62,7 +62,7 @@ int protocol;
static void timeout(sig)
int sig;
{
- longjmp(timebuf, sig);
+ siglongjmp(timebuf, sig);
}
/* rfc931 - return remote user name, given socket structures */
@@ -135,7 +135,7 @@ char *dest;
* Set up a timer so we won't get stuck while waiting for the server.
*/
- if (setjmp(timebuf) == 0) {
+ if (sigsetjmp(timebuf, 1) == 0) {
/* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
saved_timeout = alarm(0);
nact.sa_handler = timeout;

View File

@ -1,7 +1,7 @@
Summary: A security tool which acts as a wrapper for TCP daemons. Summary: A security tool which acts as a wrapper for TCP daemons.
Name: tcp_wrappers Name: tcp_wrappers
Version: 7.6 Version: 7.6
Release: 43%{?dist} Release: 44%{?dist}
%define LIB_MAJOR 0 %define LIB_MAJOR 0
%define LIB_MINOR 7 %define LIB_MINOR 7
@ -28,6 +28,8 @@ Patch14: tcp_wrappers-7.6-ldflags.patch
Patch15: tcp_wrappers-7.6-fix_sig-bug141110.patch Patch15: tcp_wrappers-7.6-fix_sig-bug141110.patch
Patch16: tcp_wrappers-7.6-162412.patch Patch16: tcp_wrappers-7.6-162412.patch
Patch17: tcp_wrappers-7.6-220015.patch Patch17: tcp_wrappers-7.6-220015.patch
Patch18: tcp_wrappers-7.6-restore_sigalarm.patch
Patch19: tcp_wrappers-7.6-siglongjmp.patch
# required by sin_scope_id in ipv6 patch # required by sin_scope_id in ipv6 patch
BuildRequires: glibc-devel >= 2.2 BuildRequires: glibc-devel >= 2.2
BuildRoot: %{_tmppath}/%{name}-root BuildRoot: %{_tmppath}/%{name}-root
@ -81,6 +83,8 @@ develop applications with tcp_wrappers support.
%patch15 -p1 -b .fix_sig %patch15 -p1 -b .fix_sig
%patch16 -p1 -b .162412 %patch16 -p1 -b .162412
%patch17 -p1 -b .220015 %patch17 -p1 -b .220015
%patch18 -p1 -b .restore_sigalarm
%patch19 -p1 -b .siglongjmp
%build %build
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fPIC -DPIC -D_REENTRANT -DHAVE_STRERROR" LDFLAGS="-pie" MAJOR=%{LIB_MAJOR} MINOR=%{LIB_MINOR} REL=%{LIB_REL} linux make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fPIC -DPIC -D_REENTRANT -DHAVE_STRERROR" LDFLAGS="-pie" MAJOR=%{LIB_MAJOR} MINOR=%{LIB_MINOR} REL=%{LIB_REL} linux
@ -137,6 +141,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_mandir}/man3/* %{_mandir}/man3/*
%changelog %changelog
* Mon Apr 16 2007 Tomas Janousek <tjanouse@redhat.com> - 7.6-44
- added restore_sigalarm and siglongjmp patches from Debian, fixes #205129
* Fri Mar 09 2007 Tomas Janousek <tjanouse@redhat.com> - 7.6-43 * Fri Mar 09 2007 Tomas Janousek <tjanouse@redhat.com> - 7.6-43
- resolve hostnames in hosts.{allow,deny}, should fix a bunch of issues with - resolve hostnames in hosts.{allow,deny}, should fix a bunch of issues with
IPv4/6 IPv4/6