--- projects/libstatgrab/src/statgrab/statgrab.c 2004/01/05 16:39:15 1.14 +++ projects/libstatgrab/src/statgrab/statgrab.c 2004/01/05 17:20:30 1.15 @@ -608,14 +608,8 @@ int main(int argc, char **argv) { /* We don't care if statgrab_init fails, because we can just display the statistics that can be read as non-root. */ statgrab_init(); -#ifdef ALLBSD - if (setegid(getgid()) != 0) - die("Failed to lose effective group"); -#endif -#ifdef SOLARIS - if (seteuid(getuid()) != 0) - die("Failed to lose effective user"); -#endif + if (statgrab_drop_privileges() != 0) + die("Failed to drop setuid/setgid privileges"); switch (repeat_mode) { case REPEAT_NONE: