summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-03-29 20:58:11 +0000
committerMike Frysinger <vapier@gentoo.org>2014-03-29 20:58:11 +0000
commitca34291a5226f1f21eceaac206975cdf7c69343b (patch)
tree3f628c7a7c724d64934d3878938b9095db1d57cd /net-ftp
parentStable for amd64 wrt bug #505118 (diff)
downloadgentoo-2-ca34291a5226f1f21eceaac206975cdf7c69343b.tar.gz
gentoo-2-ca34291a5226f1f21eceaac206975cdf7c69343b.tar.bz2
gentoo-2-ca34291a5226f1f21eceaac206975cdf7c69343b.zip
Delay root check until after processing the command line.
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
Diffstat (limited to 'net-ftp')
-rw-r--r--net-ftp/oftpd/ChangeLog10
-rw-r--r--net-ftp/oftpd/files/oftpd-0.3.7-delay-root-check.patch30
-rw-r--r--net-ftp/oftpd/oftpd-0.3.7-r9.ebuild50
3 files changed, 88 insertions, 2 deletions
diff --git a/net-ftp/oftpd/ChangeLog b/net-ftp/oftpd/ChangeLog
index 0e61274601d6..e3ebe0385de2 100644
--- a/net-ftp/oftpd/ChangeLog
+++ b/net-ftp/oftpd/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-ftp/oftpd
-# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-ftp/oftpd/ChangeLog,v 1.39 2013/01/23 17:26:57 xmw Exp $
+# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-ftp/oftpd/ChangeLog,v 1.40 2014/03/29 20:58:11 vapier Exp $
+
+*oftpd-0.3.7-r9 (29 Mar 2014)
+
+ 29 Mar 2014; Mike Frysinger <vapier@gentoo.org>
+ +files/oftpd-0.3.7-delay-root-check.patch, +oftpd-0.3.7-r9.ebuild:
+ Delay root check until after processing the command line.
*oftpd-0.3.7-r8 (23 Jan 2013)
diff --git a/net-ftp/oftpd/files/oftpd-0.3.7-delay-root-check.patch b/net-ftp/oftpd/files/oftpd-0.3.7-delay-root-check.patch
new file mode 100644
index 000000000000..56ab51e4d6c3
--- /dev/null
+++ b/net-ftp/oftpd/files/oftpd-0.3.7-delay-root-check.patch
@@ -0,0 +1,30 @@
+check for root after processing args so non-root can run --help
+
+--- a/src/oftpd.c
++++ b/src/oftpd.c
+@@ -56,12 +56,6 @@ int main(int argc, char *argv[])
+ exe_name = argv[0];
+ }
+
+- /* verify we're running as root */
+- if (geteuid() != 0) {
+- fprintf(stderr, "%s: program needs root permission to run\n", exe_name);
+- exit(1);
+- }
+-
+ /* default command-line arguments */
+ port = FTP_PORT;
+ user_ptr = NULL;
+@@ -187,6 +181,12 @@ int main(int argc, char *argv[])
+ exit(1);
+ }
+
++ /* verify we're running as root */
++ if (geteuid() != 0) {
++ fprintf(stderr, "%s: program needs root permission to run\n", exe_name);
++ exit(1);
++ }
++
+ /* become a daemon */
+ if (detach) {
+ daemonize();
diff --git a/net-ftp/oftpd/oftpd-0.3.7-r9.ebuild b/net-ftp/oftpd/oftpd-0.3.7-r9.ebuild
new file mode 100644
index 000000000000..56645a533023
--- /dev/null
+++ b/net-ftp/oftpd/oftpd-0.3.7-r9.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-ftp/oftpd/oftpd-0.3.7-r9.ebuild,v 1.1 2014/03/29 20:58:11 vapier Exp $
+
+EAPI=4
+
+inherit autotools eutils
+
+DESCRIPTION="Secure, small, anonymous only ftpd"
+HOMEPAGE="http://www.time-travellers.org/oftpd"
+SRC_URI="http://www.time-travellers.org/oftpd/${P}.tar.gz
+ ftp://ftp.deepspace6.net/pub/ds6/sources/${PN}/${PN}-0.3.6-ipv6rel2.patch.gz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="ipv6"
+
+DEPEND="net-ftp/ftpbase"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ cd "${WORKDIR}" || die
+ epatch "${FILESDIR}"/oftpd-0.3.7-ipv6rel2-0.3.6-to-0.3.7.patch
+
+ cd "${S}" || die
+ epatch "${WORKDIR}"/${PN}-0.3.6-ipv6rel2.patch
+ epatch "${FILESDIR}"/${PN}-0.3.7-delay-root-check.patch
+
+ # Don't crash when using an unsupported address family, #159178.
+ # updated in bug #157005
+ epatch "${FILESDIR}"/${P}-family-1.patch
+
+ # htons patch #371963
+ epatch "${FILESDIR}"/${P}-htons.patch
+
+ epatch "${FILESDIR}"/${P}-unistd.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf --bindir=/usr/sbin $(use_enable ipv6)
+}
+
+src_install() {
+ default
+ keepdir /home/ftp
+ newinitd "${FILESDIR}"/init.d.oftpd-r7 oftpd
+ newconfd "${FILESDIR}"/conf.d.oftpd-r7 oftpd
+}