projects
/
ossec-hids.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dodan override za lintian
[ossec-hids.git]
/
src
/
rootcheck
/
unix-process.c
diff --git
a/src/rootcheck/unix-process.c
b/src/rootcheck/unix-process.c
index
072964e
..
3b873d3
100755
(executable)
--- a/
src/rootcheck/unix-process.c
+++ b/
src/rootcheck/unix-process.c
@@
-1,4
+1,5
@@
-/* @(#) $Id$ */
+/* @(#) $Id: ./src/rootcheck/unix-process.c, 2011/09/08 dcid Exp $
+ */
/* Copyright (C) 2009 Trend Micro Inc.
* All right reserved.
/* Copyright (C) 2009 Trend Micro Inc.
* All right reserved.
@@
-8,11
+9,11
@@
* License (version 2) as published by the FSF - Free Software
* Foundation
*
* 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/ .
*/
* online at: http://www.ossec.net/main/license/ .
*/
-
+
#include "shared.h"
#include "rootcheck.h"
#include "shared.h"
#include "rootcheck.h"
@@
-24,13
+25,13
@@
char *_os_get_runps(char *ps, int mpid)
char buf[OS_SIZE_2048 +1];
char command[OS_SIZE_1024 +1];
FILE *fp;
char buf[OS_SIZE_2048 +1];
char command[OS_SIZE_1024 +1];
FILE *fp;
-
-
+
+
buf[0] = '\0';
command[0] = '\0';
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");
snprintf(command, OS_SIZE_1024, "%s -p %d 2> /dev/null", ps, mpid);
fp = popen(command, "r");
@@
-58,9
+59,9
@@
char *_os_get_runps(char *ps, int mpid)
while(*tmp_str == ' ')
tmp_str++;
while(*tmp_str == ' ')
tmp_str++;
-
+
nbuf = tmp_str;
nbuf = tmp_str;
-
+
tmp_str = strchr(nbuf, '\n');
if(tmp_str)
tmp_str = strchr(nbuf, '\n');
if(tmp_str)
@@
-86,7
+87,7
@@
void *os_get_process_list()
int i = 1;
pid_t max_pid = MAX_PID;
OSList *p_list = NULL;
int i = 1;
pid_t max_pid = MAX_PID;
OSList *p_list = NULL;
-
+
char ps[OS_SIZE_1024 +1];
char ps[OS_SIZE_1024 +1];
@@
-109,7
+110,7
@@
void *os_get_process_list()
if(!p_list)
{
merror(LIST_ERROR, ARGV0);
if(!p_list)
{
merror(LIST_ERROR, ARGV0);
- return(NULL);
+ return(NULL);
}
}
@@
-135,11
+136,11
@@
void *os_get_process_list()
OSList_AddData(p_list, p_info);
}
}
OSList_AddData(p_list, p_info);
}
}
-
+
return((void *)p_list);
}
return((void *)p_list);
}
-
-
+
+
#endif
/* EOF */
#endif
/* EOF */