summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/xinetd
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/xinetd')
-rw-r--r--meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch86
-rw-r--r--meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch79
-rw-r--r--meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch112
-rw-r--r--meta/recipes-extended/xinetd/xinetd/xinetd.conf11
-rw-r--r--meta/recipes-extended/xinetd/xinetd/xinetd.default12
-rw-r--r--meta/recipes-extended/xinetd/xinetd/xinetd.init57
-rw-r--r--meta/recipes-extended/xinetd/xinetd_2.3.15.bb56
7 files changed, 413 insertions, 0 deletions
diff --git a/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch b/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch
new file mode 100644
index 0000000000..cd6e6c1078
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch
@@ -0,0 +1,86 @@
1Upstream-Status: Pending [from other distro Debian]
2
3From d588b6530e1382a624898b3f4307f636c72c80a9 Mon Sep 17 00:00:00 2001
4From: Pierre Habouzit <madcoder@debian.org>
5Date: Wed, 28 Nov 2007 10:13:08 +0100
6Subject: [PATCH] Disable services from inetd.conf if a service with the same id exists.
7
8 This way, if a service is enabled in /etc/xinetd* _and_ in
9/etc/inetd.conf, the one (even if disabled) from /etc/xinetd* takes
10precedence.
11
12Signed-off-by: Pierre Habouzit <madcoder@debian.org>
13---
14 xinetd/inet.c | 22 +++++++++++++++++++---
15 1 files changed, 19 insertions(+), 3 deletions(-)
16
17diff --git a/xinetd/inet.c b/xinetd/inet.c
18index 1cb2ba2..8caab45 100644
19--- a/xinetd/inet.c
20+++ b/xinetd/inet.c
21@@ -23,6 +23,8 @@
22 #include "parsesup.h"
23 #include "nvlists.h"
24
25+static psi_h iter ;
26+
27 static int get_next_inet_entry( int fd, pset_h sconfs,
28 struct service_config *defaults);
29
30@@ -32,12 +34,15 @@ void parse_inet_conf_file( int fd, struct configuration *confp )
31 struct service_config *default_config = CNF_DEFAULTS( confp );
32
33 line_count = 0;
34+ iter = psi_create (sconfs);
35
36 for( ;; )
37 {
38 if (get_next_inet_entry(fd, sconfs, default_config) == -2)
39 break;
40 }
41+
42+ psi_destroy(iter);
43 }
44
45 static int get_next_inet_entry( int fd, pset_h sconfs,
46@@ -46,7 +51,7 @@ static int get_next_inet_entry( int fd, pset_h sconfs,
47 char *p;
48 str_h strp;
49 char *line = next_line(fd);
50- struct service_config *scp;
51+ struct service_config *scp, *tmp;
52 unsigned u, i;
53 const char *func = "get_next_inet_entry";
54 char *name = NULL, *rpcvers = NULL, *rpcproto = NULL;
55@@ -405,7 +410,16 @@ static int get_next_inet_entry( int fd, pset_h sconfs,
56 SC_SPECIFY( scp, A_SOCKET_TYPE );
57 SC_SPECIFY( scp, A_WAIT );
58
59- if( ! pset_add(sconfs, scp) )
60+ for ( tmp = SCP( psi_start( iter ) ) ; tmp ; tmp = SCP( psi_next(iter)) ){
61+ if (EQ(SC_ID(scp), SC_ID(tmp))) {
62+ parsemsg(LOG_DEBUG, func, "removing duplicate service %s", SC_NAME(scp));
63+ sc_free(scp);
64+ scp = NULL;
65+ break;
66+ }
67+ }
68+
69+ if( scp && ! pset_add(sconfs, scp) )
70 {
71 out_of_memory( func );
72 pset_destroy(args);
73@@ -414,7 +428,9 @@ static int get_next_inet_entry( int fd, pset_h sconfs,
74 }
75
76 pset_destroy(args);
77- parsemsg( LOG_DEBUG, func, "added service %s", SC_NAME(scp));
78+ if (scp) {
79+ parsemsg( LOG_DEBUG, func, "added service %s", SC_NAME(scp));
80+ }
81 return 0;
82 }
83
84--
851.5.3.6.2040.g15e6
86
diff --git a/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch b/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch
new file mode 100644
index 0000000000..8e59cdcaae
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch
@@ -0,0 +1,79 @@
1Upstream-Status: Pending [from other distro Debian]
2
3From a3410b0bc81ab03a889d9ffc14e351badf8372f1 Mon Sep 17 00:00:00 2001
4From: Pierre Habouzit <madcoder@debian.org>
5Date: Mon, 26 Nov 2007 16:02:04 +0100
6Subject: [PATCH] Various fixes from the previous maintainer.
7
8---
9 xinetd/child.c | 20 +++++++++++++++++---
10 xinetd/service.c | 8 ++++----
11 2 files changed, 21 insertions(+), 7 deletions(-)
12
13diff --git a/xinetd/child.c b/xinetd/child.c
14index 89ee54c..48e9615 100644
15--- a/xinetd/child.c
16+++ b/xinetd/child.c
17@@ -284,6 +284,7 @@ void child_process( struct server *serp )
18 connection_s *cp = SERVER_CONNECTION( serp ) ;
19 struct service_config *scp = SVC_CONF( sp ) ;
20 const char *func = "child_process" ;
21+ int fd, null_fd;
22
23 signal_default_state();
24
25@@ -296,9 +297,22 @@ void child_process( struct server *serp )
26 signals_pending[0] = -1;
27 signals_pending[1] = -1;
28
29- Sclose(0);
30- Sclose(1);
31- Sclose(2);
32+ if ( ( null_fd = open( "/dev/null", O_RDONLY ) ) == -1 )
33+ {
34+ msg( LOG_ERR, func, "open('/dev/null') failed: %m") ;
35+ _exit( 1 ) ;
36+ }
37+
38+ for ( fd = 0 ; fd <= MAX_PASS_FD ; fd++ )
39+ {
40+ if ( fd != null_fd && dup2( null_fd, fd ) == -1 )
41+ {
42+ msg( LOG_ERR, func, "dup2(%d, %d) failed: %m") ;
43+ _exit( 1 ) ;
44+ }
45+ }
46+ if ( null_fd > MAX_PASS_FD )
47+ (void) Sclose( null_fd ) ;
48
49
50 #ifdef DEBUG_SERVER
51diff --git a/xinetd/service.c b/xinetd/service.c
52index 3d68d78..0132d6c 100644
53--- a/xinetd/service.c
54+++ b/xinetd/service.c
55@@ -745,8 +745,8 @@ static status_e failed_service(struct service *sp,
56 return FAILED;
57
58 if ( last == NULL ) {
59- last = SAIN( calloc( 1, sizeof(union xsockaddr) ) );
60- SVC_LAST_DGRAM_ADDR(sp) = (union xsockaddr *)last;
61+ SVC_LAST_DGRAM_ADDR(sp) = SAIN( calloc( 1, sizeof(union xsockaddr) ) );
62+ last = SAIN( SVC_LAST_DGRAM_ADDR(sp) );
63 }
64
65 (void) time( &current_time ) ;
66@@ -772,8 +772,8 @@ static status_e failed_service(struct service *sp,
67 return FAILED;
68
69 if( last == NULL ) {
70- last = SAIN6(calloc( 1, sizeof(union xsockaddr) ) );
71- SVC_LAST_DGRAM_ADDR( sp ) = (union xsockaddr *)last;
72+ SVC_LAST_DGRAM_ADDR(sp) = SAIN6(calloc( 1, sizeof(union xsockaddr) ) );
73+ last = SAIN6(SVC_LAST_DGRAM_ADDR(sp));
74 }
75
76 (void) time( &current_time ) ;
77--
781.5.3.6.2040.g15e6
79
diff --git a/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch b/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch
new file mode 100644
index 0000000000..2365ca123b
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch
@@ -0,0 +1,112 @@
1Upstream-Status: Pending [from other distro Debian]
2
3From f44b218ccc779ab3f4aed072390ccf129d94b58d Mon Sep 17 00:00:00 2001
4From: David Madore <david@pleiades.stars>
5Date: Mon, 24 Mar 2008 12:45:36 +0100
6Subject: [PATCH] xinetd should be able to listen on IPv6 even in -inetd_compat mode
7
8xinetd does not bind to IPv6 addresses (and does not seem to have an
9option to do so) when used in -inetd_compat mode. As current inetd's
10are IPv6-aware, this is a problem: this means xinetd cannot be used as
11a drop-in inetd replacement.
12
13The attached patch is a suggestion: it adds a -inetd_ipv6 global
14option that, if used, causes inetd-compatibility lines to have an
15implicit "IPv6" option. Perhaps this is not the best solution, but
16there should definitely be a way to get inetd.conf to be read in
17IPv6-aware mode.
18---
19 xinetd/confparse.c | 1 +
20 xinetd/inet.c | 17 +++++++++++++++++
21 xinetd/options.c | 3 +++
22 xinetd/xinetd.man | 6 ++++++
23 4 files changed, 27 insertions(+), 0 deletions(-)
24
25diff --git a/xinetd/confparse.c b/xinetd/confparse.c
26index db9f431..d7b0bcc 100644
27--- a/xinetd/confparse.c
28+++ b/xinetd/confparse.c
29@@ -40,6 +40,7 @@
30 #include "inet.h"
31 #include "main.h"
32
33+extern int inetd_ipv6;
34 extern int inetd_compat;
35
36 /*
37diff --git a/xinetd/inet.c b/xinetd/inet.c
38index 8caab45..2e617ae 100644
39--- a/xinetd/inet.c
40+++ b/xinetd/inet.c
41@@ -25,6 +25,8 @@
42
43 static psi_h iter ;
44
45+extern int inetd_ipv6;
46+
47 static int get_next_inet_entry( int fd, pset_h sconfs,
48 struct service_config *defaults);
49
50@@ -360,6 +362,21 @@ static int get_next_inet_entry( int fd, pset_h sconfs,
51 }
52 SC_SERVER_ARGV(scp)[u] = p;
53 }
54+
55+ /* Set the IPv6 flag if we were passed the -inetd_ipv6 option */
56+ if ( inetd_ipv6 )
57+ {
58+ nvp = nv_find_value( service_flags, "IPv6" );
59+ if ( nvp == NULL )
60+ {
61+ parsemsg( LOG_WARNING, func, "inetd.conf - Bad foo %s", name ) ;
62+ pset_destroy(args);
63+ sc_free(scp);
64+ return -1;
65+ }
66+ M_SET(SC_XFLAGS(scp), nvp->value);
67+ }
68+
69 /* Set the reuse flag, as this is the default for inetd */
70 nvp = nv_find_value( service_flags, "REUSE" );
71 if ( nvp == NULL )
72diff --git a/xinetd/options.c b/xinetd/options.c
73index b058b6a..dc2f3a0 100644
74--- a/xinetd/options.c
75+++ b/xinetd/options.c
76@@ -30,6 +30,7 @@ int logprocs_option ;
77 unsigned logprocs_option_arg ;
78 int stayalive_option=0;
79 char *program_name ;
80+int inetd_ipv6 = 0 ;
81 int inetd_compat = 0 ;
82 int dont_fork = 0;
83
84@@ -128,6 +129,8 @@ int opt_recognize( int argc, char *argv[] )
85 fprintf(stderr, "\n");
86 exit(0);
87 }
88+ else if ( strcmp ( &argv[ arg ][ 1 ], "inetd_ipv6" ) == 0 )
89+ inetd_ipv6 = 1;
90 else if ( strcmp ( &argv[ arg ][ 1 ], "inetd_compat" ) == 0 )
91 inetd_compat = 1;
92 }
93diff --git a/xinetd/xinetd.man b/xinetd/xinetd.man
94index c76c3c6..c9dd803 100644
95--- a/xinetd/xinetd.man
96+++ b/xinetd/xinetd.man
97@@ -106,6 +106,12 @@ This option causes xinetd to read /etc/inetd.conf in addition to the
98 standard xinetd config files. /etc/inetd.conf is read after the
99 standard xinetd config files.
100 .TP
101+.BI \-inetd_ipv6
102+This option causes xinetd to bind to IPv6 (AF_INET6) addresses for
103+inetd compatibility lines (see previous option). This only affects
104+how /etc/inetd.conf is interpreted and thus only has any effect if
105+the \-inetd_compat option is also used.
106+.TP
107 .BI \-cc " interval"
108 This option instructs
109 .B xinetd
110--
1111.5.5.rc0.127.gb4337
112
diff --git a/meta/recipes-extended/xinetd/xinetd/xinetd.conf b/meta/recipes-extended/xinetd/xinetd/xinetd.conf
new file mode 100644
index 0000000000..9e6ea2577e
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd/xinetd.conf
@@ -0,0 +1,11 @@
1# Simple configuration file for xinetd
2#
3# Some defaults, and include /etc/xinetd.d/
4
5defaults
6{
7
8
9}
10
11includedir /etc/xinetd.d
diff --git a/meta/recipes-extended/xinetd/xinetd/xinetd.default b/meta/recipes-extended/xinetd/xinetd/xinetd.default
new file mode 100644
index 0000000000..20a38e3f3e
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd/xinetd.default
@@ -0,0 +1,12 @@
1# Default settings for xinetd. This file is sourced by /bin/sh from
2# /etc/init.d/xinetd
3
4# enable xinetd Inetd compat mode
5INETD_COMPAT=Yes
6
7# Options to pass to xinetd
8#
9# -stayalive comes by default : it can be removed if xinetd is expected
10# not to start when no service is configured
11#
12XINETD_OPTS="-stayalive"
diff --git a/meta/recipes-extended/xinetd/xinetd/xinetd.init b/meta/recipes-extended/xinetd/xinetd/xinetd.init
new file mode 100644
index 0000000000..26dbea7415
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd/xinetd.init
@@ -0,0 +1,57 @@
1#!/bin/sh
2#
3# /etc/init.d/xinetd -- script to start and stop xinetd.
4
5if test -f /etc/default/xinetd; then
6 . /etc/default/xinetd
7fi
8
9
10test -x /usr/sbin/xinetd || exit 0
11
12checkportmap () {
13 if grep "^[^ *#]" /etc/xinetd.conf | grep -q 'rpc/'; then
14 if ! rpcinfo -u localhost portmapper >/dev/null 2>&1; then
15 echo
16 echo "WARNING: portmapper inactive - RPC services unavailable!"
17 echo " Commenting out or removing the RPC services from"
18 echo " the /etc/xinetd.conf file will remove this message."
19 echo
20 fi
21 fi
22}
23
24case "$1" in
25 start)
26 checkportmap
27 echo -n "Starting internet superserver: xinetd"
28 start-stop-daemon --start --quiet --background --exec /usr/sbin/xinetd -- -pidfile /var/run/xinetd.pid $XINETD_OPTS
29 echo "."
30 ;;
31 stop)
32 echo -n "Stopping internet superserver: xinetd"
33 start-stop-daemon --stop --signal 3 --quiet --exec /usr/sbin/xinetd
34 echo "."
35 ;;
36 reload)
37 echo -n "Reloading internet superserver configuration: xinetd"
38 start-stop-daemon --stop --signal 1 --quiet --exec /usr/sbin/xinetd
39 echo "."
40 ;;
41 force-reload)
42 echo "$0 force-reload: Force Reload is deprecated"
43 echo -n "Forcefully reloading internet superserver configuration: xinetd"
44 start-stop-daemon --stop --signal 1 --quiet --exec /usr/sbin/xinetd
45 echo "."
46 ;;
47 restart)
48 $0 stop
49 $0 start
50 ;;
51 *)
52 echo "Usage: /etc/init.d/xinetd {start|stop|reload|force-reload|restart}"
53 exit 1
54 ;;
55esac
56
57exit 0
diff --git a/meta/recipes-extended/xinetd/xinetd_2.3.15.bb b/meta/recipes-extended/xinetd/xinetd_2.3.15.bb
new file mode 100644
index 0000000000..797657083e
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd_2.3.15.bb
@@ -0,0 +1,56 @@
1DESCRIPTION = "Highly configurable, modular and secure inetd"
2HOMEPAGE = "http://www.xinetd.org"
3
4# xinetd is a BSD-like license
5# Apple and Gentoo say BSD here.
6LICENSE = "BSD"
7LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=8ad8615198542444f84d28a6cf226dd8"
8
9DEPENDS = ""
10PR = "r2"
11
12SRC_URI = "http://www.xinetd.org/xinetd-${PV}.tar.gz \
13 file://xinetd.init \
14 file://xinetd.conf \
15 file://xinetd.default \
16 file://Various-fixes-from-the-previous-maintainer.patch \
17 file://Disable-services-from-inetd.conf-if-a-service-with-t.patch \
18 file://xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch \
19 "
20
21SRC_URI[md5sum] = "77358478fd58efa6366accae99b8b04c"
22SRC_URI[sha256sum] = "bf4e060411c75605e4dcbdf2ac57c6bd9e1904470a2f91e01ba31b50a80a5be3"
23
24inherit autotools update-rc.d
25
26INITSCRIPT_NAME = "xinetd"
27INITSCRIPT_PARAMS = "defaults"
28
29EXTRA_OECONF="--disable-nls"
30
31PACKAGECONFIG ??= "tcp-wrappers"
32PACKAGECONFIG[tcp-wrappers] = "--with-libwrap,,tcp-wrappers"
33
34do_configure() {
35 # Looks like configure.in is broken, so we are skipping
36 # rebuilding configure and are just using the shipped one
37 ( cd ${S}; gnu-configize --force )
38 oe_runconf
39}
40
41do_install() {
42 # Same here, the Makefile does some really stupid things,
43 # but since we only want two files why not override
44 # do_install from autotools and doing it ourselfs?
45 install -d "${D}${sbindir}"
46 install -d "${D}${sysconfdir}/init.d"
47 install -d "${D}${sysconfdir}/xinetd.d"
48 install -d "${D}${sysconfdir}/default"
49 install -m 644 "${WORKDIR}/xinetd.conf" "${D}${sysconfdir}"
50 install -m 755 "${WORKDIR}/xinetd.init" "${D}${sysconfdir}/init.d/xinetd"
51 install -m 644 "${WORKDIR}/xinetd.default" "${D}${sysconfdir}/default/xinetd"
52 install -m 755 "${B}/xinetd/xinetd" "${D}${sbindir}"
53 install -m 755 "${B}/xinetd/itox" "${D}${sbindir}"
54}
55
56CONFFILES_${PN} = "${sysconfdir}/xinetd.conf"