[icinga-checkins] icinga.org: icinga-core/rbartels/1.3: fix deleting host comments won' t work #994

git at icinga.org git at icinga.org
Thu Nov 11 20:11:01 CET 2010


Module: icinga-core
Branch: rbartels/1.3
Commit: 09aae2efc07abe6d89f78c02c2332ad1524faa4b
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=09aae2efc07abe6d89f78c02c2332ad1524faa4b

Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date:   Thu Nov 11 20:10:32 2010 +0100

fix deleting host comments won't work #994

Fixes #994

---

 Changelog |    1 +
 cgi/cmd.c |    7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Changelog b/Changelog
index 682b3ca..067e8f0 100644
--- a/Changelog
+++ b/Changelog
@@ -30,6 +30,7 @@ FIXES
 * classic ui: fix typo for css attribute in extinfo.cgi (Ton Voon) #963
 * classic ui: fix whitespace escaping in html urls (Jochen Bern) #965
 * classic ui: fix config expander printing [SP] instead of [WS] (Jochen Bern) #965
+* classic ui: fix deleting host comments won't work #994
 
 * install: fix LD_LIBRARY_PATH export on non bash in idoutils init script (Alexander Skwar) #936
 * install: add log2ido for adding archived logs onto socket/rdbms #926
diff --git a/cgi/cmd.c b/cgi/cmd.c
index c2b520b..5a5a5ff 100644
--- a/cgi/cmd.c
+++ b/cgi/cmd.c
@@ -1737,11 +1737,12 @@ void commit_command_data(int cmd){
 
 			/* see if the user is authorized to issue a command... */
 			is_authorized[x]=FALSE;
-			if (cmd==CMD_ADD_HOST_COMMENT || cmd==CMD_ACKNOWLEDGE_HOST_PROBLEM) {
+			if (cmd==CMD_DEL_HOST_COMMENT && temp_comment!=NULL) {
 				temp_host=find_host(temp_comment->host_name);
 				if(is_authorized_for_host_commands(temp_host,&current_authdata)==TRUE)
 					is_authorized[x]=TRUE;
-			} else {
+			}
+			if (cmd==CMD_DEL_SVC_COMMENT && temp_comment!=NULL) {
 				temp_service=find_service(temp_comment->host_name,temp_comment->service_description);
 				if(is_authorized_for_service_commands(temp_service,&current_authdata)==TRUE)
 					is_authorized[x]=TRUE;
@@ -1829,7 +1830,7 @@ void commit_command_data(int cmd){
 
 			cmd_has_objects = TRUE;
 
-			if (commands[x].host_name == NULL)
+			if (commands[x].host_name == NULL || commands[x].description == NULL)
 				continue;
 
 			is_authorized[x]=FALSE;





More information about the icinga-checkins mailing list