Просмотр исходного кода

allowed_hosts doesn't work, if one of the hostnames can't be resolved by dns

Fix for issue https://github.com/NagiosEnterprises/nrpe/issues/24
John C. Frickson 10 лет назад
Родитель
Сommit
cd7bb1d6f4
2 измененных файлов с 3 добавлено и 2 удалено
  1. 2 0
      Changelog
  2. 1 2
      src/acl.c

+ 2 - 0
Changelog

@@ -19,6 +19,8 @@ FIXES
 - check_nrpe does not parse passed arguments correctly (John Frickson)
 - NRPE should not start if cannot write pid file (John Frickson)
 - Fixed out-of-bounds error (return code 255) for some failures (John Frickson)
+- Connection Timeout and Connection Refused messages need a new line (Andrew Widdersheim)
+- allowed_hosts doesn't work, if one of the hostnames can't be resolved by dns (John Frickson)
 
 2.15 - 09/06/2013
 -----------------

+ 1 - 2
src/acl.c

@@ -499,9 +499,8 @@ int is_an_allowed_host(int family, void *host) {
 
 	while(dns_acl_curr != NULL) {
    		he = gethostbyname(dns_acl_curr->domain);
-		if (he == NULL) return 0;
 
-		while (*he->h_addr_list) {
+		while (he && *he->h_addr_list) {
 			switch(he->h_addrtype) {
 			case AF_INET:
 				memmove((char *)&addr,*he->h_addr_list++, sizeof(addr));