From a6d46ff6507fc8b0a3d001387b19395cdca1b44c Mon Sep 17 00:00:00 2001 From: jow Date: Mon, 18 Apr 2011 10:23:50 +0000 Subject: [PATCH] [packages] openntpd: - don't check directory permissions, we can't make /var 0700 (#9258) - fix init script after r26148, use service_kill instead of killall -9 (#9258) - bump pkg revision git-svn-id: svn://svn.openwrt.org/openwrt/packages@26717 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/openntpd/Makefile | 4 ++-- net/openntpd/files/ntpd.init | 7 +++---- net/openntpd/patches/003-no_permission_check.patch | 11 +++++++++++ 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 net/openntpd/patches/003-no_permission_check.patch diff --git a/net/openntpd/Makefile b/net/openntpd/Makefile index fbee724fb..980d631f9 100644 --- a/net/openntpd/Makefile +++ b/net/openntpd/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006 OpenWrt.org +# Copyright (C) 2006-2011 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openntpd PKG_VERSION:=3.9p1 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/ \ diff --git a/net/openntpd/files/ntpd.init b/net/openntpd/files/ntpd.init index 31d9f22f0..738007c38 100644 --- a/net/openntpd/files/ntpd.init +++ b/net/openntpd/files/ntpd.init @@ -1,5 +1,5 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2006 OpenWrt.org +# Copyright (C) 2006-2011 OpenWrt.org START=60 @@ -8,12 +8,11 @@ boot() { } start() { - mkdir -p `awk -F: '/^ntp:/{print $6}' /etc/passwd` + mkdir -p `awk -F: '/^network:/{print $6}' /etc/passwd` mkdir -p /var/db/ /usr/sbin/ntpd -s } stop() { - # -1 seems insufficient to kill one of the two underlying processes. - killall -9 ntpd + service_kill ntpd } diff --git a/net/openntpd/patches/003-no_permission_check.patch b/net/openntpd/patches/003-no_permission_check.patch new file mode 100644 index 000000000..4391a307c --- /dev/null +++ b/net/openntpd/patches/003-no_permission_check.patch @@ -0,0 +1,11 @@ +--- a/ntp.c ++++ b/ntp.c +@@ -111,8 +111,6 @@ ntp_main(int pipe_prnt[2], struct ntpd_c + + if (stat(chrootdir, &stb) == -1) + fatal("stat"); +- if (stb.st_uid != 0 || (stb.st_mode & (S_IWGRP|S_IWOTH)) != 0) +- fatal("bad privsep dir permissions"); + if (chroot(chrootdir) == -1) + fatal("chroot"); + if (chdir("/") == -1)