On 2nd thought, setuid() is better here.

This commit is contained in:
elad 2006-09-24 11:17:09 +00:00
parent 887cf52b75
commit d13f82cf17
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ping.c,v 1.83 2006/09/24 11:05:09 elad Exp $ */
/* $NetBSD: ping.c,v 1.84 2006/09/24 11:17:09 elad Exp $ */
/*
* Copyright (c) 1989, 1993
@ -58,7 +58,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: ping.c,v 1.83 2006/09/24 11:05:09 elad Exp $");
__RCSID("$NetBSD: ping.c,v 1.84 2006/09/24 11:17:09 elad Exp $");
#endif
#include <stdio.h>
@ -261,7 +261,7 @@ main(int argc, char *argv[])
if ((sloop = cap_socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) < 0)
err(1, "Cannot create socket");
if (seteuid(getuid()) == -1)
if (setuid(getuid()) == -1)
err(1, "seteuid");
setprogname(argv[0]);