1 (* Slapd module for Augeas
2 Author: Free Ekanayaka <free@64studio.com>
4 Reference: man slapd.conf(5), man slapd.access (5)
11 (************************************************************************
13 *************************************************************************)
16 let spc = Util.del_ws_spc
17 let sep = del /[ \t\n]+/ " "
19 let sto_to_eol = store /([^ \t\n].*[^ \t\n]|[^ \t\n])/
20 let sto_to_spc = store /[^\\# \t\n]+/
21 let sto_to_by = store (/[^\\# \t\n]+/ - "by")
23 (************************************************************************
25 *************************************************************************)
27 let access_re = "access to"
28 let who = [ spc . label "who" . sto_to_spc ]
29 let what = [ spc . label "what" . sto_to_spc ]
31 (* TODO: parse the control field, see man slapd.access (5) *)
32 let control = [ spc . label "control" . sto_to_by ]
33 let by = [ sep . key "by". who . what. control? ]
35 let access = [ key access_re . spc. sto_to_spc . by+ . eol ]
37 (************************************************************************
39 *************************************************************************)
41 (* TODO: parse special field separately, see man slapd.conf (5) *)
42 let global_re = "allow"
51 | "conn_max_pending_auth"
58 | "index_substr_if_minlen"
59 | "index_substr_if_maxlen"
60 | "index_substr_any_len"
61 | "index_substr_any_step"
69 | "password-crypt-salt-format"
74 | "replicationinterval"
84 | "sockbuf_max_incoming "
85 | "sockbuf_max_incoming_auth"
90 | "TLSCACertificateFile"
91 | "TLSCACertificatePath"
92 | "TLSCertificateFile"
93 | "TLSCertificateKeyFile"
100 let global = Spacevars.entry global_re
102 (************************************************************************
104 *************************************************************************)
106 (* TODO: support all types of database backend *)
107 let database_hdb = "cachesize"
122 let database_re = "suffix"
140 let database = [ key "database"
144 . Spacevars.lns (Spacevars.entry database_re|access) ]
146 (************************************************************************
148 *************************************************************************)
150 let lns = Spacevars.lns (global|access) . (database)*
152 let filter = incl "/etc/ldap/slapd.conf"
153 . incl "/etc/openldap/slapd.conf"
155 let xfm = transform lns filter