Advanced permissions/user properties

Tobias Klausmann klausman at schwarzvogel.de
Thu Dec 7 15:39:16 CET 2006


Hi! 

On Tue, 05 Dec 2006, Tobias Klausmann wrote:
> Thus, I'll probably patch NG to just ignore the perms. 
> 
> I'll post the patch here (if it's not too ugly ;))

See the attached file. Have fun.

Regards,
Tobias

-- 
Never touch a burning system.
-------------- next part --------------
--- NagiosGrapher.pm.orig	2006-12-07 15:15:40.000000000 +0100
+++ NagiosGrapher.pm	2006-12-07 15:15:54.000000000 +0100
@@ -181,12 +181,15 @@
 sub AuthCheck {
 	my $rw=0;
 	my ($cfg,$host,$user)=@_;
+	my $cgroups="";
 
     read_nagios_cfg($cfg) if(!$nagios_loaded_cfg);
     
     if($nagiosversion==2) {
     	# Nagios Version 2.? Perform test
-    	$rw=1 if(parse_nagios_cfg('contactgroup',parse_nagios_cfg('host',$host,'contact_groups'),'members') =~ m/$user(,|$)/);
+	$cgroups = parse_nagios_cfg('host',$host,'contact_groups');
+	$cgroups =~ s/:[^,]*//g;
+    	$rw=1 if(parse_nagios_cfg('contactgroup',$cgroups,'members') =~ m/$user(,|$)/);
     } else {
     	# Nagios Version 1.X isn't supported yet so everything is allowd 
     	$rw=1;
-------------- next part --------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list