0

I am trying to set up an OpenLDAP directory using the cn=config (or olc) method. I have got an entry in my directory that looks something like the following:

dn: cn=entry,...
olcAttr: {0}first value...
olcAttr: {1}second value...
olcAttr: {2}third value...

I would like to use ldapmodify to change the attribute {0}first value... to something else, but keeping the same index ({0} - is "index" the right term?).

I tried using the following

dn: cn=entry,...
changetype: modify
replace: olcAttr{0}
olcAttr: {0}new value...

and sundry variations on this theme, but nothing has worked. I have googled (web, duckducked actually) but I don't even know what I am looking for is called, which doesn't make things easier. Can anyone give me some guidance please?

Steve

Stephen Winnall
  • 301
  • 3
  • 14
  • You don't need to worry about the indexes. Just remove the attribute value you don't want and add the value you do want, or use `replace` specifying old and new values, in both cases without specifying the index. – user207421 Oct 16 '20 at 00:29

1 Answers1

0

The simple answer to this question is that you replace ALL of the attributes, thus:

dn: cn=entry,...
changetype: modify
replace: olcAttr
olcAttr: {0}NEW value...
olcAttr: {1}second value...
olcAttr: {2}third value...

There's got to be a better way, surely?

Stephen Winnall
  • 301
  • 3
  • 14