aboutsummaryrefslogtreecommitdiffstats
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:21:18 +0000
commitd42dbe6e44d01f401983e5a92a366cb47a7a73cc (patch)
tree539b6aab556165e13fe0123416f351fa6653f3e8
parent9d2361e064733b538a201fe2bcfebdda6a45c4f9 (diff)
downloadaports-d42dbe6e44d01f401983e5a92a366cb47a7a73cc.tar.bz2
aports-d42dbe6e44d01f401983e5a92a366cb47a7a73cc.tar.xz
main/dhcp: fix permissions for lease file
fixes #224
-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 dd268479bf..c2177e5a8c 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 0000000000..78725c2c79
--- /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);
+