summaryrefslogtreecommitdiffstats
path: root/src/zabbix_agent
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-06-17 06:27:32 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-06-17 06:27:32 +0000
commit043dbb70cbc557bbc5f70a74453e506546148963 (patch)
tree9dcdd9364879c4ac3384d4e53b2054653964a69b /src/zabbix_agent
parent565fba506fd51acbedc8d06c07b93abae22444a7 (diff)
downloadzabbix-043dbb70cbc557bbc5f70a74453e506546148963.tar.gz
zabbix-043dbb70cbc557bbc5f70a74453e506546148963.tar.xz
zabbix-043dbb70cbc557bbc5f70a74453e506546148963.zip
- php/include/*inc renamed to php/include/*inc.php (Alexei)
- check of source IP address for trapped values (Alexei) - added include/security.h and include/security.c (Alexei) - added items.trapper_hosts (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@411 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/zabbix_agent')
-rw-r--r--src/zabbix_agent/Makefile.in4
-rw-r--r--src/zabbix_agent/zabbix_agent.c11
-rw-r--r--src/zabbix_agent/zabbix_agentd.c6
3 files changed, 13 insertions, 8 deletions
diff --git a/src/zabbix_agent/Makefile.in b/src/zabbix_agent/Makefile.in
index f87a00c9..6dead4ba 100644
--- a/src/zabbix_agent/Makefile.in
+++ b/src/zabbix_agent/Makefile.in
@@ -2,8 +2,8 @@
all:
- @CC@ -o ../../bin/zabbix_agent @CFLAGS@ -I../../include zabbix_agent.c sysinfo.c ../../include/cfg.c @LIBS@
- @CC@ -o ../../bin/zabbix_agentd @CFLAGS@ -I../../include zabbix_agentd.c sysinfo.c ../../include/log.c ../../include/cfg.c @LIBS@
+ @CC@ -o ../../bin/zabbix_agent @CFLAGS@ -I../../include zabbix_agent.c sysinfo.c ../../include/log.c ../../include/cfg.c ../../include/security.c @LIBS@
+ @CC@ -o ../../bin/zabbix_agentd @CFLAGS@ -I../../include zabbix_agentd.c sysinfo.c ../../include/log.c ../../include/cfg.c ../../include/security.c @LIBS@
clean:
rm -fv *.o
diff --git a/src/zabbix_agent/zabbix_agent.c b/src/zabbix_agent/zabbix_agent.c
index 74c78264..ae5c6058 100644
--- a/src/zabbix_agent/zabbix_agent.c
+++ b/src/zabbix_agent/zabbix_agent.c
@@ -21,6 +21,7 @@
#include "common.h"
#include "cfg.h"
+#include "log.h"
#include "sysinfo.h"
#include "zabbix_agent.h"
@@ -69,7 +70,7 @@ void init_config(void)
parse_cfg_file("/etc/zabbix/zabbix_agent.conf",cfg);
}
-
+/*
int check_security(void)
{
char *sname;
@@ -98,12 +99,11 @@ int check_security(void)
}
else
{
-/* syslog( LOG_WARNING, "Error getpeername [%m]");*/
-/* syslog( LOG_WARNING, "Connection rejected");*/
return FAIL;
}
return FAIL;
}
+*/
int main()
{
@@ -123,9 +123,12 @@ int main()
init_config();
+/* Do not create debug files */
+ zabbix_open_log(LOG_TYPE_SYSLOG,LOG_LEVEL_EMPTY,NULL);
+
alarm(CONFIG_TIMEOUT);
- if(check_security() == FAIL)
+ if(check_security(0,CONFIG_HOSTS_ALLOWED,0) == FAIL)
{
exit(FAIL);
}
diff --git a/src/zabbix_agent/zabbix_agentd.c b/src/zabbix_agent/zabbix_agentd.c
index 55715ca6..85e700b1 100644
--- a/src/zabbix_agent/zabbix_agentd.c
+++ b/src/zabbix_agent/zabbix_agentd.c
@@ -31,6 +31,7 @@
#include "common.h"
#include "sysinfo.h"
+#include "security.h"
#include "zabbix_agent.h"
#include "log.h"
@@ -235,7 +236,7 @@ void init_config(void)
CONFIG_PID_FILE=strdup("/tmp/zabbix_agentd.pid");
}
}
-
+/*
int check_security(int sockfd)
{
char *sname;
@@ -275,6 +276,7 @@ int check_security(int sockfd)
zabbix_log( LOG_LEVEL_WARNING, "Connection from [%s] rejected. Allowed server is [%s] ",sname, CONFIG_HOSTS_ALLOWED);
return FAIL;
}
+*/
void process_child(int sockfd)
{
@@ -384,7 +386,7 @@ void child_main(int i,int listenfd, int addrlen)
#ifdef HAVE_FUNCTION_SETPROCTITLE
setproctitle("processing request");
#endif
- if( check_security(connfd) == SUCCEED)
+ if( check_security(connfd, CONFIG_HOSTS_ALLOWED, 0) == SUCCEED)
{
process_child(connfd);
}