[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: adding an attribute.



Anant S Athavale wrote:

I use openldap 2.2.13 on RHEL and having 4000+ entries.

Update to Buchan Milne's 2.3.whatever (ours on RHAS4 is 2.3.30 using his older rpm specfile).


I have the following requirement.

1. Add one attribute for all the records.

Ok, but only if that attribute is included in one of the objectClasses allowed by the respective schema that you've loaded.


2. Set a value to it, which is already set for another attribute of the same record.

See the above.

A SQL command of the following type would have done this job, if my data was in SQL.

update data
set newattr=oldattr;

Is there any equivalent Openldap command, which can be used to do this.

We do that kind of thing (and often) with a small (20 lines?) shell script using ldapsearch incorporating ldapmodify and a here document.


Now this was probably not the answer that you were hoping for, since the mindsets involved in SQL and LDAP are quite different. Nevertheless, it's the kind of script that, once you've got into the swing of things, will take you a couple of minutes to adapt. Though "getting into the swing of things" could cost you some time, just like learning SQL.

Best,

--Tonni

--
Tonni Earnshaw
tonni @ barlaeus.nl