--- projects/libstatgrab/src/saidar/saidar.c 2004/01/05 14:25:03 1.20 +++ projects/libstatgrab/src/saidar/saidar.c 2004/01/16 15:54:56 1.23 @@ -1,7 +1,7 @@ /* * i-scream central monitoring system * http://www.i-scream.org - * Copyright (C) 2000-2002 i-scream + * Copyright (C) 2000-2004 i-scream * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -435,22 +435,12 @@ int main(int argc, char **argv){ extern int errno; int delay=2; -#ifdef ALLBSD - gid_t gid; -#endif + statgrab_init(); -#ifdef ALLBSD - if((setegid(getgid())) != 0){ - fprintf(stderr, "Failed to lose setgid'ness\n"); + if(statgrab_drop_privileges() != 0){ + fprintf(stderr, "Failed to drop setuid/setgid privileges\n"); return 1; } -#endif -#ifdef SOLARIS - if((seteuid(getuid())) != 0){ - fprintf(stderr, "Failed to lose setuid'ness\n"); - return 1; - } -#endif while ((c = getopt(argc, argv, "vhd:")) != -1){ switch (c){