From da859b6c1afd272a3904197068de4950cde8325d Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Fri, 04 May 2007 00:55:16 +0000
Subject: [PATCH] Update the default access logger to provide additional more information in some cases:

---
 opends/src/server/org/opends/server/core/AddOperation.java |   58 +++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 47 insertions(+), 11 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/AddOperation.java b/opends/src/server/org/opends/server/core/AddOperation.java
index 42af572..fd411d3 100644
--- a/opends/src/server/org/opends/server/core/AddOperation.java
+++ b/opends/src/server/org/opends/server/core/AddOperation.java
@@ -127,6 +127,9 @@
   // The processed DN of the entry to add.
   private DN entryDN;
 
+  // The proxied authorization target DN for this operation.
+  private DN proxiedAuthorizationDN;
+
   // The entry being added to the server.
   private Entry entry;
 
@@ -180,14 +183,15 @@
     this.rawEntryDN    = rawEntryDN;
     this.rawAttributes = rawAttributes;
 
-    responseControls      = new ArrayList<Control>();
-    cancelRequest         = null;
-    entry                 = null;
-    entryDN               = null;
-    userAttributes        = null;
-    operationalAttributes = null;
-    objectClasses         = null;
-    changeNumber          = -1;
+    responseControls       = new ArrayList<Control>();
+    cancelRequest          = null;
+    entry                  = null;
+    entryDN                = null;
+    userAttributes         = null;
+    operationalAttributes  = null;
+    objectClasses          = null;
+    proxiedAuthorizationDN = null;
+    changeNumber           = -1;
   }
 
 
@@ -252,9 +256,10 @@
       }
     }
 
-    responseControls = new ArrayList<Control>();
-    cancelRequest    = null;
-    changeNumber     = -1;
+    responseControls       = new ArrayList<Control>();
+    proxiedAuthorizationDN = null;
+    cancelRequest          = null;
+    changeNumber           = -1;
   }
 
 
@@ -697,6 +702,21 @@
 
 
   /**
+   * Retrieves the proxied authorization DN for this operation if proxied
+   * authorization has been requested.
+   *
+   * @return  The proxied authorization DN for this operation if proxied
+   *          authorization has been requested, or {@code null} if proxied
+   *          authorization has not been requested.
+   */
+  public DN getProxiedAuthorizationDN()
+  {
+    return proxiedAuthorizationDN;
+  }
+
+
+
+  /**
    * {@inheritDoc}
    */
   @Override()
@@ -1778,6 +1798,14 @@
                 break addProcessing;
               }
               setAuthorizationEntry(authorizationEntry);
+              if (authorizationEntry == null)
+              {
+                proxiedAuthorizationDN = DN.nullDN();
+              }
+              else
+              {
+                proxiedAuthorizationDN = authorizationEntry.getDN();
+              }
             }
             else if (oid.equals(OID_PROXIED_AUTH_V2))
             {
@@ -1848,6 +1876,14 @@
                 break addProcessing;
               }
               setAuthorizationEntry(authorizationEntry);
+              if (authorizationEntry == null)
+              {
+                proxiedAuthorizationDN = DN.nullDN();
+              }
+              else
+              {
+                proxiedAuthorizationDN = authorizationEntry.getDN();
+              }
             }
 
             // NYI -- Add support for additional controls.

--
Gitblit v1.10.0