--- projects/libstatgrab/examples/user_list.c 2003/11/23 13:51:10 1.4 +++ projects/libstatgrab/examples/user_list.c 2004/01/19 16:49:19 1.7 @@ -1,7 +1,7 @@ /* * i-scream central monitoring system * http://www.i-scream.org - * Copyright (C) 2000-2003 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 @@ -16,6 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id: user_list.c,v 1.7 2004/01/19 16:49:19 tdb Exp $ */ #include @@ -42,6 +44,12 @@ int main(int argc, char **argv){ /* Initialise statgrab */ statgrab_init(); + + /* Drop setuid/setgid privileges. */ + if (statgrab_drop_privileges() != 0) { + perror("Error. Failed to drop privileges"); + return 1; + } if( (users = get_user_stats()) != NULL){ printf("Users : %s\n", users->name_list);