I need to add a bunch of ACLs for my database but am having hard time writing proper LDIF for it. Unfortunately, ldapmodify
is not very helpful with its useless error message:
modifying entry "olcDatabase={1}mdb,cn=config"
ldap_modify: Other (e.g., implementation specific) error (80)
additional info: <olcAccess> handler exited with 1
I currently have the following pretty basic configuration for my MDB database (it has been created by the Debian package configurator for the slapd
package, version 2.4.40):
# {1}mdb, config
dn: olcDatabase={1}mdb,cn=config
objectClass: olcDatabaseConfig
objectClass: olcMdbConfig
olcDatabase: {1}mdb
olcDbDirectory: /var/lib/ldap
olcSuffix: dc=domain,dc=lan
olcAccess: {0}to attrs=userPassword,shadowLastChange
by self write
by anonymous auth
by * none
olcAccess: {1}to dn.base="" by * read
olcAccess: {2}to * by * read
# ... and more
Since I'm setting the database to use as an authentication backend for SAMBA, the database schema has been updated to include SAMBA-specific types and attributes, and now I want to tighten the ACLs on the database accordingly.
What I want to accomplish can be stated like this:
- The
sambaLMPassword
andsambaNTPassword
SAMBA-specific attributes (available on entries of theposixAccount
class) should only be readable/modifiable by their respective owners (self
, that is). - A special user,
dn=sambaAdmin,dc=domain,dc=lan
has been created, and is designated to be used by SAMBA itself andsmbldap-tools
to manage SAMBA-specific users in the database. It should be granted full access to a set of SAMBA-specific OUs in the DIT.
I want my ACL entries be inserted between the rules {0}
and {1}
in the current config.
To achieve what's outlined above, I've prepared the following LDIF file which I'm trying to apply using ldapmodify
and am getting the error presented above.
# {1}mdb, config
dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcAccess
olcAccess: {1}to dn.subtree="ou=Users,dc=domain,dc=lan"
attrs=sambaLMPassword,sambaNTPassword
by self write
by dn=sambaAdmin,dc=domain,dc=lan write
by anonymous auth
by * none
olcAccess: {2}to dn.subtree="ou=Computers,dc=domain,dc=lan"
attrs=sambaLMPassword,sambaNTPassword
by self write
by dn=sambaAdmin,dc=domain,dc=lan write
by anonymous auth
by * none
olcAccess: {3}to dn.subtree="ou=Users,dc=domain,dc=lan"
by dn=sambaAdmin,dc=domain,dc=lan write
olcAccess: {4}to dn.subtree="ou=Groups,dc=domain,dc=lan"
by dn=sambaAdmin,dc=domain,dc=lan write
olcAccess: {5}to dn.subtree="ou=Computers,dc=domain,dc=lan"
by dn=sambaAdmin,dc=domain,dc=lan write
olcAccess: {6}to dn.subtree="ou=Idmap,dc=domain,dc=lan"
by dn=sambaAdmin,dc=domain,dc=lan write
olcAccess: {7}to dn=sambaDomainName=MYSERVER,dc=domain,dc=lan
by dn=sambaAdmin,dc=domain,dc=lan write
Unfortunately, LDIF passes the syntax check (ldapmodify -n -v <path/to/file.ldif
), and the error message is really unhelpful.
Could anyway please help me fix my LDIF to be accepted by slapd
? Or explain me a way to configure it (or ldapmodify
may be?) to be more verbose about the real cause of this error?