X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;ds=sidebyside;f=src%2Futil%2Flist_agents.c;h=5acb0f2787fafe18674e6d901ab8909b29a15176;hb=927951d1c1ad45ba9e7325f07d996154a91c911b;hp=f1781b11c8b00dc5dd6755be8fcb26c0214443d5;hpb=301048b51990573e58a30dc4a5bb4ec285cad554;p=ossec-hids.git diff --git a/src/util/list_agents.c b/src/util/list_agents.c index f1781b1..5acb0f2 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; - + int flag = 0; + /* Setting the name */ OS_SetName(ARGV0); - - + + /* user arguments */ if(argc < 2) { helpmsg(); } - + /* Getting the group name */ gid = Privsep_GetGroup(group); uid = Privsep_GetUser(user); @@ -60,15 +61,15 @@ 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);