--- nagios3-3.2.3/cgi/status.c	2010-09-21 17:05:31.000000000 +0200
+++ nagios3-3.2.1/cgi/status.c	2009-09-12 01:55:30.000000000 +0200
@@ -2,8 +2,8 @@
  *
  * STATUS.C -  Nagios Status CGI
  *
- * Copyright (c) 1999-2010  Ethan Galstad (egalstad@nagios.org)
- * Last Modified: 08-05-2020
+ * Copyright (c) 1999-2009 Ethan Galstad (egalstad@nagios.org)
+ * Last Modified: 07-03-2009
  *
  * License:
  * 
@@ -992,6 +992,7 @@
 	hoststatus *temp_hoststatus;
 	host *temp_host;
 	servicestatus *temp_servicestatus;
+	service *temp_service;
 	int count_host;
 
 
@@ -1010,18 +1011,18 @@
 		if(display_type==DISPLAY_HOSTS && (show_all_hosts==TRUE || !strcmp(host_name,temp_hoststatus->host_name)))
 			count_host=1;
 		else if(display_type==DISPLAY_SERVICEGROUPS){
-			if(show_all_servicegroups==TRUE){
+			if(show_all_servicegroups==TRUE)
 				count_host=1;
-				}
 			else{
-
 				for(temp_servicestatus=servicestatus_list;temp_servicestatus!=NULL;temp_servicestatus=temp_servicestatus->next){
-					if(is_host_member_of_servicegroup(find_servicegroup(servicegroup_name),temp_host)==TRUE){
-						count_host=1;
-						break;
-						}
+					if(strcmp(temp_servicestatus->host_name,temp_hoststatus->host_name))
+						continue;
+					temp_service=find_service(temp_servicestatus->host_name,temp_servicestatus->description);
+					if(is_authorized_for_service(temp_service,&current_authdata)==FALSE)
+						continue;
+					count_host=1;
+					break;
 				        }
-
 			        }
 		        }
 		else if(display_type==DISPLAY_HOSTGROUPS && (show_all_hostgroups==TRUE || (is_host_member_of_hostgroup(find_hostgroup(hostgroup_name),temp_host)==TRUE)))
