Page MenuHomeFreeBSD

D21319.id60996.diff
No OneTemporary

D21319.id60996.diff

Index: head/sbin/ping6/ping6.c
===================================================================
--- head/sbin/ping6/ping6.c
+++ head/sbin/ping6/ping6.c
@@ -663,12 +663,6 @@
err(1, "socket srecv");
freeaddrinfo(res);
- /* revoke root privilege */
- if (seteuid(getuid()) != 0)
- err(1, "seteuid() failed");
- if (setuid(getuid()) != 0)
- err(1, "setuid() failed");
-
/* set the source address if specified. */
if ((options & F_SRCADDR) != 0) {
/* properly fill sin6_scope_id */
@@ -738,6 +732,12 @@
err(1, "setsockopt(IPV6_RECVRTHDRDSTOPTS)");
#endif
}
+
+ /* revoke root privilege */
+ if (seteuid(getuid()) != 0)
+ err(1, "seteuid() failed");
+ if (setuid(getuid()) != 0)
+ err(1, "setuid() failed");
if ((options & F_FLOOD) && (options & F_INTERVAL))
errx(1, "-f and -i incompatible options");

File Metadata

Mime Type
text/plain
Expires
Tue, May 19, 5:54 PM (18 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33323606
Default Alt Text
D21319.id60996.diff (831 B)

Event Timeline