Good day to all,
I'm currently looking into openldap and want to do some changes on an existing openldap directory. I've been able to apply my changes using delete and add in an ldif.
For example: 10 olcLimits rules. Mine needs to be placed before the last olcLimit. - Delete current last line (with {10} specificier) - Add wanted line - Add previously deleted line
This results in the intended config.
However this looks like a hassle to me. For example in the case I had to insert on the 5th line I would have to delete 5 lines first, then add the line I want and then again add those 5 lines. Or I should use replace for replacing the whole list (what's the correct terminology for a list with {0}, {1}, ... ?). I need to copy paste all that data over to just add 1 new line(in case of olcLimits and olcAccess).
I've been looking for examples for inserting in between but couldn't find any. Maybe I use the wrong keywords in our favorite search engine.
Is this deleting and adding or replacing the way to go to make these changes? Are there alternatives?
Thanks in advance for your responses.
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=oa-2115-f 0 viruses found. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=oa-2115-f <#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
PenguinWhispererThe . wrote:
Good day to all,
I'm currently looking into openldap and want to do some changes on an existing openldap directory. I've been able to apply my changes using delete and add in an ldif.
For example: 10 olcLimits rules. Mine needs to be placed before the last olcLimit.
- Delete current last line (with {10} specificier)
- Add wanted line
- Add previously deleted line
This results in the intended config.
However this looks like a hassle to me. For example in the case I had to insert on the 5th line I would have to delete 5 lines first, then add the line I want and then again add those 5 lines. Or I should use replace for replacing the whole list (what's the correct terminology for a list with {0}, {1}, ... ?). I need to copy paste all that data over to just add 1 new line(in case of olcLimits and olcAccess).
I've been looking for examples for inserting in between but couldn't find any. Maybe I use the wrong keywords in our favorite search engine.
Is this deleting and adding or replacing the way to go to make these changes? Are there alternatives?
That's completely missing the point of these ordering prefixes.
https://tools.ietf.org/html/draft-chu-ldap-xordered-00
On Thu, Mar 10, 2016 at 05:18:01PM +0100, PenguinWhispererThe . wrote:
I've been looking for examples for inserting in between but couldn't find any. Maybe I use the wrong keywords in our favorite search engine.
Is this deleting and adding or replacing the way to go to make these changes? Are there alternatives?
You can add a new entry with the index {n} specified. Existing entries will be re-numbered (their index incremented) to make room.
That's completely missing the point of these ordering prefixes.
I honestly don't see a lot of mentioning about this except for replace and deletes. Maybe it was my use of keywords.
I did some tries but I failed. I couldn't find any clear examples on doing what I wanted. I mostly saw add/replace options but without the {} ordering. I'm very new to this.
I'll try again tomorrow.
So from the IETF I understand I should be using something like this to insert a row at the beginning:
dn: olcDatabase={2}mdb,cn=config changetype:modify add: olcAccess olcAccess: {0}full accessrule
Thanks for your responses! Greatly appreciated!
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=oa-2115-f 0 viruses found. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=oa-2115-f <#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
2016-03-10 18:39 GMT+01:00 Ryan Tandy ryan@nardis.ca:
On Thu, Mar 10, 2016 at 05:18:01PM +0100, PenguinWhispererThe . wrote:
I've been looking for examples for inserting in between but couldn't find any. Maybe I use the wrong keywords in our favorite search engine.
Is this deleting and adding or replacing the way to go to make these changes? Are there alternatives?
You can add a new entry with the index {n} specified. Existing entries will be re-numbered (their index incremented) to make room.
Hi,
That is correct. Also if you leave out the {#} entry, the value will be added at the end of any current values.
I learnt most of these details from the zytrax book on openldap, as it contained non-trivial examples. This section: http://www.zytrax.com/books/ldap/ch6/slapd-config.html#use-security describes the {} functionality.
Regards /Cole
On 10 March 2016 at 22:56, PenguinWhispererThe . < th3penguinwhisperer@gmail.com> wrote:
That's completely missing the point of these ordering prefixes.
I honestly don't see a lot of mentioning about this except for replace and deletes. Maybe it was my use of keywords.
I did some tries but I failed. I couldn't find any clear examples on doing what I wanted. I mostly saw add/replace options but without the {} ordering. I'm very new to this.
I'll try again tomorrow.
So from the IETF I understand I should be using something like this to insert a row at the beginning:
dn: olcDatabase={2}mdb,cn=config changetype:modify add: olcAccess olcAccess: {0}full accessrule
Thanks for your responses! Greatly appreciated!
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=oa-2115-f 0 viruses found. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=oa-2115-f <#-448044489_DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
2016-03-10 18:39 GMT+01:00 Ryan Tandy ryan@nardis.ca:
On Thu, Mar 10, 2016 at 05:18:01PM +0100, PenguinWhispererThe . wrote:
I've been looking for examples for inserting in between but couldn't find any. Maybe I use the wrong keywords in our favorite search engine.
Is this deleting and adding or replacing the way to go to make these changes? Are there alternatives?
You can add a new entry with the index {n} specified. Existing entries will be re-numbered (their index incremented) to make room.
openldap-technical@openldap.org