home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / xinetd21 / patch01 < prev    next >
Encoding:
Text File  |  1993-07-19  |  4.9 KB  |  150 lines

  1. Newsgroups: comp.sources.unix
  2. From: panos@cs.colorado.edu (Panos Tsirigotis)
  3. Subject: v26i299: xinetd-2.1.1 - inetd replacement with access control and logging, Patch01
  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 26, Issue 299
  9. Archive-Name: xinetd-2.1.1/patch01
  10.  
  11.  
  12. 1. What this patch fixes
  13.  
  14. From the CHANGELOG file:
  15.       1) xinetd would request a port number for unlisted RPC services
  16.          One could get around this by simply specifying the port attribute
  17.          for the service; the specified value would be ignored anyway.
  18.       2) xinetd initialization might fail sometimes in function msg_init()
  19.          syslog logging was specified (i.e. the option -syslog was used)
  20.          The cause of this bug was that the
  21.             xlog_control( xlog, XLOG_GETFD, &fd )
  22.          operation will not fail for xlogs connected to syslog and
  23.          the value of 'fd' would be used in the subsequent fcntl(). That
  24.          value is arbitrary since 'fd' is a local variable.
  25.          If 'fd' did not happen to refer to an open descriptor, the program
  26.          would terminate since the fcntl() would fail (btw, the success
  27.          of the fcntl() call would be harmless if 'fd' happened to
  28.          refer to an open descriptor).
  29.  
  30.  
  31. 2. How to apply this patch
  32.  
  33. Cd to the directory that contains the xinetd source and use the
  34. command:
  35.     patch < "name of this file"
  36. This patch will modify the files
  37.    Makefile
  38.    CHANGELOG
  39.    msg.c
  40.    confparse.c
  41.  
  42. The version variable in the Makefile will be changed to 2.1.2
  43. You will need to recompile xinetd after applying this patch.
  44. The accompanying libraries are *not* affected by this patch.
  45.  
  46.  
  47.  
  48. *** /tmp/old/CHANGELOG    Sat Jul  3 13:35:58 1993
  49. --- CHANGELOG    Sat Jul  3 13:22:58 1993
  50. ***************
  51. *** 70,72 ****
  52. --- 70,89 ----
  53.   2.1.1:
  54.       xinetd produces more meaningful messages if it can't start logging
  55.   
  56. + 2.1.2:
  57. +     Fixed 2 bugs:
  58. +         1) xinetd would request a port number for unlisted RPC services
  59. +             One could get around this by simply specifying the port attribute
  60. +             for the service; the specified value would be ignored anyway.
  61. +         2) xinetd initialization might fail sometimes in function msg_init()
  62. +             syslog logging was specified (i.e. the option -syslog was used)
  63. +             The cause of this bug was that the 
  64. +                 xlog_control( xlog, XLOG_GETFD, &fd ) 
  65. +             operation will not fail for xlogs connected to syslog and
  66. +             the value of 'fd' would be used in the subsequent fcntl(). That
  67. +             value is arbitrary since 'fd' is a local variable.
  68. +             If 'fd' did not happen to refer to an open descriptor, the program 
  69. +             would terminate since the fcntl() would fail (btw, the success
  70. +             of the fcntl() call would be harmless if 'fd' happened to
  71. +             refer to an open descriptor).
  72. *** /tmp/old/Makefile    Sat Jul  3 13:36:29 1993
  73. --- Makefile    Sat Jul  3 13:12:38 1993
  74. ***************
  75. *** 21,27 ****
  76.   # The following variables must be set by you
  77.   #
  78.   NAME                    = xinetd
  79. ! VERSION                = 2.1.1
  80.   
  81.   #
  82.   # Possible flags that can be defined in DEFS:
  83. --- 21,27 ----
  84.   # The following variables must be set by you
  85.   #
  86.   NAME                    = xinetd
  87. ! VERSION                = 2.1.2
  88.   
  89.   #
  90.   # Possible flags that can be defined in DEFS:
  91. *** /tmp/old/confparse.c    Sat Jul  3 13:36:29 1993
  92. --- confparse.c    Sat Jul  3 13:07:37 1993
  93. ***************
  94. *** 207,213 ****
  95. --- 207,216 ----
  96.   
  97.       if ( SC_IS_RPC( scp ) )
  98.           if ( SC_IS_UNLISTED( scp ) )
  99. +         {
  100.               M_OR( must_specify, must_specify, NECESSARY_ATTRS_RPC_UNLISTED ) ;
  101. +             M_CLEAR( must_specify, A_PORT ) ;
  102. +         }
  103.           else
  104.               M_OR( must_specify, must_specify, NECESSARY_ATTRS_RPC_LISTED ) ;
  105.   
  106. ***************
  107. *** 215,221 ****
  108.        * Check if all necessary attributes have been specified
  109.        *
  110.        * NOTE: None of the necessary attributes can belong to "defaults"
  111. !      *            This is why we use the sc_attributes_specified mask.
  112.        */
  113.       M_AND( necessary_and_specified,
  114.                           scp->sc_specified_attributes, must_specify ) ;
  115. --- 218,225 ----
  116.        * Check if all necessary attributes have been specified
  117.        *
  118.        * NOTE: None of the necessary attributes can belong to "defaults"
  119. !      *            This is why we use the sc_attributes_specified mask instead
  120. !      *            of the sc_attributes_present mask.
  121.        */
  122.       M_AND( necessary_and_specified,
  123.                           scp->sc_specified_attributes, must_specify ) ;
  124. *** /tmp/old/msg.c    Sat Jul  3 13:36:29 1993
  125. --- msg.c    Sat Jul  3 13:10:37 1993
  126. ***************
  127. *** 97,103 ****
  128.               return( "unknown reason" ) ;
  129.       }
  130.       
  131. !     if ( xlog_control( xh, XLOG_GETFD, &fd ) == XLOG_ENOERROR )
  132.       {
  133.           if ( fcntl( fd, F_SETFD, 1 ) == -1 )
  134.           {
  135. --- 97,109 ----
  136.               return( "unknown reason" ) ;
  137.       }
  138.       
  139. !     /*
  140. !      * XXX:    we shouldn't have to check the xlog type.
  141. !      *            xlog_control should not succeed if the undelying logging
  142. !      *            object does not support the XLOG_GETFD operation.
  143. !      */
  144. !     if ( type_of_xlog == XLOG_FILELOG &&
  145. !                 xlog_control( xh, XLOG_GETFD, &fd ) == XLOG_ENOERROR )
  146.       {
  147.           if ( fcntl( fd, F_SETFD, 1 ) == -1 )
  148.           {
  149.