https://bugs.openldap.org/show_bug.cgi?id=10374

          Issue ID: 10374
           Summary: pcache
                    olcOverlay={0}pcache,olcDatabase={2}sql,cn=config:
                    template index 0 invalid
           Product: OpenLDAP
           Version: 2.6.8
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Keywords: needs_review
          Severity: normal
          Priority: ---
         Component: overlays
          Assignee: b...@openldap.org
          Reporter: bertr...@jacquin.bzh
  Target Milestone: ---

Hi,

As a follow-up from https://bugs.openldap.org/show_bug.cgi?id=10373, it appears
that the configuration I had shared can be converted to olc with slaptest,
however does not pass validation  be loaded when the daemon start:

```
$ slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d
$ slaptest -u -F /etc/openldap/slapd.d -d stats -d pcache
unrecognized log level "pcache" (deferred)
Total # of attribute sets to be cached = 16.
Template:
  query template: (mail=)
  attributes:
        *
        +
Template:
  query template: (objectClass=*)
  attributes:
        *
        +
Template:
  query template: (objectClass=*)
  attributes:
        mail
Template:
  query template: (objectClass=)
  attributes:
        ou
        cn
        givenName
        sn
        mail
        telephoneNumber
        description
        jpegPhoto
        objectClass
Template:
  query template: (objectClass=*)
  attributes:
        ou
        cn
        givenName
        sn
        mail
        telephoneNumber
        description
        jpegPhoto
        objectClass
Template:
  query template: (&(objectClass=)(&(jpegPhoto=*)(|(mail=))))
  attributes:
        ou
        cn
        givenName
        sn
        mail
        telephoneNumber
        description
        jpegPhoto
        objectClass
Template:
  query template: (objectClass=)
  attributes:
        ou
        cn
        givenName
        sn
        mail
        telephoneNumber
        jid
        description
        jpegPhoto
        objectClass
Template:
  query template: (objectClass=*)
  attributes:
        ou
        cn
        givenName
        sn
        mail
        telephoneNumber
        jid
        description
        jpegPhoto
        objectClass
Template:
  query template: (&(objectClass=)(&(jpegPhoto=*)(|(mail=))))
  attributes:
        ou
        cn
        givenName
        sn
        mail
        telephoneNumber
        jid
        description
        jpegPhoto
        objectClass
Template:
  query template: (jid=)
  attributes:
        jid
config error processing olcOverlay={0}pcache,olcDatabase={2}sql,cn=config:
template index 0 invalid (0->15)
slaptest: bad configuration directory!
```

>From the following slapd.conf:

```
overlay pcache
pcache mdb 65536 16 1024 60
directory /var/lib/openldap-data/pcache
pcacheMaxQueries 1024

# No TTR, see https://bugs.openldap.org/show_bug.cgi?id=10373

# Cache DN
pcacheAttrset  0 1.1
pcacheTemplate (objectClass=)                              0 3600 60 0
pcacheTemplate (objectClass=*)                             0 3600 60 0
pcacheTemplate (&(objectClass=)(&(jpegPhoto=*)(|(mail=)))) 0 3600 60 0

pcacheAttrset  1 jid
pcacheTemplate (jid=)                                      1 3600 60 0

pcacheAttrset  2 ou cn givenname sn mail telephonenumber jid description
jpegphoto objectClass
pcacheTemplate (&(objectClass=)(&(jpegPhoto=*)(|(mail=)))) 2 3600 60 0
pcacheTemplate (objectClass=*)                             2 3600 60 0
pcacheTemplate (objectClass=)                              2 3600 60 0

pcacheAttrset  3 ou cn givenname sn mail telephonenumber description jpegphoto
objectClass
pcacheTemplate (&(objectClass=)(&(jpegPhoto=*)(|(mail=)))) 3 3600 60 0
pcacheTemplate (objectClass=*)                             3 3600 60 0
pcacheTemplate (objectClass=)                              3 3600 60 0

pcacheAttrset  4 mail
pcacheTemplate (objectClass=*)                             4 3600 60 0

pcacheAttrset  5 * +
pcacheTemplate (objectClass=*)                             5 3600 60 0
pcacheTemplate (mail=)                                     5 3600 60 0
```

