Merge lp:~ahasenack/serverguide/samba-indexes-1603540 into lp:serverguide/trunk

Proposed by Andreas Hasenack
Status: Merged
Approved by: Doug Smythies
Approved revision: 322
Merged at revision: 320
Proposed branch: lp:~ahasenack/serverguide/samba-indexes-1603540
Merge into: lp:serverguide/trunk
Diff against target: 42 lines (+9/-9)
1 file modified
serverguide/C/network-auth.xml (+9/-9)
To merge this branch: bzr merge lp:~ahasenack/serverguide/samba-indexes-1603540
Reviewer Review Type Date Requested Status
Doug Smythies Approve
Review via email: mp+323799@code.launchpad.net

Commit message

Fix proposed samba indexes to avoid duplication errors.

Description of the change

Fix proposed samba indexes to avoid duplication errors.

If you follow the step "Samba indices", and after you change the backend to mdb (that needs to be fixed all over the place and I will open a separate bug about that), you will get duplicate index errors.

That's because out of the box the package already gives you a few:
olcDbIndex: objectClass eq
olcDbIndex: cn,uid eq
olcDbIndex: uidNumber,gidNumber eq
olcDbIndex: member,memberUid eq

We should only add the indexes we need, but that's a bit complicated because you can't modify an existing "cn,uid eq" to "cn,uid eq,sub" (i.e., add "sub") without removing the index first.

An ldapmodify command to do that can be easily constructed, but I think that could get brittle with time because it would depend on the existing indexes the package gives you: if the maintainer decided to change that set, the instructions in the guide would start failing again.

Therefore I propose here to do a bulk index replacement via a "changetype: modify" followed by "replace: olcDbIndex". If this were done on a populated DIT, that would be a very expensive operation, because everything would be reindexed (I'm not sure if openldap knows that an index is being replaced by itself), but this guide assumes a fresh install of slapd, so I think we are good. I took care to merge the existing indexes you get after package installation with the ones we need for samba.

Other changes I did:
- I removed the "pres" index as the openldap admin guide basically says it's seldom useful (http://www.openldap.org/doc/admin24/tuning.html#Presence indexing).
- I added "eq" to the default index type, I think it's the most basic and used one
- grouped indexes of the same type in the same line to make this excerpt a bit shorter

To post a comment you must log in.
Revision history for this message
Doug Smythies (dsmythies) wrote :

O.K. thanks.

(in general, I'll have to take your word for it on the actual content changes, as I do not know.)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'serverguide/C/network-auth.xml'
--- serverguide/C/network-auth.xml 2017-05-09 14:13:52 +0000
+++ serverguide/C/network-auth.xml 2017-05-09 19:24:01 +0000
@@ -2412,21 +2412,21 @@
2412 </para>2412 </para>
24132413
2414<programlisting>2414<programlisting>
2415dn: olcDatabase={1}hdb,cn=config2415dn: olcDatabase={1}mdb,cn=config
2416changetype: modify2416changetype: modify
2417add: olcDbIndex2417replace: olcDbIndex
2418olcDbIndex: uidNumber eq2418olcDbIndex: objectClass eq
2419olcDbIndex: gidNumber eq2419olcDbIndex: uidNumber,gidNumber eq
2420olcDbIndex: loginShell eq2420olcDbIndex: loginShell eq
2421olcDbIndex: uid eq,pres,sub2421olcDbIndex: uid,cn eq,sub
2422olcDbIndex: memberUid eq,pres,sub2422olcDbIndex: memberUid eq,sub
2423olcDbIndex: uniqueMember eq,pres2423olcDbIndex: member,uniqueMember eq
2424olcDbIndex: sambaSID eq2424olcDbIndex: sambaSID eq
2425olcDbIndex: sambaPrimaryGroupSID eq2425olcDbIndex: sambaPrimaryGroupSID eq
2426olcDbIndex: sambaGroupType eq2426olcDbIndex: sambaGroupType eq
2427olcDbIndex: sambaSIDList eq2427olcDbIndex: sambaSIDList eq
2428olcDbIndex: sambaDomainName eq2428olcDbIndex: sambaDomainName eq
2429olcDbIndex: default sub2429olcDbIndex: default sub,eq
2430</programlisting>2430</programlisting>
24312431
2432 <para>2432 <para>
@@ -2443,7 +2443,7 @@
24432443
2444<screen>2444<screen>
2445<command>sudo ldapsearch -Q -LLL -Y EXTERNAL -H \2445<command>sudo ldapsearch -Q -LLL -Y EXTERNAL -H \
2446ldapi:/// -b cn=config olcDatabase={1}hdb olcDbIndex</command>2446ldapi:/// -b cn=config olcDatabase={1}mdb olcDbIndex</command>
2447</screen>2447</screen>
24482448
2449 </sect3>2449 </sect3>

Subscribers

People subscribed via source and target branches