Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F3A654423 for ; Fri, 17 Jun 2011 15:25:54 +0000 (UTC) Received: (qmail 10270 invoked by uid 500); 17 Jun 2011 15:25:54 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 10233 invoked by uid 500); 17 Jun 2011 15:25:54 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 10226 invoked by uid 99); 17 Jun 2011 15:25:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Jun 2011 15:25:54 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mikeatdot@gmail.com designates 209.85.216.171 as permitted sender) Received: from [209.85.216.171] (HELO mail-qy0-f171.google.com) (209.85.216.171) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Jun 2011 15:25:46 +0000 Received: by qyl38 with SMTP id 38so625537qyl.16 for ; Fri, 17 Jun 2011 08:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=Sy/HGNUTo5BR898p6DfPMSSDUaK50h97fl7z8L9bsSc=; b=nxkOc2l/tkel0X3EWGU5EHX2m/ACJg+UzquyCOZyiBE1td8UIKFY+6HsiqSXa9cjnR PbfZ7urnGi6LK7725X79PyWzFsmkZl6NmV24t1PB0n7SxufVxLCtEkH2NvDTF6vSMxo3 Z6YtnnKVinjluPqFjY1eaWiKfZ/GpykWnxdBc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=dwZcGfS7+xm9oT2nXGAQhO7U8I8MiqXNnf/UKcNmEbA8ZfY9z/Qg1wKygghJjghsgD bn2mdOZEnHsEawGB+VK70IkrSUast4PZI8iVVHGxGOGbLYlWdk7Q5/XXcMpKw1oKbtiU KhLYQPzfN9zIxtKPxYRSlt4H2HkeWUcyHg9a0= MIME-Version: 1.0 Received: by 10.224.27.129 with SMTP id i1mr1691190qac.312.1308324325794; Fri, 17 Jun 2011 08:25:25 -0700 (PDT) Received: by 10.229.237.206 with HTTP; Fri, 17 Jun 2011 08:25:25 -0700 (PDT) In-Reply-To: References: Date: Fri, 17 Jun 2011 16:25:25 +0100 Message-ID: Subject: Re: Getting a LdapSchemaViolationException when modifying a prescriptiveAci on an administrativeSubEntry From: Mike Adamson To: Apache Directory Developers List Content-Type: multipart/alternative; boundary=bcaec51a8c80b0a39204a5e9fe4d X-Virus-Checked: Checked by ClamAV on apache.org --bcaec51a8c80b0a39204a5e9fe4d Content-Type: text/plain; charset=ISO-8859-1 Hi, I will raise one first thing on Monday, unfortunately I've been told I've got to stop now and pack the car. I have managed to work around this problem for the time being by using the adminSession to set the acis but this isn't ideal because it loses the audit trail. MikeA On 17 June 2011 16:14, Kiran Ayyagari wrote: > Hi Mike, this seems to be a side effect of the recent changes done to the > lookup() method, can you file a bug report in JIRA, thanks > > On 17-Jun-2011 7:48 PM, "Mike Adamson" wrote: > > Hi, > > I am attempting to replace a prescriptiveAci on a sub entry using: > > Entry subEntry = session.lookup(subEntryDn, "+"); > ModifyRequest modifyRequest = new > ModifyRequestImpl().setName(subEntryDn).replace("prescriptiveAci", aci); > session.modify(modifyRequest); > > but this always throws a LdapSchemaViolationException. > > I have done some debugging in the code and found that this is coming from > the TupleCache.hasPrecriptiveAci method. It is thrown because this methods > identifies the dn as an administrative sub entry but can't find the > precriptiveAci on it. The root cause of this is this code at the bottom of > the AciAuthorizationInterceptor.modify method: > > Entry modifiedEntry = modifyContext.lookup( dn, > ByPassConstants.LOOKUP_BYPASS ); > tupleCache.subentryModified( dn, mods, modifiedEntry ); > > This lookup does not return the operationalAttributes so will always fail > when modifying an operationalAttribute. > > Is this by design? E.g. is it not possible to modify operationalAttributes > in this way. > > Thanks, > > Mike Adamson > > > --bcaec51a8c80b0a39204a5e9fe4d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

I will raise one first thing on Monday, unfortunately I've b= een told I've got to stop now and pack the car.

I have managed t= o work around this problem for the time being by using the adminSession to = set the acis but this isn't ideal because it loses the audit trail.

MikeA

On 17 June 2011 16:14, Kiran Ay= yagari <kayyag= ari@apache.org> wrote:

Hi Mike, this seems to be a side effect of the recent changes done to th= e lookup() method, can you file a bug report in JIRA, thanks

<= /div>

On 17-Jun-2011 7:48 PM, "Mike Adamson= " <mikeatd= ot@gmail.com> wrote:

Hi,

I am attempting to replace a = prescriptiveAci on a sub entry using:

Entry subEntry =3D session.lookup(subEntryDn, "+");
Modify= Request modifyRequest =3D new ModifyRequestImpl().setName(subEntryDn).repla= ce("prescriptiveAci", aci);
session.modify(modifyRequest);

but this always throws a LdapSchemaVi= olationException.

I have done some debugging in the code and found t= hat this is coming from the TupleCache.hasPrecriptiveAci method. It is thro= wn because this methods identifies the dn as an administrative sub entry bu= t can't find the precriptiveAci on it. The root cause of this is this c= ode at the bottom of the AciAuthorizationInterceptor.modify method:

=A0=A0=A0=A0=A0=A0=A0 Entry modifiedEntry =3D modifyContext.lookup( dn,= ByPassConstants.LOOKUP_BYPASS );
=A0=A0=A0=A0=A0=A0=A0 tupleCache.suben= tryModified( dn, mods, modifiedEntry );

This lookup does not return = the operationalAttributes so will always fail when modifying an operational= Attribute.

Is this by design? E.g. is it not possible to modify operationalAttribu= tes in this way.

Thanks,

Mike Adamson=



--bcaec51a8c80b0a39204a5e9fe4d--