--- iputils/ping.c +++ iputils/ping.c @@ -125,7 +125,11 @@ socket_errno = errno; uid = getuid(); - setuid(uid); + if(setuid(uid) != 0) + { + perror("ping: setuid()"); + exit(-1); + } source.sin_family = AF_INET;