summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-12-31 10:21:18 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-12-31 10:26:45 +0000
commit0e116bf2f7da413c052c0a4e0883792ed9a2c312 (patch)
tree436c3692917f301c705cded434b21074dd29d43b
parentfc01782d160690890ee6080e077884f9dec9b887 (diff)
downloadaports-0e116bf2f7da413c052c0a4e0883792ed9a2c312.tar.bz2
aports-0e116bf2f7da413c052c0a4e0883792ed9a2c312.tar.xz
main/dhcp: fix permissions for lease file
fixes #224 (cherry picked from commit d42dbe6e44d01f401983e5a92a366cb47a7a73cc)
-rw-r--r--main/dhcp/APKBUILD14
-rw-r--r--main/dhcp/dhcp-3.0-fix-perms.patch15
2 files changed, 27 insertions, 2 deletions
diff --git a/main/dhcp/APKBUILD b/main/dhcp/APKBUILD
index dd268479..c2177e5a 100644
--- a/main/dhcp/APKBUILD
+++ b/main/dhcp/APKBUILD
@@ -2,7 +2,7 @@
pkgname=dhcp
pkgver=4.1.0_p1
_realver=4.1.0p1
-pkgrel=4
+pkgrel=5
pkgdesc="ISC Dynamic Host Configuration Protocol (DHCP)"
url="https://www.isc.org/"
license="GPL"
@@ -12,13 +12,18 @@ install="dhcp.pre-install dhcp.post-install dhcp.pre-upgrade dhcp.post-upgrade"
subpackages="$pkgname-doc $pkgname-dev dhclient"
source="http://ftp.isc.org/isc/dhcp/$pkgname-$_realver.tar.gz
linux_ipv6_discover.patch
+ dhcp-3.0-fix-perms.patch
dhcpd.confd
dhcpd.initd"
-build() {
+prepare() {
cd "$srcdir/$pkgname-$_realver"
+ patch -p1 -i "$srcdir"/dhcp-3.0-fix-perms.patch || return 1
patch -p1 -i ../linux_ipv6_discover.patch || return 1
+}
+build() {
+ cd "$srcdir/$pkgname-$_realver"
./configure --prefix=/usr \
--sysconfdir=/etc/dhcp \
--with-cli-pid-file=/var/run/dhcp/dhclient.pid \
@@ -31,6 +36,10 @@ build() {
--mandir=/usr/share/man \
--infodir=/usr/share/info
make || return 1
+}
+
+package() {
+ cd "$srcdir/$pkgname-$_realver"
make DESTDIR="$pkgdir" install
install -m755 -D "$srcdir"/dhcpd.initd "$pkgdir"/etc/init.d/dhcpd
@@ -51,5 +60,6 @@ dhclient() {
md5sums="325ff8338c5a21f89d5304ac13ffebdf dhcp-4.1.0p1.tar.gz
37abf1fb047a353e91b022fafdabf39a linux_ipv6_discover.patch
+a9eaf182dae3984670da52f20ae10fba dhcp-3.0-fix-perms.patch
df32707f5bbe5363306420b5dc6e6b40 dhcpd.confd
be2259371681bd4ab8a577b1b1a989ae dhcpd.initd"
diff --git a/main/dhcp/dhcp-3.0-fix-perms.patch b/main/dhcp/dhcp-3.0-fix-perms.patch
new file mode 100644
index 00000000..78725c2c
--- /dev/null
+++ b/main/dhcp/dhcp-3.0-fix-perms.patch
@@ -0,0 +1,15 @@
+--- a/server/dhcpd.c 2003-11-05 14:08:09.000000000 -0800
++++ b/server/dhcpd.c 2003-11-05 14:15:32.000000000 -0800
+@@ -602,6 +602,12 @@
+ if (lftest)
+ exit (0);
+
++#if defined (PARANOIA)
++ /* Set proper permissions... */
++ if (lchown (path_dhcpd_db, set_uid, set_gid))
++ log_fatal ("lchown(%s, %d, %d): %m", path_dhcpd_db, (int) set_uid, (int) set_gid);
++#endif /* PARANOIA */
++
+ /* Discover all the network interfaces and initialize them. */
+ discover_interfaces (DISCOVER_SERVER);
+