@@ -44,8 +44,8 @@ function openldap_loglevels_to_long = {
44
44
lvls = list (default);
45
45
};
46
46
47
- total= 0;
48
- foreach (idx; lvl; lvls) {
47
+ total = 0;
48
+ foreach (idx; lvl; lvls) {
49
49
if (! exists (the_map[lvl])) {
50
50
return (undef);
51
51
};
@@ -59,31 +59,27 @@ function openldap_loglevels_to_long = {
59
59
60
60
@documentation {
61
61
power of 2 (up to 64k)
62
+ This is based on public domain code from http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
62
63
}
63
- type long_pow2 = long with (SELF==1|| SELF==2|| SELF==4|| SELF==8||
64
- SELF==16|| SELF==32|| SELF==64|| SELF==128|| SELF==256|| SELF==512||
65
- SELF==1024|| SELF==2048|| SELF==4096|| SELF==8192|| SELF==16384||
66
- SELF==32768|| SELF==65536||
67
- error (" Only powers of two are accepted" ));
64
+ type long_pow2 = long(1..65535) with (SELF & (SELF - 1)) == 0 || error (" Only powers of two are accepted" );
68
65
69
66
@documentation {
70
67
Possible acceptable values
71
68
}
72
- type ldap_hash = string with match (SELF, ' \{(S?(SHA|MD5))\}' ) ||
73
- error (" Only secure hashes are accepted here: {SSHA, SHA, SMD5, MD5}" );
69
+ type ldap_hash = string with match (SELF, ' \{(S?(SHA|MD5))\}' ) || error (
70
+ " Only secure hashes are accepted here: {SSHA, SHA, SMD5, MD5}"
71
+ );
74
72
75
73
type ldap_sizelimit = {
76
74
" soft" ? long
77
75
" hard" ? long
78
- } with exists (SELF[" soft" ]) || exists (SELF[" hard" ]) ||
79
- error (" Either 'soft' or 'hard' limits must be supplied" );
76
+ } with exists (SELF[" soft" ]) || exists (SELF[" hard" ]) || error (" Either 'soft' or 'hard' limits must be supplied" );
80
77
81
78
type ldap_buffer_size = {
82
79
" listener" ? type_absoluteURI
83
80
" read" ? long
84
81
" write" ? long
85
- } with exists (SELF[" read" ]) || exists (SELF[" write" ]) ||
86
- error (" Either 'read' or 'write' limits must be supplied" );
82
+ } with exists (SELF[" read" ]) || exists (SELF[" write" ]) || error (" Either 'read' or 'write' limits must be supplied" );
87
83
88
84
type ldap_access_item = {
89
85
" who" ? string
@@ -181,12 +177,13 @@ type ldap_global = {
181
177
};
182
178
183
179
184
- type ldap_database_string = string with
185
- match (SELF, " ^(bdb|config|dnssrv|hdb|ldap|ldif|meta|monitor|null|passwd|perl|relay|shell|sql)$" ) ||
186
- error (" Unknown LDAP database type. Check sladpd.conf man page" );
180
+ type ldap_database_string = string with match (SELF,
181
+ " ^(bdb|config|dnssrv|hdb|ldap|ldif|meta|monitor|null|passwd|perl|relay|shell|sql)$"
182
+ ) || error (" Unknown LDAP database type. Check sladpd.conf man page" );
187
183
188
- type ldap_ops = string with
189
- match (SELF, ' ^(add|bind|compare|delete|modify|rename|search|read|write|(extended=\w+)|rename)$' );
184
+ type ldap_ops = string with match (SELF,
185
+ ' ^(add|bind|compare|delete|modify|rename|search|read|write|(extended=\w+)|rename)$'
186
+ );
190
187
191
188
type ldap_replica_retries = {
192
189
" interval" : string
0 commit comments