ruby - LDAP - How to add an entry to a groupOfUniqueNames? (ERR_250_ENTRY_ALREADY_EXISTS) -
i'm trying add new member of groupofuniquenames object "entry_already_exists" error.
the server apacheds, , code ruby, using using net-ldap:
ldap.add(dn: 'cn=janitors,dc=tidy,dc=example,dc=com', attributes: { :objectclass => "groupofuniquenames", :uniquemember => "uid=broom001,o=users,dc=tidy,dc=example,dc=com" } )
there 1 member in janitors -- mop99 . when call ldap.add, (reformatted readability):
ldap.response: err_250_entry_already_exists cn=janitors,dc=tidy,dc=example,dc=com exists! openstruct { :code => 68, :error_message => "entry_already_exists: failed messagetype : add_request message id : 2 add request : entry dn[n]: cn=janitors,dc=tidy,dc=example,dc=com objectclass: groupofuniquenames uniquemember: uid=mop99,o=users,dc=tidy,dc=example,dc=com : err_250_entry_already_exists cn=janitors,dc=tidy,dc=example,dc=com exists! ", :matched_dn => "", :message => "entry exists" }
i've tried changing ldap.add() ldap.modify(), replaces mop99 broom001, leaving 1 janitor. need add broom001, end ever-growing army of janitors.
i read existing list ldap, append new entry list in ruby, , write list ldap...but introduces race condition janitor lost when 2 try add @ same time. janitors valuable, unacceptable.
i've searched web extensively without finding much, , nothing related net-ldap. did find https://www.openldap.org/lists/openldap-software/199912/msg00164.html describes solution wrt .ldif files, don't know how translate net-ldap.
what missing?
adding object class doesn't make sense. it's there.
just add unique member value.
Comments
Post a Comment