google-code-export / ruby-activeldap

Automatically exported from code.google.com/p/ruby-activeldap
Other
1 stars 1 forks source link

Modify RDN does not work in update_attributes for dn_attribute #32

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create model org_unit.rb
class OrgUnit < ActiveLdap::Base
  ldap_mapping :dn_attribute => "ou", :prefix => "", :classes => ['top', 
'organizationalUnit']
end
2. run script/console
3. create new record and try update ou via update_attibutes method:

ou = OrgUnit.create("test")

method .update_attribute works normal:

ou.update_attribute("ou", "test2")
=> true
ou.ou
=> "test2"
ou.update_attribute("id", "test4")
=> true
ou.ou
=> "test4"

What do you see instead?

>> ou.update_attributes({:id => "test3"})
=> true
>> ou.dc
>> ou.ou
=> "test3"

>> ou.update_attributes({:ou => "test4", :description => "test"})
=> true
>> ou.ou
=> "test3"
>> ou.description
=> "test"

What is the expected output?
RDN should be modified to "test4"

Please use labels and text to provide additional information.
I would suggest: .update_attributes should made modify_rnd and then update 
other attributes.

Original issue reported on code.google.com by Alexey.Chebotar@gmail.com on 10 Oct 2009 at 9:34

GoogleCodeExporter commented 9 years ago
It's intended work.
We blocks DN attribute change by mass update by default. (objectClass is also 
blocked
by default) The current update_attributes(:id => ...) behavior is a bug.

It seems that RDN change by mass update is dangerous. If it's not dangerous, we 
will
not block DN attribute change by mass update by default.

Original comment by kou...@gmail.com on 12 Oct 2009 at 2:11

GoogleCodeExporter commented 9 years ago
Hi koutou.
Sorry, Now I'm very busy with project...

I think change RDN by mass update not so dangerous for 'hdb' database;
But how I remember 'bdb' database can have problems with this..

Problem was described in thread: Question about children with different 
objectClass 
http://rubyforge.org/pipermail/ruby-activeldap-discuss/2009-June/000833.html

Original comment by Alexey.Chebotar@gmail.com on 14 Oct 2009 at 10:58

GoogleCodeExporter commented 9 years ago
I worry about dangerousness on programmer not LDAP backend.
It's dangerous that mass update causes many programming misses or security 
problems.

What do you think about the dangerousness?

Original comment by kou...@gmail.com on 16 Oct 2009 at 12:18