diff options
author | Thilo Bangert <bangert@gentoo.org> | 2007-02-19 21:56:08 +0000 |
---|---|---|
committer | Thilo Bangert <bangert@gentoo.org> | 2007-02-19 21:56:08 +0000 |
commit | 5b5a05f59ba9dddef697c8a6715773858ec9ce4e (patch) | |
tree | d622b032d183d5c2ee17753d2d4110c67e712332 /net-misc/openntpd | |
parent | 2.1.2-r10 revbump. (diff) | |
download | gentoo-2-5b5a05f59ba9dddef697c8a6715773858ec9ce4e.tar.gz gentoo-2-5b5a05f59ba9dddef697c8a6715773858ec9ce4e.tar.bz2 gentoo-2-5b5a05f59ba9dddef697c8a6715773858ec9ce4e.zip |
add patch to fix bug #122912
(Portage version: 2.1.1-r2)
Diffstat (limited to 'net-misc/openntpd')
-rw-r--r-- | net-misc/openntpd/ChangeLog | 11 | ||||
-rw-r--r-- | net-misc/openntpd/files/digest-openntpd-3.9_p1-r1 | 3 | ||||
-rw-r--r-- | net-misc/openntpd/files/openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff | 43 | ||||
-rw-r--r-- | net-misc/openntpd/openntpd-3.9_p1-r1.ebuild | 54 |
4 files changed, 109 insertions, 2 deletions
diff --git a/net-misc/openntpd/ChangeLog b/net-misc/openntpd/ChangeLog index 1c538699d3d5..7c5c3b802c2e 100644 --- a/net-misc/openntpd/ChangeLog +++ b/net-misc/openntpd/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-misc/openntpd -# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/openntpd/ChangeLog,v 1.27 2006/08/11 17:40:27 bangert Exp $ +# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/openntpd/ChangeLog,v 1.28 2007/02/19 21:56:08 bangert Exp $ + +*openntpd-3.9_p1-r1 (19 Feb 2007) + + 19 Feb 2007; Thilo Bangert <bangert@gentoo.org> + +files/openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff, + +openntpd-3.9_p1-r1.ebuild: + add patch to fix bug #122912 11 Aug 2006; Thilo Bangert <bangert@gentoo.org> openntpd-3.7_p1.ebuild, openntpd-3.9_p1.ebuild: diff --git a/net-misc/openntpd/files/digest-openntpd-3.9_p1-r1 b/net-misc/openntpd/files/digest-openntpd-3.9_p1-r1 new file mode 100644 index 000000000000..0fd0491f53c8 --- /dev/null +++ b/net-misc/openntpd/files/digest-openntpd-3.9_p1-r1 @@ -0,0 +1,3 @@ +MD5 afc34175f38d08867c1403d9008600b3 openntpd-3.9p1.tar.gz 152700 +RMD160 c348004116c78810daa9451f15abcc26788949a8 openntpd-3.9p1.tar.gz 152700 +SHA256 83dd7c1e8ec8b4567afe49af539271b5a73562fb7a3ca51df73eccba89ec8c49 openntpd-3.9p1.tar.gz 152700 diff --git a/net-misc/openntpd/files/openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff b/net-misc/openntpd/files/openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff new file mode 100644 index 000000000000..adca55614a49 --- /dev/null +++ b/net-misc/openntpd/files/openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff @@ -0,0 +1,43 @@ +diff -Naur openntpd-3.9p1/client.c openntpd-3.9p1-fixed/client.c +--- openntpd-3.9p1/client.c 2006-05-14 07:29:21.000000000 +0200 ++++ openntpd-3.9p1-fixed/client.c 2006-10-11 02:41:44.000000000 +0200 +@@ -116,6 +116,7 @@ + client_query(struct ntp_peer *p) + { + int tos = IPTOS_LOWDELAY; ++ int result; + + if (p->addr == NULL && client_nextaddr(p) == -1) { + set_next(p, error_interval()); +@@ -163,9 +164,17 @@ + p->query->msg.xmttime.fractionl = arc4random(); + p->query->xmttime = gettime(); + +- if (ntp_sendmsg(p->query->fd, NULL, &p->query->msg, +- NTP_MSGSIZE_NOAUTH, 0) == -1) { ++ if ((result = ntp_sendmsg(p->query->fd, NULL, &p->query->msg, ++ NTP_MSGSIZE_NOAUTH, 0)) < 0) { + set_next(p, INTERVAL_QUERY_PATHETIC); ++ if (result == -2) { ++ /* ++ * got EINVAL in sendto(), probably the local socket ++ * address got invalidated -> force re-connect() ++ */ ++ close(p->query->fd); ++ p->query->fd = -1; ++ } + return (-1); + } + +diff -Naur openntpd-3.9p1/ntp_msg.c openntpd-3.9p1-fixed/ntp_msg.c +--- openntpd-3.9p1/ntp_msg.c 2006-05-14 07:29:21.000000000 +0200 ++++ openntpd-3.9p1-fixed/ntp_msg.c 2006-10-11 02:41:49.000000000 +0200 +@@ -98,6 +98,8 @@ + return (-1); + } + log_warn("sendto"); ++ if (errno == EINVAL) ++ return (-2); + return (-1); + } + diff --git a/net-misc/openntpd/openntpd-3.9_p1-r1.ebuild b/net-misc/openntpd/openntpd-3.9_p1-r1.ebuild new file mode 100644 index 000000000000..3270bbab5690 --- /dev/null +++ b/net-misc/openntpd/openntpd-3.9_p1-r1.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/openntpd/openntpd-3.9_p1-r1.ebuild,v 1.1 2007/02/19 21:56:08 bangert Exp $ + +inherit eutils + +MY_P=${P/_/} +DESCRIPTION="Lightweight NTP server ported from OpenBSD" +HOMEPAGE="http://www.openntpd.org/" +SRC_URI="mirror://openbsd/OpenNTPD/${MY_P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" +IUSE="ssl selinux" + +RDEPEND="ssl? ( dev-libs/openssl ) + selinux? ( sec-policy/selinux-ntp ) + !<=net-misc/ntp-4.2.0-r2" +DEPEND="${RDEPEND} + >=sys-apps/portage-2.0.51" + +S=${WORKDIR}/${MY_P} + +pkg_setup() { + enewgroup ntp 123 + enewuser ntp 123 -1 /var/empty ntp + + if has_version net-misc/ntp && ! built_with_use net-misc/ntp openntpd ; then + die "you need to emerge ntp with USE=openntpd" + fi +} + +src_unpack() { + unpack ${A} + cd "${S}" + sed -i '/NTPD_USER/s:_ntp:ntp:' ntpd.h || die + epatch ${FILESDIR}/openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff +} + +src_compile() { + econf \ + --disable-strip \ + $(use_with !ssl builtin-arc4random) || die + emake || die "emake failed" +} + +src_install() { + make install DESTDIR="${D}" || die + dodoc ChangeLog CREDITS README + + newinitd "${FILESDIR}"/openntpd.rc ntpd + newconfd "${FILESDIR}"/openntpd.conf.d ntpd +} |