X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Futil%2Flist_agents.c;h=c363ab64cbe59c32e2a3cd68607e3fefb6cc548b;hp=f1781b11c8b00dc5dd6755be8fcb26c0214443d5;hb=6ef2f786c6c8ead94841b5f93baf9f43421f08c8;hpb=301048b51990573e58a30dc4a5bb4ec285cad554 diff --git a/src/util/list_agents.c b/src/util/list_agents.c index f1781b1..c363ab6 100755 --- a/src/util/list_agents.c +++ b/src/util/list_agents.c @@ -1,4 +1,5 @@ -/* @(#) $Id$ */ +/* @(#) $Id: ./src/util/list_agents.c, 2011/09/08 dcid Exp $ + */ /* Copyright (C) 2009 Trend Micro Inc. * All right reserved. @@ -35,24 +36,24 @@ int main(int argc, char **argv) char *dir = DEFAULTDIR; char *group = GROUPGLOBAL; char *user = USER; - + char *msg; char **agent_list; int gid; int uid; int flag; - + /* Setting the name */ OS_SetName(ARGV0); - - + + /* user arguments */ if(argc < 2) { helpmsg(); } - + /* Getting the group name */ gid = Privsep_GetGroup(group); uid = Privsep_GetUser(user); @@ -61,14 +62,14 @@ int main(int argc, char **argv) ErrorExit(USER_ERROR, ARGV0, user, group); } - + /* Setting the group */ if(Privsep_SetGroup(gid) < 0) { ErrorExit(SETGID_ERROR,ARGV0, group); } - - + + /* Chrooting to the default directory */ if(Privsep_Chroot(dir) < 0) { @@ -78,14 +79,14 @@ int main(int argc, char **argv) /* Inside chroot now */ nowChroot(); - + /* Setting the user */ if(Privsep_SetUser(uid) < 0) { ErrorExit(SETUID_ERROR, ARGV0, user); } - + /* User options */ if(strcmp(argv[1], "-h") == 0) { @@ -117,7 +118,7 @@ int main(int argc, char **argv) if(agent_list) { char **agent_list_pt = agent_list; - + while(*agent_list) { printf("%s %s\n", *agent_list, msg);