SHA256
1
0
forked from pool/dhcp
dhcp/0020-dhcp-4.2.x-chown-server-leases.bnc868253.patch
Marius Tomaschewski cdb81fcfb3 - Fixed /etc/sysconfig/dhcpd fillup in dhcp server post-install.
- Fixed dhcp server start script to use correct libdir (bnc#868250)
- Fixed dhcp server to chown leases to run user at start (bnc#868253)
  [+ 0020-dhcp-4.2.x-chown-server-leases.bnc868253.patch]
- Fixed to write missed dhcp-ldap debug level messages (bnc#835818)
  [+ 0019-dhcp-4.2.x-ldap-debug-write.bnc835818.patch]
- Fixed unsupported dhclient-script used by sysconfig ifup to provide
  a function to calculate netmask. NetworkManager provides an own one.

OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=131
2014-06-10 02:45:09 +00:00

26 lines
701 B
Diff

References: bnc#868253
--- dhcp-4.2.x/server/dhcpd.c
+++ dhcp-4.2.x/server/dhcpd.c 2014/06/10 01:59:13
@@ -783,8 +783,19 @@ main(int argc, char **argv) {
}
#if defined (PARANOIA)
- /* change uid to the specified one */
+ /* ensure, the leases db is owned by the run user/group */
+ if (set_gid || set_uid) {
+ char backfname[512];
+
+ chown(path_dhcpd_db, set_uid ? set_uid : -1,
+ set_gid ? set_gid : -1);
+ snprintf (backfname, sizeof backfname, "%s~", path_dhcpd_db);
+ chown(backfname, set_uid ? set_uid : -1,
+ set_gid ? set_gid : -1);
+ }
+
+ /* change uid to the specified one */
if (set_gid) {
/* setgroups is done, OK */
if (setgroups (0, (void *)0))