Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F132556608
D21213.id60645.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
769 B
Referenced Files
None
Subscribers
None
D21213.id60645.diff
View Options
Index: sbin/ping6/ping6.c
===================================================================
--- sbin/ping6/ping6.c
+++ sbin/ping6/ping6.c
@@ -661,6 +661,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 */
@@ -731,12 +737,6 @@
#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
Sat, Oct 18, 11:03 PM (1 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23898371
Default Alt Text
D21213.id60645.diff (769 B)
Attached To
Mode
D21213: ping6: Revoke root privilege earlier
Attached
Detach File
Event Timeline
Log In to Comment