X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Futil%2Flist_agents.c;h=c363ab64cbe59c32e2a3cd68607e3fefb6cc548b;hb=6ef2f786c6c8ead94841b5f93baf9f43421f08c8;hp=a3624ce31cebdd38ec7fa9a9df7007bfba4b24b3;hpb=914feba5d54f979cd5d7e69c349c3d01f630042a;p=ossec-hids.git diff --git a/src/util/list_agents.c b/src/util/list_agents.c index a3624ce..c363ab6 100755 --- a/src/util/list_agents.c +++ b/src/util/list_agents.c @@ -1,11 +1,12 @@ -/* @(#) $Id: list_agents.c,v 1.7 2009/06/24 18:53:09 dcid Exp $ */ +/* @(#) $Id: ./src/util/list_agents.c, 2011/09/08 dcid Exp $ + */ /* Copyright (C) 2009 Trend Micro Inc. * All right reserved. * * This program is a free software; you can redistribute it * and/or modify it under the terms of the GNU General Public - * License (version 3) as published by the FSF - Free Software + * License (version 2) as published by the FSF - Free Software * Foundation */ @@ -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);