home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume27 / xinetd-2.1.1 / patch03 < prev    next >
Text File  |  1994-03-29  |  3KB  |  117 lines

  1. Newsgroups: comp.sources.unix
  2. From: panos@cs.colorado.edu (Panos Tsirigotis)
  3. Subject: v27i209: xinetd-2.1.1 - inetd replacement with access control and logging, Patch03
  4. Sender: unix-sources-moderator@gw.home.vix.com
  5. Approved: vixie@gw.home.vix.com
  6.  
  7. Submitted-By: panos@cs.colorado.edu (Panos Tsirigotis)
  8. Posting-Number: Volume 27, Issue 209
  9. Archive-Name: xinetd-2.1.1/patch03
  10.  
  11. 1. What this patch fixes
  12.  
  13. >From the CHANGELOG file:
  14.       1) in dgram_echo(), sin_len was not being set before the invocation of
  15.          recvfrom
  16.       2) in finger_shutdown(), it was possible for Srdline() to return NULL
  17.          (if the remote end would close the socket without sending anything).
  18.          If the RECORD option was set in the log_on_failure flags, this
  19.          would cause the forked xinetd process which did the recording to
  20.          die since it would try to dereference a NULL pointer.
  21.  
  22.  
  23.  
  24. 2. How to apply this patch
  25.  
  26. Cd to the xinetd directory and use the command:
  27.     patch < "name of this file"
  28. This patch will modify the files
  29.     Makefile
  30.     CHANGELOG
  31.     builtins.c
  32.     shutdown.c
  33.  
  34. The VERSION variable in the Makefile will be changed to 2.1.4.
  35. You will need to recompile xinetd after applying this patch.
  36. The accompanying libraries are *not* affected by this patch.
  37.  
  38.  
  39.  
  40. Prereq: 2.1.3
  41.  
  42. *** /tmp/p/xinetd.old/Makefile    Sat Jan 22 13:30:38 1994
  43. --- Makefile    Sat Jan 22 13:45:03 1994
  44. ***************
  45. *** 22,28 ****
  46.   #
  47.   
  48.   NAME                    = xinetd
  49. ! VERSION                = 2.1.3
  50.   
  51.   #
  52.   # Possible flags that can be defined in DEFS:
  53. --- 22,28 ----
  54.   #
  55.   
  56.   NAME                    = xinetd
  57. ! VERSION                = 2.1.4
  58.   
  59.   #
  60.   # Possible flags that can be defined in DEFS:
  61. *** /tmp/p/xinetd.old/CHANGELOG    Sat Jan 22 13:30:32 1994
  62. --- CHANGELOG    Sat Jan 22 13:45:01 1994
  63. ***************
  64. *** 96,98 ****
  65. --- 96,108 ----
  66.           A work around for the bug would be to use the factorized address 
  67.           notation (for example, 128.138.45.{3})
  68.   
  69. + 2.1.4:
  70. +     Bug fixes:
  71. +         1) in dgram_echo(), sin_len was not being set before the invocation of
  72. +             recvfrom
  73. +         2) in finger_shutdown(), it was possible for Srdline() to return NULL
  74. +             (if the remote end would close the socket without sending anything).
  75. +             If the RECORD option was set in the log_on_failure flags, this
  76. +             would cause the forked xinetd process which did the recording to
  77. +             die since it would try to dereference a NULL pointer.
  78. *** /tmp/p/xinetd.old/builtins.c    Sat Jan 22 13:30:38 1994
  79. --- builtins.c    Sat Jan 22 13:45:03 1994
  80. ***************
  81. *** 126,133 ****
  82.   {
  83.       char                        buf[ DATAGRAM_SIZE ] ;
  84.       struct sockaddr_in    sin ;
  85. -     int                        sin_len ;
  86.       int                        cc ;
  87.       int                        descriptor = SERVER_FD( serp ) ;
  88.   
  89.       cc = recvfrom( descriptor, buf, sizeof( buf ), 0, SA( &sin ), &sin_len ) ;
  90. --- 126,133 ----
  91.   {
  92.       char                        buf[ DATAGRAM_SIZE ] ;
  93.       struct sockaddr_in    sin ;
  94.       int                        cc ;
  95. +     int                        sin_len = sizeof( sin ) ;
  96.       int                        descriptor = SERVER_FD( serp ) ;
  97.   
  98.       cc = recvfrom( descriptor, buf, sizeof( buf ), 0, SA( &sin ), &sin_len ) ;
  99. *** /tmp/p/xinetd.old/shutdown.c    Sat Jan 22 13:30:38 1994
  100. --- shutdown.c    Sat Jan 22 13:45:04 1994
  101. ***************
  102. *** 468,473 ****
  103. --- 468,479 ----
  104.           return ;
  105.       
  106.       line = Srdline( sd ) ;
  107. +     if ( line == NULL )
  108. +     {
  109. +         *pp = "EMPTY-LINE" ;
  110. +         return ;
  111. +     }
  112.       line_len = SIOLINELEN( sd ) ;
  113.   
  114.       if ( line_len > 0 && line[ line_len-1 ] == '\r' )
  115.