Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177685193
D21213.1795028716.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
831 B
Referenced Files
None
Subscribers
None
D21213.1795028716.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D21213: ping6: Revoke root privilege earlier
Attached
Detach File
Event Timeline