Как правильно заменить строки olcAccess в ldapmodify?

Как правильно заменить строки olcAccess в ldapmodify?

Это часть из olcDatabase={1}hdb.ldif

olcAccess: {0}to attrs=userPassword,shadowLastChange
 by self write
 by anonymous auth
 by dn="cn=admin,dc=somesite,dc=com" write
 by * none
olcAccess: {1}to dn.base="" by * read
olcAccess: {2}to *
 by self write
 by dn="cn=admin,dc=somesite,dc=com" write
 by * read

Я хотел бы добавить by dn="cn=anotheruser,ou=Users,dc=somesite,dc=com" writeк строке {0}и {2}.

Прежде чем я уничтожу свой LDAP-сервер,правильный ли следующий LDIF?

dn: olcDatabase{1}hdb,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to attrs=userPassword,shadowLastChange
        by dn="cn=admin,dc=somesite,dc=com" write
        by dn="uid=anotheruser,ou=Users,dc=somesite,dc=com" write
        by anonymous auth
        by self write
        by * none
olcAccess: {2}to *
 by self write
 by dn="cn=admin,dc=somesite,dc=com" write
 by dn="cn=anotheruser,ou=Users,dc=somesite,dc=com" write
 by * read

С:ldapmodify -Y EXTERNAL -H ldapi:/// -f ./changes.ldif

Меня беспокоят следующие вопросы:

  • там 3 olcAccess:строки, я не включил строку {1}, так она все еще будет там после фиксации изменений ldif?
  • Правильная ли replace: olcAccessстрока?

решение1

Этот ldif сработал у меня с предыдущей командой

dn: olcDatabase{1}hdb,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to attrs=userPassword,shadowLastChange
        by dn="cn=admin,dc=somesite,dc=com" write
        by dn="uid=anotheruser,ou=Users,dc=somesite,dc=com" write
        by anonymous auth
        by self write
        by * none
olcAccess: {1}to dn.base="" by * read
olcAccess: {2}to *
 by self write
 by dn="cn=admin,dc=somesite,dc=com" write
 by dn="cn=anotheruser,ou=Users,dc=somesite,dc=com" write
 by * read

Связанный контент