2011-12-20 17:26:43 +00:00
|
|
|
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) {
|
2011-10-26 17:40:23 +00:00
|
|
|
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
|
2011-12-20 17:26:43 +00:00
|
|
|
@@ -823,6 +807,22 @@ main(int argc, char **argv) {
|
2011-10-26 17:40:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+#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)
|