Apache Directory Project - LS Possible Bug?

This is Interesting: Free IT Magazines  
Home > Archive > Apache Directory Project > April 2007 > LS Possible Bug?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author LS Possible Bug?
Ole Ersoy

2007-04-23, 1:11 pm

Hey Guys,

I'm experimenting with hot partitions
(And I'm really impressed with how easy
it is to create on and the simplicity
of the API for this).

I first created a hot partition "ou=das",
then connected to it in LS.

Then I copied:
ou=users,ou=system

And pasted it in ou=das.

This is probably not a valid operation (Although
it looks as if LS is smart enough to rename the entry
properly, substituting ou=das for ou=system),
so I get this:

Error while copying entry
[LDAP: error code 32 - failed to add entry ou=users,ou=das: ou=users,ou=das]
[LDAP: error code 32 - failed to add entry ou=users,ou=das:
ou=users,ou=das]


However, LS still paints it as if it was added.

If I select the ou=das partition and hit
F5 for a refresh, the painted entry disappears.

Thoughts?

Cheers,
Ole


Stefan Seelmann

2007-04-23, 1:11 pm

Hi Ole

Ole Ersoy schrieb:
>
> I first created a hot partition "ou=das",
> then connected to it in LS.


Em, what are hot partitions?

>
> Then I copied:
> ou=users,ou=system
>
> And pasted it in ou=das.
>
> This is probably not a valid operation (Although
> it looks as if LS is smart enough to rename the entry
> properly, substituting ou=das for ou=system),
> so I get this:


From LS point of view this is a valid operation. It just copies the
relative entry with its RDN. It behaves like when you copy a folder in
your favorite filesystem browser.

>
> Error while copying entry
> [LDAP: error code 32 - failed to add entry ou=users,ou=das:
> ou=users,ou=das]
> [LDAP: error code 32 - failed to add entry ou=users,ou=das:
> ou=users,ou=das]
>


Error 32 is a response from the server. So please check the server logs
for details.

>
> However, LS still paints it as if it was added.
>
> If I select the ou=das partition and hit
> F5 for a refresh, the painted entry disappears.
>
> Thoughts?


Yep, you are right. That is a bug in LS. If the operation fails there is
an inconsistency between the model and the directory. Could you please
file a Jira?

Thanks,
Stefan Seelmann


Ole Ersoy

2007-04-23, 1:11 pm

Hey Stefan,


Stefan Seelmann wrote:
> Hi Ole
>
> Ole Ersoy schrieb:
>
> Em, what are hot partitions?


Hot partitions are partitions defined
while the server is running. The DAS
uses the feature to create the
partition ou=das.

Alex has more information here:
http://directory.apache.org/communi...g-apacheds.html


>
> Yep, you are right. That is a bug in LS. If the operation fails there is
> an inconsistency between the model and the directory. Could you please
> file a Jira?


Filing right now.

Cheers,
- Ole



Alex Karasulu

2007-04-23, 7:11 pm

Stefan,

On 4/23/07, Stefan Seelmann <mail-u5vAh58qVnYcTPEt+yaEy4QuADTiUCJX@public.gmane.org> wrote:
SNIP

> Then I copied:
>
> From LS point of view this is a valid operation. It just copies the
> relative entry with its RDN. It behaves like when you copy a folder in
> your favorite filesystem browser.
>
>
> Error 32 is a response from the server. So please check the server logs
> for details.
>
>
> Yep, you are right. That is a bug in LS. If the operation fails there is
> an inconsistency between the model and the directory. Could you please
> file a Jira?



Stefan,

On second thought this may be a server bug or limitation. If you are using
a JNDI rename operation in LS which I think is the case then a move
operation is the case then you're performing what is internally a move()
operation. The problem is move operations in ApacheDS are limited to the
same partition. I don't know for sure but I'm about 80% certain of it.

So if Ole is trying to move a branch from one partition to another the
server will reject the operation or there will be some internal error. The
only way to move a branch in ApacheDS today from one partition to another is
to do an LDIF export, massage the data with a regex and then import the LDIF
back in.

Sorry about this.

Making this operation work across partitions will cost in terms of
performance however the implementation of the operation is simple enough to
implement quickly.

Ole can you try something for me? Create a dummy entry (anything under
ou=system). Create some new container in ou=system like ou=temp,ou=system
and see if you can move that dummy entry (other than ou=users) into it.
This should work since you're in the same partition.

Then try to move the dummy entry from the system partition into your das
partition and see how that goes. I suspect this will fail.

BTW the reason why I don't want to work with ou=users is because the default
authorization manager might be protecting it from move operations. As you
can immaging this could be a very dangerous operation to perform.

Alex

Alex Karasulu

2007-04-23, 7:11 pm

On 4/23/07, Ole Ersoy <ole.ersoy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> Hey Guys,
>
> I'm experimenting with hot partitions
> (And I'm really impressed with how easy
> it is to create on and the simplicity
> of the API for this).



You can thank Trustin for that.

I first created a hot partition "ou=das",
> then connected to it in LS.
>
> Then I copied:
> ou=users,ou=system
>
> And pasted it in ou=das.
>
> This is probably not a valid operation (Although
> it looks as if LS is smart enough to rename the entry
> properly, substituting ou=das for ou=system),
> so I get this:
>
> Error while copying entry
> [LDAP: error code 32 - failed to add entry ou=users,ou=das:
> ou=users,ou=das]
> [LDAP: error code 32 - failed to add entry ou=users,ou=das:
> ou=users,ou=das]
>
>
> However, LS still paints it as if it was added.
>
> If I select the ou=das partition and hit
> F5 for a refresh, the painted entry disappears.
>
> Thoughts?



In general it might be a good idea to try another LDAP client just to narrow
down what's causing the problem. If the other client also has the same
problem it might be an ApacheDS issue. If not then it's probably LS.

Alex

Ole Ersoy

2007-04-23, 7:11 pm



Alex Karasulu wrote:
>
> You can thank Trustin for that.


Thank Trustin!! Brilliant work. It's really slick.


Ole Ersoy

2007-04-23, 7:11 pm

SNIP
>
> Ole can you try something for me? Create a dummy entry (anything under
> ou=system). Create some new container in ou=system like
> ou=temp,ou=system


OK

and see if you can move that dummy entry (other than
> ou=users) into it. This should work since you're in the same partition.


You are right - it works.

>
> Then try to move the dummy entry from the system partition into your das
> partition and see how that goes. I suspect this will fail.


Yes it fails, and LS gives a message, although it still paints
the entry initially, and when the ou=das partition is refreshed it
deletes it.

>
> BTW the reason why I don't want to work with ou=users is because the
> default authorization manager might be protecting it from move
> operations. As you can immaging this could be a very dangerous
> operation to perform.


Yes :-) We want to keep that baby under tight lock.

Ole



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com