home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.unix
- From: panos@cs.colorado.edu (Panos Tsirigotis)
- Subject: v26i299: xinetd-2.1.1 - inetd replacement with access control and logging, Patch01
- Sender: unix-sources-moderator@gw.home.vix.com
- Approved: vixie@gw.home.vix.com
-
- Submitted-By: panos@cs.colorado.edu (Panos Tsirigotis)
- Posting-Number: Volume 26, Issue 299
- Archive-Name: xinetd-2.1.1/patch01
-
-
- 1. What this patch fixes
-
- From the CHANGELOG file:
- 1) xinetd would request a port number for unlisted RPC services
- One could get around this by simply specifying the port attribute
- for the service; the specified value would be ignored anyway.
- 2) xinetd initialization might fail sometimes in function msg_init()
- syslog logging was specified (i.e. the option -syslog was used)
- The cause of this bug was that the
- xlog_control( xlog, XLOG_GETFD, &fd )
- operation will not fail for xlogs connected to syslog and
- the value of 'fd' would be used in the subsequent fcntl(). That
- value is arbitrary since 'fd' is a local variable.
- If 'fd' did not happen to refer to an open descriptor, the program
- would terminate since the fcntl() would fail (btw, the success
- of the fcntl() call would be harmless if 'fd' happened to
- refer to an open descriptor).
-
-
- 2. How to apply this patch
-
- Cd to the directory that contains the xinetd source and use the
- command:
- patch < "name of this file"
- This patch will modify the files
- Makefile
- CHANGELOG
- msg.c
- confparse.c
-
- The version variable in the Makefile will be changed to 2.1.2
- You will need to recompile xinetd after applying this patch.
- The accompanying libraries are *not* affected by this patch.
-
-
-
- *** /tmp/old/CHANGELOG Sat Jul 3 13:35:58 1993
- --- CHANGELOG Sat Jul 3 13:22:58 1993
- ***************
- *** 70,72 ****
- --- 70,89 ----
- 2.1.1:
- xinetd produces more meaningful messages if it can't start logging
-
- + 2.1.2:
- + Fixed 2 bugs:
- + 1) xinetd would request a port number for unlisted RPC services
- + One could get around this by simply specifying the port attribute
- + for the service; the specified value would be ignored anyway.
- + 2) xinetd initialization might fail sometimes in function msg_init()
- + syslog logging was specified (i.e. the option -syslog was used)
- + The cause of this bug was that the
- + xlog_control( xlog, XLOG_GETFD, &fd )
- + operation will not fail for xlogs connected to syslog and
- + the value of 'fd' would be used in the subsequent fcntl(). That
- + value is arbitrary since 'fd' is a local variable.
- + If 'fd' did not happen to refer to an open descriptor, the program
- + would terminate since the fcntl() would fail (btw, the success
- + of the fcntl() call would be harmless if 'fd' happened to
- + refer to an open descriptor).
- +
- *** /tmp/old/Makefile Sat Jul 3 13:36:29 1993
- --- Makefile Sat Jul 3 13:12:38 1993
- ***************
- *** 21,27 ****
- # The following variables must be set by you
- #
- NAME = xinetd
- ! VERSION = 2.1.1
-
- #
- # Possible flags that can be defined in DEFS:
- --- 21,27 ----
- # The following variables must be set by you
- #
- NAME = xinetd
- ! VERSION = 2.1.2
-
- #
- # Possible flags that can be defined in DEFS:
- *** /tmp/old/confparse.c Sat Jul 3 13:36:29 1993
- --- confparse.c Sat Jul 3 13:07:37 1993
- ***************
- *** 207,213 ****
- --- 207,216 ----
-
- if ( SC_IS_RPC( scp ) )
- if ( SC_IS_UNLISTED( scp ) )
- + {
- M_OR( must_specify, must_specify, NECESSARY_ATTRS_RPC_UNLISTED ) ;
- + M_CLEAR( must_specify, A_PORT ) ;
- + }
- else
- M_OR( must_specify, must_specify, NECESSARY_ATTRS_RPC_LISTED ) ;
-
- ***************
- *** 215,221 ****
- * Check if all necessary attributes have been specified
- *
- * NOTE: None of the necessary attributes can belong to "defaults"
- ! * This is why we use the sc_attributes_specified mask.
- */
- M_AND( necessary_and_specified,
- scp->sc_specified_attributes, must_specify ) ;
- --- 218,225 ----
- * Check if all necessary attributes have been specified
- *
- * NOTE: None of the necessary attributes can belong to "defaults"
- ! * This is why we use the sc_attributes_specified mask instead
- ! * of the sc_attributes_present mask.
- */
- M_AND( necessary_and_specified,
- scp->sc_specified_attributes, must_specify ) ;
- *** /tmp/old/msg.c Sat Jul 3 13:36:29 1993
- --- msg.c Sat Jul 3 13:10:37 1993
- ***************
- *** 97,103 ****
- return( "unknown reason" ) ;
- }
-
- ! if ( xlog_control( xh, XLOG_GETFD, &fd ) == XLOG_ENOERROR )
- {
- if ( fcntl( fd, F_SETFD, 1 ) == -1 )
- {
- --- 97,109 ----
- return( "unknown reason" ) ;
- }
-
- ! /*
- ! * XXX: we shouldn't have to check the xlog type.
- ! * xlog_control should not succeed if the undelying logging
- ! * object does not support the XLOG_GETFD operation.
- ! */
- ! if ( type_of_xlog == XLOG_FILELOG &&
- ! xlog_control( xh, XLOG_GETFD, &fd ) == XLOG_ENOERROR )
- {
- if ( fcntl( fd, F_SETFD, 1 ) == -1 )
- {
-