iputils/iputils-ss021109-sec-ping6-setuid-retvalcheck.diff

16 lines
270 B
Diff

--- iputils/ping6.c
+++ iputils/ping6.c
@@ -187,7 +187,11 @@
socket_errno = errno;
uid = getuid();
- setuid(uid);
+ if(setuid(uid) != 0)
+ {
+ perror("ping: setuid()");
+ exit(-1);
+ }
source.sin6_family = AF_INET6;
memset(&firsthop, 0, sizeof(firsthop));