check the effectiv user ID and not the UID, if not setuid root do not have

any effect.
This commit is contained in:
keil 2005-02-23 16:26:57 +00:00
parent 7604713269
commit 8dd859c039
1 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*
** $Id: vboxbeep.c,v 1.8 2002/01/31 20:11:07 paul Exp $
** $Id: vboxbeep.c,v 1.9 2005/02/23 16:26:57 keil Exp $
**
** Copyright (C) 1996, 1997 Michael 'Ghandi' Herold
*/
@ -175,7 +175,7 @@ int main(int argc, char **argv)
}
else
{
if (getuid() == 0)
if (geteuid() == 0)
{
fprintf(stderr, "%s: sending terminate signal to process %d...\n", vbasename, i);
@ -204,7 +204,7 @@ int main(int argc, char **argv)
exit(5);
}
if (getuid() != 0)
if (geteuid() != 0)
{
fprintf(stderr, "%s: you must be *root* to start %s.\n", vbasename, vbasename);