-/* @(#) $Id: unix-process.c,v 1.5 2009/06/24 18:53:07 dcid Exp $ */
+/* @(#) $Id: ./src/rootcheck/unix-process.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
*
- * License details at the LICENSE file included with OSSEC or
+ * License details at the LICENSE file included with OSSEC or
* online at: http://www.ossec.net/main/license/ .
*/
-
+
#include "shared.h"
#include "rootcheck.h"
char buf[OS_SIZE_2048 +1];
char command[OS_SIZE_1024 +1];
FILE *fp;
-
-
+
+
buf[0] = '\0';
command[0] = '\0';
- command[OS_SIZE_1024] = '\0';
-
-
+ command[OS_SIZE_1024] = '\0';
+
+
snprintf(command, OS_SIZE_1024, "%s -p %d 2> /dev/null", ps, mpid);
fp = popen(command, "r");
while(*tmp_str == ' ')
tmp_str++;
-
+
nbuf = tmp_str;
-
+
tmp_str = strchr(nbuf, '\n');
if(tmp_str)
int i = 1;
pid_t max_pid = MAX_PID;
OSList *p_list = NULL;
-
+
char ps[OS_SIZE_1024 +1];
if(!p_list)
{
merror(LIST_ERROR, ARGV0);
- return(NULL);
+ return(NULL);
}
OSList_AddData(p_list, p_info);
}
}
-
+
return((void *)p_list);
}
-
-
+
+
#endif
/* EOF */