dhcp/dhcp-4.2.3-paranoia.patch
Jiri Popelka 0acc1b8c2c revert change made in 4.2.3-3 because of failing failover (#765967)
don't need to fix lease files ownership before starting service
dhclient-script: allow static route with a 0.0.0.0 next-hop addressi (#769463
2011-12-21 12:20:29 +01:00

50 lines
1.3 KiB
Diff

diff -up dhcp-4.2.3-P1/server/dhcpd.c.paranoia dhcp-4.2.3-P1/server/dhcpd.c
--- dhcp-4.2.3-P1/server/dhcpd.c.paranoia 2011-12-20 18:02:26.000000000 +0100
+++ dhcp-4.2.3-P1/server/dhcpd.c 2011-12-20 18:03:43.840037108 +0100
@@ -771,22 +771,6 @@ main(int argc, char **argv) {
exit (0);
}
-#if defined (PARANOIA)
- /* change uid to the specified one */
-
- if (set_gid) {
- if (setgroups (0, (void *)0))
- log_fatal ("setgroups: %m");
- if (setgid (set_gid))
- log_fatal ("setgid(%d): %m", (int) set_gid);
- }
-
- if (set_uid) {
- if (setuid (set_uid))
- log_fatal ("setuid(%d): %m", (int) set_uid);
- }
-#endif /* PARANOIA */
-
/*
* Deal with pid files. If the user told us
* not to write a file we don't read one either
@@ -823,6 +807,22 @@ main(int argc, char **argv) {
}
}
+#if defined (PARANOIA)
+ /* change uid to the specified one */
+
+ if (set_gid) {
+ if (setgroups (0, (void *)0))
+ log_fatal ("setgroups: %m");
+ if (setgid (set_gid))
+ log_fatal ("setgid(%d): %m", (int) set_gid);
+ }
+
+ if (set_uid) {
+ if (setuid (set_uid))
+ log_fatal ("setuid(%d): %m", (int) set_uid);
+ }
+#endif /* PARANOIA */
+
/* If we were requested to log to stdout on the command line,
keep doing so; otherwise, stop. */
if (log_perror == -1)