The following olc configuration get generated

```
$ cat
/etc/openldap/slapd.d/cn=config/olcDatabase={2}sql/olcOverlay={0}pcache/olcDatabase={0}mdb.ldif
# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
# CRC32 20578f61
dn: olcDatabase={0}mdb
objectClass: olcMdbConfig
objectClass: olcPcacheDatabase
olcDatabase: {0}mdb
olcDbDirectory: /var/lib/openldap-data/pcache
olcDbNoSync: FALSE
olcDbMaxReaders: 0
olcDbMaxSize: 10485760
olcDbMode: 0600
olcDbSearchStack: 16
olcDbMaxEntrySize: 0
olcDbRtxnSize: 10000
structuralObjectClass: olcMdbConfig
entryUUID: ff5661e1-1259-4408-89a8-68f3c1b36095
creatorsName: cn=config
createTimestamp: 20250724124836Z
entryCSN: 20250724124836.628803Z#000000#000#000000
modifiersName: cn=config
modifyTimestamp: 20250724124836Z

$ cat
/etc/openldap/slapd.d/cn=config/olcDatabase={2}sql/olcOverlay={0}pcache.ldif
# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
# CRC32 a8cfafe8
dn: olcOverlay={0}pcache
objectClass: olcOverlayConfig
objectClass: olcPcacheConfig
olcOverlay: {0}pcache
olcPcache: mdb 65536 16 1024 60
olcPcacheAttrset: 1 jid
olcPcacheAttrset: 2 ou cn givenName sn mail telephoneNumber jid description jp
 egPhoto objectClass
olcPcacheAttrset: 3 ou cn givenName sn mail telephoneNumber description jpegPh
 oto objectClass
olcPcacheAttrset: 4 mail
olcPcacheAttrset: 5 * +
olcPcacheTemplate: "(mail=)" 5 3600 60 0 0
olcPcacheTemplate: "(objectClass=*)" 5 3600 60 0 0
olcPcacheTemplate: "(objectClass=*)" 4 3600 60 0 0
olcPcacheTemplate: "(objectClass=)" 3 3600 60 0 0
olcPcacheTemplate: "(objectClass=*)" 3 3600 60 0 0
olcPcacheTemplate: "(&(objectClass=)(&(jpegPhoto=*)(|(mail=))))" 3 3600 60 0 0
olcPcacheTemplate: "(objectClass=)" 2 3600 60 0 0
olcPcacheTemplate: "(objectClass=*)" 2 3600 60 0 0
olcPcacheTemplate: "(&(objectClass=)(&(jpegPhoto=*)(|(mail=))))" 2 3600 60 0 0
olcPcacheTemplate: "(jid=)" 1 3600 60 0 0
olcPcacheTemplate: "(&(objectClass=)(&(jpegPhoto=*)(|(mail=))))" 0 3600 60 0 0
olcPcacheTemplate: "(objectClass=*)" 0 3600 60 0 0
olcPcacheTemplate: "(objectClass=)" 0 3600 60 0 0
olcPcachePosition: tail
olcPcacheMaxQueries: 1024
olcPcachePersist: FALSE
olcPcacheValidate: FALSE
olcPcacheOffline: FALSE
structuralObjectClass: olcPcacheConfig
entryUUID: dbee2888-2741-4298-abc3-81ae4bd9433a
creatorsName: cn=config
createTimestamp: 20250724124836Z
entryCSN: 20250724124836.628803Z#000000#000#000000
modifiersName: cn=config
modifyTimestamp: 20250724124836Z
```

Is this a known limitation at the moment ?

Cheers,
Bertrand

-- 
You are receiving this mail because:
You are on the CC list for the issue.

Reply via email to