Page MenuHomeFreeBSD

D21213.1795028716.diff
No OneTemporary

Authored By
Unknown
Size
831 B
Referenced Files
None
Subscribers
None

D21213.1795028716.diff

Index: head/sbin/ping6/ping6.c
===================================================================
--- head/sbin/ping6/ping6.c
+++ head/sbin/ping6/ping6.c
@@ -659,6 +659,12 @@
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 */
@@ -728,12 +734,6 @@
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
Wed, Nov 18, 7:05 PM (12 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41830635
Default Alt Text
D21213.1795028716.diff (831 B)

Event Timeline