-/* @(#) $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
*/
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);
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)
{
/* 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)
{
if(agent_list)
{
char **agent_list_pt = agent_list;
-
+
while(*agent_list)
{
printf("%s %s\n", *agent_list, msg);