OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.7 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../tcp_wrappers/0021-tcp_wrappers-7.6-restore-sigalarm.patch
  5. # Copyright (C) 2011 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. diff -ruN tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c
  17. --- tcp_wrappers_7.6.orig/rfc931.c 2004-08-29 18:40:08.000000000 +0200
  18. +++ tcp_wrappers_7.6/rfc931.c 2004-08-29 18:40:02.000000000 +0200
  19. @@ -92,6 +92,8 @@
  20. char *cp;
  21. char *result = unknown;
  22. FILE *fp;
  23. + unsigned saved_timeout;
  24. + struct sigaction nact, oact;
  25. #ifdef INET6
  26. /* address family must be the same */
  27. @@ -134,7 +136,12 @@
  28. */
  29. if (setjmp(timebuf) == 0) {
  30. - signal(SIGALRM, timeout);
  31. + /* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
  32. + saved_timeout = alarm(0);
  33. + nact.sa_handler = timeout;
  34. + nact.sa_flags = 0;
  35. + (void) sigemptyset(&nact.sa_mask);
  36. + (void) sigaction(SIGALRM, &nact, &oact);
  37. alarm(rfc931_timeout);
  38. /*
  39. @@ -223,6 +230,10 @@
  40. }
  41. alarm(0);
  42. }
  43. + /* Restore SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
  44. + (void) sigaction(SIGALRM, &oact, NULL);
  45. + if (saved_timeout > 0)
  46. + alarm(saved_timeout);
  47. fclose(fp);
  48. }
  49. STRN_CPY(dest, result, STRING_LENGTH);