Ignore my previous one, I sent the wrong patch.

This is the correct patch!

Ramon Bastiaans wrote:
I agree, I guess it was in theory possible to trick auth.php into
switching the realm.
Didn't think of that.

What about this one then?

Now it checks if someone is not trying to change the cluster context and
if the cluster is one of the private clusters.

- Ramon.


--
ing. R. Bastiaans

Systems Programmer / High Performance Computing & Visualisation /
SARA                 Computing and Networking Services
Kruislaan 415        PO Box 194613
1098 SJ Amsterdam    1090 GP Amsterdam
P.+31 (0)20 592 3000 F.+31 (0)20 668 3167
---
There are really only three types of people:

 Those who make things happen, those who watch things happen
 and those who say, "What happened?"

--- auth.php.org	2008-03-07 11:31:36.594687419 +0100
+++ auth.php	2008-03-07 12:07:27.086366474 +0100
@@ -30,7 +30,20 @@
 #-------------------------------------------------------------------------------
 function authenticate()
 {
-   header("WWW-authenticate: basic realm=\"Ganglia Private Cluster\"");
+   global $clustername, $cluster;
+
+   $private_clusters = array_keys( embarrassed() );
+
+   if( in_array( $clustername, $private_clusters ) && ( $clustername == $cluster['NAME'] ) )
+   {
+      $auth_header	= "WWW-authenticate: basic realm=\"Private Ganglia cluster: " . $clustername . "\"";
+   }
+   else
+   {
+      $auth_header	= "WWW-authenticate: basic realm=\"Ganglia Private Cluster\"";
+   }
+
+   header( $auth_header );
    header("HTTP/1.0 401 Unauthorized");
    #print "<HTML><HEAD><META HTTP-EQUIV=refresh CONTENT=1 URL=\"../?c=\"></HEAD>";
    print "<H1>You are unauthorized to view the details of this Cluster</H1>";
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ganglia-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to