--- projects/libstatgrab/examples/os_info.c 2003/08/24 20:24:09 1.2 +++ projects/libstatgrab/examples/os_info.c 2004/01/06 15:35:04 1.4 @@ -24,9 +24,18 @@ #include int main(int argc, char **argv){ - + general_stat_t *general_stats; + /* Initialise statgrab */ + statgrab_init(); + + /* Drop setuid/setgid privileges. */ + if (statgrab_drop_privileges() != 0) { + perror("Error. Failed to drop privileges"); + return 1; + } + general_stats = get_general_stats(); if(general_stats == NULL){ @@ -43,6 +52,3 @@ int main(int argc, char **argv){ exit(0); } - - -