[xinetd/f13/master] - Fix build warning about "dereferencing type-punned pointer" - Avoid possible hang while logging an

Vojtěch Vítek vvitek at fedoraproject.org
Thu Apr 21 13:57:50 UTC 2011


commit 42827f5f11c4b0bcbad4f3f133d176d9f6b9fbbf
Author: Vojtech Vitek (V-Teq) <vvitek at redhat.com>
Date:   Thu Apr 21 15:25:09 2011 +0200

    - Fix build warning about "dereferencing type-punned pointer"
    - Avoid possible hang while logging an unexpected signal
    - Let RPC services bind to a specific port

 xinetd-2.3.14-fix-type-punned-ptr.patch |   22 ++++++++++++++++++++++
 xinetd-2.3.14-rpc-specific-port.patch   |   30 ++++++++++++++++++++++++++++++
 xinetd-2.3.14-signal-log-hang.patch     |   27 +++++++++++++++++++++++++++
 xinetd.spec                             |   13 +++++++++++++
 4 files changed, 92 insertions(+), 0 deletions(-)
---
diff --git a/xinetd-2.3.14-fix-type-punned-ptr.patch b/xinetd-2.3.14-fix-type-punned-ptr.patch
new file mode 100644
index 0000000..993169f
--- /dev/null
+++ b/xinetd-2.3.14-fix-type-punned-ptr.patch
@@ -0,0 +1,22 @@
+diff --git a/sensor.c b/sensor.c
+index 09d0877..e65018c 100644
+--- a/xinetd/sensor.c
++++ b/xinetd/sensor.c
+@@ -100,14 +100,15 @@ void process_sensor( const struct service *sp, const union xsockaddr *addr)
+ 	 {
+ 	    /* Here again, eh?...update time stamp. */
+             char *exp_time;
+-	    time_t stored_time;
++	    int stored_time;
+ 
+ 	    item_matched--; /* Is # plus 1, to even get here must be >= 1 */
+             exp_time = pset_pointer( global_no_access_time, item_matched ) ;
+             if (exp_time == NULL)
+                return ;
+ 
+-            if ( parse_base10(exp_time, (int *)&stored_time) )
++            /* FIXME: Parse (long int) instead of (int) prior to possible Y2K38 bug. */
++            if ( parse_base10(exp_time, &stored_time ) )
+             {  /* if never let them off, bypass */
+                if (stored_time != -1)
+                {
diff --git a/xinetd-2.3.14-rpc-specific-port.patch b/xinetd-2.3.14-rpc-specific-port.patch
new file mode 100644
index 0000000..19376fd
--- /dev/null
+++ b/xinetd-2.3.14-rpc-specific-port.patch
@@ -0,0 +1,30 @@
+commit 1b91f7b0f67fba11ea8bbcdddef844656434c53c
+Author: Jeffrey Bastian <jbastian at redhat.com>
+Date:   Tue Aug 17 13:45:20 2010 -0500
+
+    Let RPC services bind to a port
+
+diff --git a/xinetd/service.c b/xinetd/service.c
+index 9f21f93..5d26885 100644
+--- a/xinetd/service.c
++++ b/xinetd/service.c
+@@ -165,6 +165,7 @@ static status_e activate_rpc( struct service *sp )
+    socklen_t              sin_len = sizeof(tsin);
+    unsigned long          vers ;
+    struct service_config *scp = SVC_CONF( sp ) ;
++   uint16_t               service_port = SC_PORT( scp ) ;
+    struct rpc_data       *rdp = SC_RPCDATA( scp ) ;
+    char                  *sid = SC_ID( scp ) ;
+    unsigned               registered_versions = 0 ;
+@@ -181,9 +182,11 @@ static status_e activate_rpc( struct service *sp )
+    }
+    if( SC_IPV4( scp ) ) {
+       tsin.sa_in.sin_family = AF_INET ;
++      tsin.sa_in.sin_port = htons( service_port ) ;
+       sin_len = sizeof(struct sockaddr_in);
+    } else if( SC_IPV6( scp ) ) {
+       tsin.sa_in6.sin6_family = AF_INET6 ;
++      tsin.sa_in6.sin6_port = htons( service_port );
+       sin_len = sizeof(struct sockaddr_in6);
+    }
+ 
diff --git a/xinetd-2.3.14-signal-log-hang.patch b/xinetd-2.3.14-signal-log-hang.patch
new file mode 100644
index 0000000..18fd1a1
--- /dev/null
+++ b/xinetd-2.3.14-signal-log-hang.patch
@@ -0,0 +1,27 @@
+--- a/xinetd/signals.c	2009-05-07 05:56:52.000000000 -0400
++++ b/xinetd/signals.c.new	2009-05-07 05:56:44.000000000 -0400
+@@ -389,9 +390,11 @@
+          break ;
+       
+       default:
+-         msg( LOG_NOTICE, func, "Unexpected signal %s", sig_name( sig ) ) ;
+-         if ( debug.on && sig == SIGINT )
+-            exit( 1 ) ;
++         /* Let my_handler() queue this signal for later logging.
++            Calling msg() and thus syslog() directly here can hang up
++            the process, trying to acquire an already acquired lock,
++            because another syslog() could have been the interrupted code. */
++         my_handler(sig);
+    }
+ }
+ 
+@@ -495,6 +497,9 @@
+          default:
+             msg(LOG_ERR, func, "unexpected signal: %s in signal pipe", 
+                sig_name(sig));
++
++            if ( debug.on && sig == SIGINT )
++               exit( 1 ) ;
+       }
+    }
+ }
diff --git a/xinetd.spec b/xinetd.spec
index 6a20095..b6d2c54 100644
--- a/xinetd.spec
+++ b/xinetd.spec
@@ -40,6 +40,9 @@ Patch15: xinetd-2.3.14-ipv6confusion.patch
 # flood when turning off UDP service
 Patch16: xinetd-2.3.14-udp-reconfig.patch
 Patch17: xinetd-2.3.13-log-crash.patch
+Patch18: xinetd-2.3.14-rpc-specific-port.patch
+Patch19: xinetd-2.3.14-signal-log-hang.patch
+Patch20: xinetd-2.3.14-fix-type-punned-ptr.patch
 
 BuildRequires: autoconf, automake
 BuildRequires: libselinux-devel >= 1.30
@@ -85,6 +88,9 @@ located in the /etc/xinetd.d directory.
 %patch15 -p1 -b .ipv6confusion
 %patch16 -p1 -b .udp-reconfig
 %patch17 -p1 -b .log-crash
+%patch18 -p1 -b .rpc-specific-port
+%patch19 -p1 -b .signal-log-hang
+%patch20 -p1 -b .fix-type-punned-ptr
 
 aclocal
 autoconf
@@ -144,6 +150,13 @@ fi
 %{_mandir}/*/*
 
 %changelog
+- Fix build warning about "dereferencing type-punned pointer"
+  Related: #695674
+- Avoid possible hang while logging an unexpected signal
+  Related: #501604
+- Let RPC services bind to a specific port
+  Related: #624800
+
 * Fri Feb 18 2011 Vojtech Vitek (V-Teq) <vvitek at redhat.com> - 2:2.3.14-33
 - fix crash when application's logfile hit size limit
   Related: #244063


More information about the scm-commits mailing list