Commit 0e116bf2 authored by Natanael Copa's avatar Natanael Copa

main/dhcp: fix permissions for lease file

fixes #224
(cherry picked from commit d42dbe6e)
parent fc01782d
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
pkgname=dhcp pkgname=dhcp
pkgver=4.1.0_p1 pkgver=4.1.0_p1
_realver=4.1.0p1 _realver=4.1.0p1
pkgrel=4 pkgrel=5
pkgdesc="ISC Dynamic Host Configuration Protocol (DHCP)" pkgdesc="ISC Dynamic Host Configuration Protocol (DHCP)"
url="https://www.isc.org/" url="https://www.isc.org/"
license="GPL" license="GPL"
...@@ -12,13 +12,18 @@ install="dhcp.pre-install dhcp.post-install dhcp.pre-upgrade dhcp.post-upgrade" ...@@ -12,13 +12,18 @@ install="dhcp.pre-install dhcp.post-install dhcp.pre-upgrade dhcp.post-upgrade"
subpackages="$pkgname-doc $pkgname-dev dhclient" subpackages="$pkgname-doc $pkgname-dev dhclient"
source="http://ftp.isc.org/isc/dhcp/$pkgname-$_realver.tar.gz source="http://ftp.isc.org/isc/dhcp/$pkgname-$_realver.tar.gz
linux_ipv6_discover.patch linux_ipv6_discover.patch
dhcp-3.0-fix-perms.patch
dhcpd.confd dhcpd.confd
dhcpd.initd" dhcpd.initd"
build() { prepare() {
cd "$srcdir/$pkgname-$_realver" 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 patch -p1 -i ../linux_ipv6_discover.patch || return 1
}
build() {
cd "$srcdir/$pkgname-$_realver"
./configure --prefix=/usr \ ./configure --prefix=/usr \
--sysconfdir=/etc/dhcp \ --sysconfdir=/etc/dhcp \
--with-cli-pid-file=/var/run/dhcp/dhclient.pid \ --with-cli-pid-file=/var/run/dhcp/dhclient.pid \
...@@ -31,6 +36,10 @@ build() { ...@@ -31,6 +36,10 @@ build() {
--mandir=/usr/share/man \ --mandir=/usr/share/man \
--infodir=/usr/share/info --infodir=/usr/share/info
make || return 1 make || return 1
}
package() {
cd "$srcdir/$pkgname-$_realver"
make DESTDIR="$pkgdir" install make DESTDIR="$pkgdir" install
install -m755 -D "$srcdir"/dhcpd.initd "$pkgdir"/etc/init.d/dhcpd install -m755 -D "$srcdir"/dhcpd.initd "$pkgdir"/etc/init.d/dhcpd
...@@ -51,5 +60,6 @@ dhclient() { ...@@ -51,5 +60,6 @@ dhclient() {
md5sums="325ff8338c5a21f89d5304ac13ffebdf dhcp-4.1.0p1.tar.gz md5sums="325ff8338c5a21f89d5304ac13ffebdf dhcp-4.1.0p1.tar.gz
37abf1fb047a353e91b022fafdabf39a linux_ipv6_discover.patch 37abf1fb047a353e91b022fafdabf39a linux_ipv6_discover.patch
a9eaf182dae3984670da52f20ae10fba dhcp-3.0-fix-perms.patch
df32707f5bbe5363306420b5dc6e6b40 dhcpd.confd df32707f5bbe5363306420b5dc6e6b40 dhcpd.confd
be2259371681bd4ab8a577b1b1a989ae dhcpd.initd" be2259371681bd4ab8a577b1b1a989ae dhcpd.initd"
--- 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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment