summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch')
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch
new file mode 100644
index 0000000000..5875b81b2f
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch
@@ -0,0 +1,39 @@
1Upstream-Status: Backport
2
3diff -ruN tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c
4--- tcp_wrappers_7.6.orig/rfc931.c 2004-08-29 18:40:08.000000000 +0200
5+++ tcp_wrappers_7.6/rfc931.c 2004-08-29 18:40:02.000000000 +0200
6@@ -92,6 +92,8 @@
7 char *cp;
8 char *result = unknown;
9 FILE *fp;
10+ unsigned saved_timeout;
11+ struct sigaction nact, oact;
12
13 #ifdef INET6
14 /* address family must be the same */
15@@ -134,7 +136,12 @@
16 */
17
18 if (setjmp(timebuf) == 0) {
19- signal(SIGALRM, timeout);
20+ /* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
21+ saved_timeout = alarm(0);
22+ nact.sa_handler = timeout;
23+ nact.sa_flags = 0;
24+ (void) sigemptyset(&nact.sa_mask);
25+ (void) sigaction(SIGALRM, &nact, &oact);
26 alarm(rfc931_timeout);
27
28 /*
29@@ -223,6 +230,10 @@
30 }
31 alarm(0);
32 }
33+ /* Restore SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
34+ (void) sigaction(SIGALRM, &oact, NULL);
35+ if (saved_timeout > 0)
36+ alarm(saved_timeout);
37 fclose(fp);
38 }
39 STRN_CPY(dest, result, STRING_LENGTH);