--On Monday, April 4, 2022 8:30 PM +0200 Ondřej Kuzník
<[email protected]> wrote:
On Mon, Apr 04, 2022 at 11:24:36PM +0800, David Timber wrote:
This is all I can find. I'm not doing that. Are you saying I can just use
ldapadd? Care to elaborate?
If you have a slapd.conf style file you have to convert it first, but
it's not rocket science, this is a simple filter I came up with after
5 minutes and it seems to process all the schema files in OpenLDAP
sources just fine (YMMV):
sed -e 's/^\t\+/ /' | \
perl -p0e 's/\n //g' | \
sed \
-e "1i\cn=$name,cn=schema,cn=config\nobjectClass:
olcSchemaConfig\ncn: $name" \ -e '/^#.*//' \
-e '/^[\s]*$/d' \
-e 's/^attributetype\s\+/olcAttributeTypes: /i' \
-e 's/^objectclass\s\+/olcObjectClasses: /i' \
-e 's/^ditcontentrule\s\+/olcDitContentRules: /i' \
-e 's/^ldap-syntax\s\+/olcLdapSyntaxes: /i' \
-e 's/^objectidentifier\s\+/olcObjectIdentifier: /i'
As I noted, we already ship all official schema in LDIF format, so there's
really no reason to have to do this. I guess it's useful for custom schema
if using slaptest is too technically challenging.
--Quanah