1 |
commit: b87c18c6676bdd262e676eacbc65352e5404bb07 |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 23 20:43:18 2015 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 23 20:44:44 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b87c18c6 |
7 |
|
8 |
sys-apps/xinetd: default to clearing active env |
9 |
|
10 |
It's rare that we want the active shell environment to be passed down |
11 |
to xinetd services, so default to clearing things. If a service wants |
12 |
an env var to be set, they can do so explicitly. |
13 |
|
14 |
sys-apps/xinetd/files/xinetd-2.3.15-config.patch | 22 ++++++++++ |
15 |
sys-apps/xinetd/xinetd-2.3.15-r3.ebuild | 55 ++++++++++++++++++++++++ |
16 |
2 files changed, 77 insertions(+) |
17 |
|
18 |
diff --git a/sys-apps/xinetd/files/xinetd-2.3.15-config.patch b/sys-apps/xinetd/files/xinetd-2.3.15-config.patch |
19 |
new file mode 100644 |
20 |
index 0000000..b362a97 |
21 |
--- /dev/null |
22 |
+++ b/sys-apps/xinetd/files/xinetd-2.3.15-config.patch |
23 |
@@ -0,0 +1,22 @@ |
24 |
+set up some secure defaults: |
25 |
+ - services can only be accessed from localhost |
26 |
+ - sanitize the runtime environment (so root's shell vars don't bleed through) |
27 |
+ |
28 |
+--- contrib/xinetd.conf |
29 |
++++ contrib/xinetd.conf |
30 |
+@@ -22,5 +22,5 @@ |
31 |
+ # |
32 |
+ # no_access = |
33 |
+-# only_from = |
34 |
++ only_from = localhost |
35 |
+ # max_load = 0 |
36 |
+ cps = 50 10 |
37 |
+@@ -35,7 +35,7 @@ defaults |
38 |
+ |
39 |
+ # setup environmental attributes |
40 |
+ # |
41 |
+-# passenv = |
42 |
++ passenv = |
43 |
+ groups = yes |
44 |
+ umask = 002 |
45 |
+ |
46 |
|
47 |
diff --git a/sys-apps/xinetd/xinetd-2.3.15-r3.ebuild b/sys-apps/xinetd/xinetd-2.3.15-r3.ebuild |
48 |
new file mode 100644 |
49 |
index 0000000..7e46776 |
50 |
--- /dev/null |
51 |
+++ b/sys-apps/xinetd/xinetd-2.3.15-r3.ebuild |
52 |
@@ -0,0 +1,55 @@ |
53 |
+# Copyright 1999-2015 Gentoo Foundation |
54 |
+# Distributed under the terms of the GNU General Public License v2 |
55 |
+# $Id$ |
56 |
+ |
57 |
+EAPI="5" |
58 |
+ |
59 |
+inherit eutils flag-o-matic systemd toolchain-funcs |
60 |
+ |
61 |
+DESCRIPTION="powerful replacement for inetd" |
62 |
+HOMEPAGE="http://www.xinetd.org/ https://github.com/xinetd-org/xinetd" |
63 |
+SRC_URI="http://www.xinetd.org/${P}.tar.gz" |
64 |
+ |
65 |
+LICENSE="BSD" |
66 |
+SLOT="0" |
67 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" |
68 |
+IUSE="perl rpc tcpd" |
69 |
+ |
70 |
+DEPEND="tcpd? ( >=sys-apps/tcp-wrappers-7.6-r2 ) |
71 |
+ rpc? ( net-libs/libtirpc:= )" |
72 |
+RDEPEND="${DEPEND} |
73 |
+ perl? ( dev-lang/perl )" |
74 |
+DEPEND="${DEPEND} |
75 |
+ virtual/pkgconfig" |
76 |
+ |
77 |
+src_prepare() { |
78 |
+ epatch "${FILESDIR}"/${PN}-2.3.14-DESTDIR.patch |
79 |
+ epatch "${FILESDIR}"/${PN}-2.3.14-install-contrib.patch |
80 |
+ epatch "${FILESDIR}"/${PN}-2.3.15-config.patch |
81 |
+ epatch "${FILESDIR}"/${PN}-2.3.15-creds.patch #488158 |
82 |
+ find -name Makefile.in -exec sed -i 's:\<ar\>:$(AR):' {} + |
83 |
+} |
84 |
+ |
85 |
+src_configure() { |
86 |
+ if ! use rpc ; then |
87 |
+ append-cppflags -DNO_RPC |
88 |
+ export ac_cv_header_{rpc_{rpc,rpcent,pmap_clnt},netdb}_h=no |
89 |
+ fi |
90 |
+ tc-export AR PKG_CONFIG |
91 |
+ LIBS=$(${PKG_CONFIG} --libs libtirpc) \ |
92 |
+ econf \ |
93 |
+ $(use_with tcpd libwrap) \ |
94 |
+ --with-loadavg |
95 |
+} |
96 |
+ |
97 |
+src_install() { |
98 |
+ emake DESTDIR="${ED}" install install-contrib |
99 |
+ use perl || rm -f "${ED}"/usr/sbin/xconv.pl |
100 |
+ |
101 |
+ newinitd "${FILESDIR}"/xinetd.rc6 xinetd |
102 |
+ newconfd "${FILESDIR}"/xinetd.confd xinetd |
103 |
+ systemd_dounit "${FILESDIR}/${PN}.service" |
104 |
+ |
105 |
+ newdoc contrib/xinetd.conf xinetd.conf.dist.sample |
106 |
+ dodoc AUDIT INSTALL README TODO CHANGELOG |
107 |
+} |