-
Notifications
You must be signed in to change notification settings - Fork 80
/
slap.h
2636 lines (2366 loc) · 112 KB
/
slap.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/** BEGIN COPYRIGHT BLOCK
* Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
* Copyright (C) 2009 Red Hat, Inc.
* Copyright (C) 2009 Hewlett-Packard Development Company, L.P.
* All rights reserved.
*
* Contributors:
* Hewlett-Packard Development Company, L.P.
* Bugfix for bug #195302
*
* License: GPL (version 3 or any later version).
* See LICENSE for details.
* END COPYRIGHT BLOCK **/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* slap.h - stand alone ldap server include file */
#ifndef _SLDAPD_H_
#define _SLDAPD_H_
/* Used by SSL and DES plugin */
#ifdef NEED_TOK_PBE
static char tokPBE[34] = "Communicator Generic Crypto Svcs";
static char ptokPBE[34] = "Internal (Software) Token ";
#endif
/*
* The slapd executable can function in on of several modes.
*/
#define SLAPD_EXEMODE_UNKNOWN 0
#define SLAPD_EXEMODE_SLAPD 1
#define SLAPD_EXEMODE_DB2LDIF 2
#define SLAPD_EXEMODE_LDIF2DB 3
#define SLAPD_EXEMODE_DB2ARCHIVE 4
#define SLAPD_EXEMODE_ARCHIVE2DB 5
#define SLAPD_EXEMODE_DBTEST 6
#define SLAPD_EXEMODE_DB2INDEX 7
#define SLAPD_EXEMODE_REFERRAL 8
#define SLAPD_EXEMODE_SUFFIX2INSTANCE 9
#define SLAPD_EXEMODE_PRINTVERSION 10
#define SLAPD_EXEMODE_UPGRADEDB 11
#define SLAPD_EXEMODE_DBVERIFY 12
#define SLAPD_EXEMODE_UPGRADEDNFORMAT 13
#define LDAP_SYSLOG
#include <syslog.h>
#define RLIM_TYPE int
#include <poll.h>
#define POLL_STRUCT PRPollDesc
#define POLL_FN PR_Poll
#include <stdio.h> /* for FILE */
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#if defined(SOLARIS)
#include <limits.h> /* for LONG_MAX */
#endif
/* there's a bug in the dbm code we import (from where?) -- FIXME */
#ifdef LINUX
#define LITTLE_ENDIAN __LITTLE_ENDIAN
#endif
#include <cert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <time.h> /* For timespec definitions */
/* Provides our int types and platform specific requirements. */
#include <slapi_pal.h>
#define LOG_INTERNAL_OP_CON_ID "Internal"
#define LOG_INTERNAL_OP_OP_ID -1
#define MAX_SERVICE_NAME 25
#define SLAPD_TYPICAL_ATTRIBUTE_NAME_MAX_LENGTH 256
typedef struct symbol_t
{
const char *name;
unsigned number;
} symbol_t;
#define SLAPD_SSLCLIENTAUTH_OFF 0
#define SLAPD_SSLCLIENTAUTH_ALLOWED 1 /* server asks for cert, but client need not send one */
#define SLAPD_SSLCLIENTAUTH_REQUIRED 2 /* server will refuse SSL session unless client sends cert */
#define NUM_SNMP_INT_TBL_ROWS 5
#define SNMP_FIELD_LENGTH 100
/* include NSPR header files */
#include "nspr.h"
#include "plhash.h"
/* include NSS header files */
#include "ssl.h"
#include <sys/types.h> /* this should be moved into avl.h */
#include "avl.h"
#include "ldap.h"
#include "ldaprot.h"
#include "ldif.h"
#include "portable.h"
#include "disconnect_errors.h"
#include "csngen.h"
#include "uuid.h"
/* Because we provide getFrontendConfig, and that contains localuserinfo, we
* need to provide pwd.h to allow resolution of the passwd struct.
*/
#include <pwd.h>
#include <nunc-stans.h>
#ifdef WITH_SYSTEMD
#ifdef HAVE_JOURNALD
#include <systemd/sd-journal.h>
#endif
#include <systemd/sd-daemon.h>
#endif
#if defined(OS_solaris)
#include <thread.h>
#define GET_THREAD_ID() thr_self()
#else
#include <pthread.h>
#define GET_THREAD_ID() pthread_self()
#endif
/*
* XXXmcs: these are defined by ldap.h or ldap-extension.h,
* but only in a newer release than we use with DS today.
*/
#ifndef LDAP_CONTROL_AUTH_RESPONSE
#define LDAP_CONTROL_AUTH_RESPONSE "2.16.840.1.113730.3.4.15"
#endif
#ifndef LDAP_CONTROL_REAL_ATTRS_ONLY
#define LDAP_CONTROL_REAL_ATTRS_ONLY "2.16.840.1.113730.3.4.17"
#endif
#ifndef LDAP_CONTROL_VIRT_ATTRS_ONLY
#define LDAP_CONTROL_VIRT_ATTRS_ONLY "2.16.840.1.113730.3.4.19"
#endif
#ifndef LDAP_CONTROL_GET_EFFECTIVE_RIGHTS
#define LDAP_CONTROL_GET_EFFECTIVE_RIGHTS "1.3.6.1.4.1.42.2.27.9.5.2"
#endif
/* PAGED RESULTS control (shared by request and response) */
#ifndef LDAP_CONTROL_PAGEDRESULTS
#define LDAP_CONTROL_PAGEDRESULTS "1.2.840.113556.1.4.319"
#endif
#define SLAPD_VENDOR_NAME VENDOR
#define SLAPD_VERSION_STR CAPBRAND "-Directory/" DS_PACKAGE_VERSION
#define SLAPD_SHORT_VERSION_STR DS_PACKAGE_VERSION
typedef void (*VFP)(void *);
typedef void (*VFPP)(void **);
typedef void (*VFP0)(void);
#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
#endif
typedef void (*VFPV)(); /* takes undefined arguments */
#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
#pragma GCC diagnostic pop
#endif
#define LDAPI_INTERNAL 1
#include "slapi-private.h"
#include "pw.h"
/*
* call the appropriate signal() function.
*/
#if defined(hpux)
/*
* we should not mix POSIX signal library function (sigaction)
* with SYSV's (sigset) on IRIX. nspr uses POSIX internally.
*/
#define SIGNAL(s, a) signal2sigaction(s, (void *)a)
#elif (defined(SYSV) || defined(aix))
#define SIGNAL sigset
#else
#define SIGNAL signal
#endif
/*
* SLAPD_PR_WOULD_BLOCK_ERROR() returns non-zero if prerrno is an NSPR
* error code that indicates a temporary non-blocking I/O error,
* e.g., PR_WOULD_BLOCK_ERROR.
*/
#define SLAPD_PR_WOULD_BLOCK_ERROR(prerrno) \
((prerrno) == PR_WOULD_BLOCK_ERROR || (prerrno) == PR_IO_TIMEOUT_ERROR)
/*
* SLAPD_SYSTEM_WOULD_BLOCK_ERROR() returns non-zero if syserrno is an OS
* error code that indicates a temporary non-blocking I/O error,
* e.g., EAGAIN.
*/
#define SLAPD_SYSTEM_WOULD_BLOCK_ERROR(syserrno) \
((syserrno) == EAGAIN || (syserrno) == EWOULDBLOCK)
#define LDAP_ON 1
#define LDAP_OFF 0
#define LDAP_UNDEFINED (-1)
#ifndef SLAPD_INVALID_SOCKET
#define SLAPD_INVALID_SOCKET 0
#endif
#define SLAPD_INVALID_SOCKET_INDEX (-1)
#define ETIME_BUFSIZ 42 /* room for struct timespec */
/* ============================================================================
* CONFIGURATION DEFAULTS
*
* All our server defaults are defined here. Sometimes these are in pairs of a
* type and a str type. These are largely consumed in libglobs.c
* The reason for their inclusion here is cleanliness of libglobs, centralisation
* There were a few values that differed between the libglobs and the define,
* so this also helps to eliminate that.
*/
#define SLAPD_DEFAULT_FILE_MODE S_IRUSR | S_IWUSR
#define SLAPD_DEFAULT_DIR_MODE S_IRWXU
#define SLAPD_DEFAULT_IDLE_TIMEOUT 0 /* seconds - 0 == never */
#define SLAPD_DEFAULT_IDLE_TIMEOUT_STR "0"
#define SLAPD_DEFAULT_SIZELIMIT 2000 /* use -1 for no limit */
#define SLAPD_DEFAULT_SIZELIMIT_STR "2000"
#define SLAPD_DEFAULT_TIMELIMIT 3600 /* use -1 for no limit */
#define SLAPD_DEFAULT_TIMELIMIT_STR "3600"
#define SLAPD_DEFAULT_LOOKTHROUGHLIMIT 5000 /* use -1 for no limit */
#define SLAPD_DEFAULT_GROUPNESTLEVEL 5
#define SLAPD_DEFAULT_MAX_FILTER_NEST_LEVEL 40 /* use -1 for no limit */
#define SLAPD_DEFAULT_MAX_SASLIO_SIZE 2097152 /* 2MB in bytes. Use -1 for no limit */
#define SLAPD_DEFAULT_MAX_SASLIO_SIZE_STR "2097152"
#define SLAPD_DEFAULT_IOBLOCK_TIMEOUT 300000 /* 5 minutes in ms */
#define SLAPD_DEFAULT_IOBLOCK_TIMEOUT_STR "300000"
#define SLAPD_DEFAULT_OUTBOUND_LDAP_IO_TIMEOUT 300000 /* 5 minutes in ms */
#define SLAPD_DEFAULT_OUTBOUND_LDAP_IO_TIMEOUT_STR "300000"
#define SLAPD_DEFAULT_RESERVE_FDS 64
#define SLAPD_DEFAULT_RESERVE_FDS_STR "64"
#define SLAPD_DEFAULT_MAX_THREADS -1 /* connection pool threads */
#define SLAPD_DEFAULT_MAX_THREADS_STR "-1"
#define SLAPD_DEFAULT_MAX_THREADS_PER_CONN 5 /* allowed per connection */
#define SLAPD_DEFAULT_MAX_THREADS_PER_CONN_STR "5"
#define SLAPD_DEFAULT_MAX_BERSIZE_STR "0"
#define SLAPD_DEFAULT_SCHEMA_IGNORE_TRAILING_SPACES LDAP_OFF
#define SLAPD_DEFAULT_LOCAL_SSF 71 /* assume local connections are secure */
#define SLAPD_DEFAULT_LOCAL_SSF_STR "71"
#define SLAPD_DEFAULT_MIN_SSF 0 /* allow unsecured connections (no privacy or integrity) */
#define SLAPD_DEFAULT_MIN_SSF_STR "0"
#define SLAPD_DEFAULT_SASL_MAXBUFSIZE 2097152
#define SLAPD_DEFAULT_SASL_MAXBUFSIZE_STR "2097152"
#define SLAPD_DEFAULT_MAXBERSIZE 2097152
#define SLAPD_DEFAULT_MAXBERSIZE_STR "2097152"
#define SLAPD_DEFAULT_MAXSIMPLEPAGED_PER_CONN (-1)
#define SLAPD_DEFAULT_MAXSIMPLEPAGED_PER_CONN_STR "-1"
/* We'd like this number to be prime for the hash into the Connection table */
#define SLAPD_DEFAULT_CONNTABLESIZE 4093 /* connection table size */
#define SLAPD_DEFAULT_NDN_SIZE 20971520
#define SLAPD_DEFAULT_NDN_SIZE_STR "20971520"
#define SLAPD_DEFAULT_DIRECTORY_MANAGER "cn=Directory Manager"
#define SLAPD_DEFAULT_UIDNUM_TYPE "uidNumber"
#define SLAPD_DEFAULT_GIDNUM_TYPE "gidNumber"
#define SLAPD_ENTRYUSN_IMPORT_INIT "0"
#define SLAPD_INIT_LOGGING_BACKEND_INTERNAL "dirsrv-log"
#define SLAPD_DEFAULT_SSLCLIENTAUTH SLAPD_SSLCLIENTAUTH_ALLOWED
#define SLAPD_DEFAULT_SSLCLIENTAUTH_STR "allowed"
#define SLAPD_DEFAULT_ALLOW_ANON_ACCESS SLAPD_ANON_ACCESS_ON
#define SLAPD_DEFAULT_ALLOW_ANON_ACCESS_STR "on"
#define SLAPD_DEFAULT_VALIDATE_CERT SLAPD_VALIDATE_CERT_WARN
#define SLAPD_DEFAULT_VALIDATE_CERT_STR "warn"
#define SLAPD_DEFAULT_UNHASHED_PW_SWITCH SLAPD_UNHASHED_PW_ON
#define SLAPD_DEFAULT_UNHASHED_PW_SWITCH_STR "on"
#define SLAPD_DEFAULT_LDAPI_SEARCH_BASE "dc=example,dc=com"
#define SLAPD_DEFAULT_LDAPI_AUTO_DN "cn=peercred,cn=external,cn=auth"
#define SLAPD_MONITOR_DN "cn=monitor"
#define SLAPD_SCHEMA_DN "cn=schema"
#define SLAPD_CONFIG_DN "cn=config"
#define SLAPD_INIT_LOG_MODE "600"
#define SLAPD_INIT_ACCESSLOG_ROTATIONUNIT "day"
#define SLAPD_INIT_ERRORLOG_ROTATIONUNIT "week"
#define SLAPD_INIT_AUDITLOG_ROTATIONUNIT "week"
#define SLAPD_INIT_AUDITFAILLOG_ROTATIONUNIT "week"
#define SLAPD_INIT_LOG_EXPTIMEUNIT "month"
#define SLAPD_DEFAULT_LOG_ROTATIONSYNCHOUR 0
#define SLAPD_DEFAULT_LOG_ROTATIONSYNCHOUR_STR "0"
#define SLAPD_DEFAULT_LOG_ROTATIONSYNCMIN 0
#define SLAPD_DEFAULT_LOG_ROTATIONSYNCMIN_STR "0"
#define SLAPD_DEFAULT_LOG_ROTATIONTIME 1
#define SLAPD_DEFAULT_LOG_ROTATIONTIME_STR "1"
#define SLAPD_DEFAULT_LOG_ACCESS_MAXNUMLOGS 10
#define SLAPD_DEFAULT_LOG_ACCESS_MAXNUMLOGS_STR "10"
#define SLAPD_DEFAULT_LOG_MAXNUMLOGS 1
#define SLAPD_DEFAULT_LOG_MAXNUMLOGS_STR "1"
#define SLAPD_DEFAULT_LOG_EXPTIME 1
#define SLAPD_DEFAULT_LOG_EXPTIME_STR "1"
/* This is in MB */
#define SLAPD_DEFAULT_LOG_ACCESS_MAXDISKSPACE 500
#define SLAPD_DEFAULT_LOG_ACCESS_MAXDISKSPACE_STR "500"
#define SLAPD_DEFAULT_LOG_MAXDISKSPACE 100
#define SLAPD_DEFAULT_LOG_MAXDISKSPACE_STR "100"
#define SLAPD_DEFAULT_LOG_MAXLOGSIZE 100
#define SLAPD_DEFAULT_LOG_MAXLOGSIZE_STR "100"
#define SLAPD_DEFAULT_LOG_MINFREESPACE 5
#define SLAPD_DEFAULT_LOG_MINFREESPACE_STR "5"
/* The default log levels:
* (LDAP_DEBUG_ANY | LDAP_DEBUG_EMERG | LDAP_DEBUG_ALERT | LDAP_DEBUG_CRIT | LDAP_DEBUG_ERR |
* LDAP_DEBUG_WARNING | LDAP_DEBUG_NOTICE | LDAP_DEBUG_INFO)
*/
#define SLAPD_DEFAULT_ERRORLOG_LEVEL 266354688
#define SLAPD_DEFAULT_FE_ERRORLOG_LEVEL 16384 /* frontend log level */
#define SLAPD_DEFAULT_FE_ERRORLOG_LEVEL_STR "16384"
#define SLAPD_DEFAULT_ACCESSLOG_LEVEL 256
#define SLAPD_DEFAULT_ACCESSLOG_LEVEL_STR "256"
#define SLAPD_DEFAULT_DISK_THRESHOLD 2097152
#define SLAPD_DEFAULT_DISK_THRESHOLD_STR "2097152"
#define SLAPD_DEFAULT_DISK_GRACE_PERIOD 60
#define SLAPD_DEFAULT_DISK_GRACE_PERIOD_STR "60"
#define SLAPD_DEFAULT_PAGEDSIZELIMIT 0
#define SLAPD_DEFAULT_PAGEDSIZELIMIT_STR "0"
#define SLAPD_DEFAULT_MAXDESCRIPTORS 1024
#define SLAPD_DEFAULT_MAXDESCRIPTORS_STR "1024"
#define SLAPD_DEFAULT_MAX_FILTER_NEST_LEVEL 40
#define SLAPD_DEFAULT_MAX_FILTER_NEST_LEVEL_STR "40"
#define SLAPD_DEFAULT_GROUPEVALNESTLEVEL 0
#define SLAPD_DEFAULT_GROUPEVALNESTLEVEL_STR "0"
#define SLAPD_DEFAULT_SNMP_INDEX 0
#define SLAPD_DEFAULT_SNMP_INDEX_STR "0"
#define SLAPD_DEFAULT_PW_INHISTORY 6
#define SLAPD_DEFAULT_PW_INHISTORY_STR "6"
#define SLAPD_DEFAULT_PW_GRACELIMIT 0
#define SLAPD_DEFAULT_PW_GRACELIMIT_STR "0"
#define SLAPD_DEFAULT_PW_MINLENGTH 8
#define SLAPD_DEFAULT_PW_MINLENGTH_STR "8"
#define SLAPD_DEFAULT_PW_MINDIGITS 0
#define SLAPD_DEFAULT_PW_MINDIGITS_STR "0"
#define SLAPD_DEFAULT_PW_MINALPHAS 0
#define SLAPD_DEFAULT_PW_MINALPHAS_STR "0"
#define SLAPD_DEFAULT_PW_MINUPPERS 0
#define SLAPD_DEFAULT_PW_MINUPPERS_STR "0"
#define SLAPD_DEFAULT_PW_MINLOWERS 0
#define SLAPD_DEFAULT_PW_MINLOWERS_STR "0"
#define SLAPD_DEFAULT_PW_MINSPECIALS 0
#define SLAPD_DEFAULT_PW_MINSPECIALS_STR "0"
#define SLAPD_DEFAULT_PW_MIN8BIT 0
#define SLAPD_DEFAULT_PW_MIN8BIT_STR "0"
#define SLAPD_DEFAULT_PW_MAXREPEATS 0
#define SLAPD_DEFAULT_PW_MAXREPEATS_STR "0"
#define SLAPD_DEFAULT_PW_MINCATEGORIES 3
#define SLAPD_DEFAULT_PW_MINCATEGORIES_STR "3"
#define SLAPD_DEFAULT_PW_MINTOKENLENGTH 3
#define SLAPD_DEFAULT_PW_MINTOKENLENGTH_STR "3"
#define SLAPD_DEFAULT_PW_MAXAGE 8640000
#define SLAPD_DEFAULT_PW_MAXAGE_STR "8640000"
#define SLAPD_DEFAULT_PW_MINAGE 0
#define SLAPD_DEFAULT_PW_MINAGE_STR "0"
#define SLAPD_DEFAULT_PW_WARNING 86400
#define SLAPD_DEFAULT_PW_WARNING_STR "86400"
#define SLAPD_DEFAULT_PW_MAXFAILURE 3
#define SLAPD_DEFAULT_PW_MAXFAILURE_STR "3"
#define SLAPD_DEFAULT_PW_RESETFAILURECOUNT 600
#define SLAPD_DEFAULT_PW_RESETFAILURECOUNT_STR "600"
#define SLAPD_DEFAULT_PW_LOCKDURATION 3600
#define SLAPD_DEFAULT_PW_LOCKDURATION_STR "3600"
/* Default password values. */
/* ================ END CONFIGURATION DEFAULTS ============================ */
#define EGG_OBJECT_CLASS "directory-team-extensible-object"
#define EGG_FILTER "(objectclass=directory-team-extensible-object)"
#define BE_LIST_SIZE 1000 /* used by mapping tree code to hold be_list stuff */
#define REPL_DBTYPE "ldbm"
#define REPL_DBTAG "repl"
#define ATTR_NETSCAPEMDSUFFIX "netscapemdsuffix"
#define PWD_PBE_DELIM '-'
#define REFERRAL_REMOVE_CMD "remove"
/* Filenames for DSE storage */
#define DSE_FILENAME "dse.ldif"
#define DSE_TMPFILE "dse.ldif.tmp"
#define DSE_BACKFILE "dse.ldif.bak"
#define DSE_STARTOKFILE "dse.ldif.startOK"
#define DSE_LDBM_FILENAME "ldbm.ldif"
#define DSE_LDBM_TMPFILE "ldbm.ldif.tmp"
/* for now, we are using the dse file for the base config file */
#define CONFIG_FILENAME DSE_FILENAME
/* the default configuration sub directory of the instance directory */
#define CONFIG_SUBDIR_NAME "config"
/* the default schema sub directory of the config sub directory */
#define SCHEMA_SUBDIR_NAME "schema"
/* LDAPI default configuration */
#define SLAPD_LDAPI_DEFAULT_FILENAME "/var/run/ldapi"
#define SLAPD_LDAPI_DEFAULT_STATUS "off"
/* Anonymous access */
#define SLAPD_ANON_ACCESS_OFF 0
#define SLAPD_ANON_ACCESS_ON 1
#define SLAPD_ANON_ACCESS_ROOTDSE 2
/* Server certificate validation */
#define SLAPD_VALIDATE_CERT_OFF 0
#define SLAPD_VALIDATE_CERT_ON 1
#define SLAPD_VALIDATE_CERT_WARN 2
typedef int32_t slapi_onoff_t;
typedef int32_t slapi_int_t;
typedef enum _tls_check_crl_t {
TLS_CHECK_NONE = 0,
TLS_CHECK_PEER = 1,
TLS_CHECK_ALL = 2,
} tls_check_crl_t;
struct subfilt
{
char *sf_type;
char *sf_initial;
char **sf_any;
char *sf_final;
void *sf_private; /* data private to syntax handler */
};
#include "filter.h" /* mr_filter_t */
/*
* represents a search filter
*/
struct slapi_filter
{
int f_flags;
unsigned long f_choice; /* values taken from ldap.h */
PRUint32 f_hash; /* for quick comparisons */
void *assigned_decoder;
union
{
/* present */
char *f_un_type;
/* equality, lessorequal, greaterorequal, approx */
struct ava f_un_ava;
/* and, or, not */
struct slapi_filter *f_un_complex;
/* substrings */
struct subfilt f_un_sub;
/* extended -- v3 only */
mr_filter_t f_un_extended;
} f_un;
#define f_type f_un.f_un_type
#define f_ava f_un.f_un_ava
#define f_avtype f_un.f_un_ava.ava_type
#define f_avvalue f_un.f_un_ava.ava_value
#define f_and f_un.f_un_complex
#define f_or f_un.f_un_complex
#define f_not f_un.f_un_complex
#define f_list f_un.f_un_complex
#define f_sub f_un.f_un_sub
#define f_sub_type f_un.f_un_sub.sf_type
#define f_sub_initial f_un.f_un_sub.sf_initial
#define f_sub_any f_un.f_un_sub.sf_any
#define f_sub_final f_un.f_un_sub.sf_final
#define f_mr f_un.f_un_extended
#define f_mr_oid f_un.f_un_extended.mrf_oid
#define f_mr_type f_un.f_un_extended.mrf_type
#define f_mr_value f_un.f_un_extended.mrf_value
#define f_mr_dnAttrs f_un.f_un_extended.mrf_dnAttrs
struct slapi_filter *f_next;
};
struct csn
{
time_t tstamp;
PRUint16 seqnum;
ReplicaId rid;
PRUint16 subseqnum;
};
struct csnset_node
{
CSNType type;
CSN csn;
CSNSet *next;
};
struct slapi_value
{
struct berval bv;
CSNSet *v_csnset;
unsigned long v_flags;
};
/*
* JCM: This structure, slapi_value_set, seems useless,
* but in the future we could:
*
* {
* unsigned char flag;
* union single
* {
* struct slapi_value *va;
* };
* union multiple_array
* {
* short num;
* short max;
* struct slapi_value **va;
* };
* union multiple_tree
* {
* struct slapi_value_tree *vt;
* };
*/
/* It is a useless layer, always use the valuarray fast version */
#define VALUE_SORT_THRESHOLD 10
struct slapi_value_set
{
size_t num; /* The number of values in the array */
size_t max; /* The number of slots in the array */
size_t *sorted; /* sorted array of indices, if NULL va is not sorted */
struct slapi_value **va;
};
struct valuearrayfast
{
int num; /* The number of values in the array */
int max; /* The number of slots in the array */
struct slapi_value **va;
};
struct bervals2free
{
struct berval **bvals;
struct bervals2free *next;
};
/*
* represents an attribute instance (type + values + syntax)
*/
struct slapi_attr
{
char *a_type;
struct slapi_value_set a_present_values;
unsigned long a_flags; /* SLAPI_ATTR_FLAG_... */
struct slapdplugin *a_plugin; /* for the attribute syntax */
struct slapi_value_set a_deleted_values;
struct bervals2free *a_listtofree; /* JCM: EVIL... For DS4 Slapi compatibility. */
struct slapi_attr *a_next;
CSN *a_deletioncsn; /* The point in time at which this attribute was last deleted */
struct slapdplugin *a_mr_eq_plugin; /* for the attribute EQUALITY matching rule, if any */
struct slapdplugin *a_mr_ord_plugin; /* for the attribute ORDERING matching rule, if any */
struct slapdplugin *a_mr_sub_plugin; /* for the attribute SUBSTRING matching rule, if any */
};
typedef struct oid_item
{
char *oi_oid;
struct slapdplugin *oi_plugin;
struct oid_item *oi_next;
} oid_item_t;
/* schema extension item: X-ORIGIN, X-CSN, etc */
typedef struct schemaext
{
char *term;
char **values;
int value_count;
struct schemaext *next;
} schemaext;
/* attribute description (represents an attribute, but not the value) */
typedef struct asyntaxinfo
{
char *asi_oid; /* OID */
char *asi_name; /* normalized name */
char **asi_aliases; /* alternative names */
char *asi_desc; /* textual description */
char *asi_superior; /* derived from */
char *asi_mr_equality; /* equality matching rule */
char *asi_mr_ordering; /* ordering matching rule */
char *asi_mr_substring; /* substring matching rule */
schemaext *asi_extensions; /* schema extensions (X-ORIGIN, X-?????, ...) */
struct slapdplugin *asi_plugin; /* syntax */
char *asi_syntax_oid; /* syntax oid */
unsigned long asi_flags; /* SLAPI_ATTR_FLAG_... */
int asi_syntaxlength; /* length associated w/syntax */
uint64_t asi_refcnt; /* outstanding references */
PRBool asi_marked_for_delete; /* delete at next opportunity */
struct slapdplugin *asi_mr_eq_plugin; /* EQUALITY matching rule plugin */
struct slapdplugin *asi_mr_sub_plugin; /* SUBSTR matching rule plugin */
struct slapdplugin *asi_mr_ord_plugin; /* ORDERING matching rule plugin */
struct asyntaxinfo *asi_next;
struct asyntaxinfo *asi_prev;
} asyntaxinfo;
/*
* Note: most of the asi_flags values are defined in slapi-plugin.h, but
* these ones are private to the DS.
*/
#define SLAPI_ATTR_FLAG_OVERRIDE 0x0010 /* when adding a new attribute, \
override the existing attribute, \
if any */
#define SLAPI_ATTR_FLAG_NOLOCKING 0x0020 /* the init code doesn't lock the \
tables */
#define SLAPI_ATTR_FLAG_KEEP 0x8000 /* keep when replacing all */
#define SLAPI_ATTR_FLAG_SYNTAX_LOOKUP_DONE 0x010000 /* syntax lookup done, flag set */
#define SLAPI_ATTR_FLAG_SYNTAX_IS_DN 0x020000 /* syntax lookup done, flag set */
/* This is the type of the function passed into attr_syntax_enumerate_attrs */
typedef int (*AttrEnumFunc)(struct asyntaxinfo *asi, void *arg);
/* Possible return values for an AttrEnumFunc */
#define ATTR_SYNTAX_ENUM_NEXT 0 /* continue */
#define ATTR_SYNTAX_ENUM_STOP 1 /* halt the enumeration */
#define ATTR_SYNTAX_ENUM_REMOVE 2 /* unhash current node and continue */
/* flags for slapi_attr_syntax_normalize_ext */
#define ATTR_SYNTAX_NORM_ORIG_ATTR 0x1 /* a space and following characters are \
removed from the given string */
/* This is the type of the function passed into plugin_syntax_enumerate */
typedef int (*SyntaxEnumFunc)(char **names, Slapi_PluginDesc *plugindesc, void *arg);
/* OIDs for some commonly used syntaxes */
#define BINARY_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.5"
#define BITSTRING_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.6"
#define BOOLEAN_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.7"
#define COUNTRYSTRING_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.11"
#define DN_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.12"
#define DELIVERYMETHOD_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.14"
#define DIRSTRING_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.15"
#define ENHANCEDGUIDE_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.21"
#define FACSIMILE_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.22"
#define FAX_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.23"
#define GENERALIZEDTIME_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.24"
#define GUIDE_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.25"
#define IA5STRING_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.26"
#define INTEGER_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.27"
#define JPEG_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.28"
#define NAMEANDOPTIONALUID_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.34"
#define NUMERICSTRING_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.36"
#define OID_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.38"
#define OCTETSTRING_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.40"
#define POSTALADDRESS_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.41"
#define PRINTABLESTRING_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.44"
#define TELEPHONE_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.50"
#define TELETEXTERMID_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.51"
#define TELEXNUMBER_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.52"
#define SPACE_INSENSITIVE_STRING_SYNTAX_OID "2.16.840.1.113730.3.7.1"
/* OIDs for some commonly used matching rules */
#define DNMATCH_OID "2.5.13.1" /* distinguishedNameMatch */
#define CASEIGNOREMATCH_OID "2.5.13.2" /* caseIgnoreMatch */
#define INTEGERMATCH_OID "2.5.13.14" /* integerMatch */
#define INTEGERORDERINGMATCH_OID "2.5.13.15" /* integerOrderingMatch */
#define INTFIRSTCOMPMATCH_OID "2.5.13.29" /* integerFirstComponentMatch */
#define OIDFIRSTCOMPMATCH_OID "2.5.13.30" /* objectIdentifierFirstComponentMatch */
/* Names for some commonly used matching rules */
#define DNMATCH_NAME "distinguishedNameMatch"
#define CASEIGNOREMATCH_NAME "caseIgnoreMatch"
#define INTEGERMATCH_NAME "integerMatch"
#define INTEGERORDERINGMATCH_NAME "integerOrderingMatch"
#define INTFIRSTCOMPMATCH_NAME "integerFirstComponentMatch"
#define OIDFIRSTCOMPMATCH_NAME "objectIdentifierFirstComponentMatch"
#define ATTR_STANDARD_STRING "Standard Attribute"
#define ATTR_USERDEF_STRING "User Defined Attribute"
#define OC_STANDARD_STRING "Standard ObjectClass"
#define OC_USERDEF_STRING "User Defined ObjectClass"
/* modifiers used to define attributes */
#define ATTR_MOD_OPERATIONAL "operational"
#define ATTR_MOD_OVERRIDE "override"
#define ATTR_MOD_SINGLE "single"
/* extended operations supported by the server */
#define EXTOP_BULK_IMPORT_START_OID "2.16.840.1.113730.3.5.7"
#define EXTOP_BULK_IMPORT_DONE_OID "2.16.840.1.113730.3.5.8"
#define EXTOP_PASSWD_OID "1.3.6.1.4.1.4203.1.11.1"
/*
* Represents a Distinguished Name of an entry
* WARNING, if you change this stucture you MUST update dn_size()
* function in entry.c
*/
struct slapi_dn
{
unsigned char flag;
const char *udn; /* DN [original] */
const char *dn; /* Normalised DN */
const char *ndn; /* Case Normalised DN */
int ndn_len; /* normalized dn length */
};
/*
* Represents a Relative Distinguished Name.
*/
#define FLAG_RDNS 0
#define FLAG_ALL_RDNS 1
#define FLAG_ALL_NRDNS 2
struct slapi_rdn
{
unsigned char flag;
char *rdn;
char **rdns; /* Valid when FLAG_RDNS is set. */
int butcheredupto; /* How far through rdns we've gone converting '=' to '\0' */
char *nrdn; /* normalized rdn */
char **all_rdns; /* Valid when FLAG_ALL_RDNS is set. */
char **all_nrdns; /* Valid when FLAG_ALL_NRDNS is set. */
};
/*
* representation of uniqueID. Defined in uuid.h
*/
#define UID_SIZE 16 /* size of unique id in bytes */
/*
* max 1G attr values per entry
* in case, libdb returned bogus entry string from db (blackflag #623569)
*/
#define ENTRY_MAX_ATTRIBUTE_VALUE_COUNT 1073741824
typedef struct _entry_vattr Slapi_Vattr;
/*
* represents an entry in core
* WARNING, if you change this stucture you MUST update slapi_entry_size()
* function
*/
struct slapi_entry
{
struct slapi_dn e_sdn; /* DN of this entry */
struct slapi_rdn e_srdn; /* RDN of this entry */
char *e_uniqueid; /* uniqueID of this entry */
CSNSet *e_dncsnset; /* The set of DN CSNs for this entry */
CSN *e_maxcsn; /* maximum CSN of the entry */
Slapi_Attr *e_attrs; /* list of attributes and values */
Slapi_Attr *e_deleted_attrs; /* deleted list of attributes and values */
Slapi_Vattr *e_virtual_attrs; /* cache of virtual attributes */
uint32_t e_virtual_watermark; /* indicates cache consistency when compared
to global watermark */
Slapi_RWLock *e_virtual_lock; /* for access to cached vattrs */
void *e_extension; /* A list of entry object extensions */
unsigned char e_flags;
Slapi_Attr *e_aux_attrs; /* Attr list used for upgrade */
};
struct attrs_in_extension
{
char *ext_type;
IFP ext_get;
IFP ext_set;
IFP ext_copy;
IFP ext_get_size;
};
extern struct attrs_in_extension attrs_in_extension[];
/*
* represents schema information for a database
*/
/* values for oc_flags (only space for 8 of these right now!) */
#define OC_FLAG_STANDARD_OC 1
#define OC_FLAG_USER_OC 2
#define OC_FLAG_REDEFINED_OC 4
#define OC_FLAG_OBSOLETE 8
/* values for oc_kind */
#define OC_KIND_ABSTRACT 0
#define OC_KIND_STRUCTURAL 1
#define OC_KIND_AUXILIARY 2
/* XXXmcs: ../plugins/cos/cos_cache.c has its own copy of this definition! */
struct objclass
{
char *oc_name; /* NAME */
char *oc_desc; /* DESC */
char *oc_oid; /* object identifier */
char *oc_superior; /* SUP -- XXXmcs: should be an array */
PRUint8 oc_kind; /* ABSTRACT/STRUCTURAL/AUXILIARY */
PRUint8 oc_flags; /* misc. flags, e.g., OBSOLETE */
char **oc_required;
char **oc_allowed;
char **oc_orig_required; /* MUST */
char **oc_orig_allowed; /* MAY */
schemaext *oc_extensions; /* schema extensions (X-ORIGIN, X-?????, ...) */
struct objclass *oc_next;
};
struct matchingRuleList
{
Slapi_MatchingRuleEntry *mr_entry;
struct matchingRuleList *mrl_next;
};
/* List of the plugin index numbers */
/* Backend & Global Plugins */
#define PLUGIN_LIST_DATABASE 0
#define PLUGIN_LIST_PREOPERATION 1
#define PLUGIN_LIST_POSTOPERATION 2
#define PLUGIN_LIST_BEPREOPERATION 3
#define PLUGIN_LIST_BEPOSTOPERATION 4
#define PLUGIN_LIST_INTERNAL_PREOPERATION 5
#define PLUGIN_LIST_INTERNAL_POSTOPERATION 6
#define PLUGIN_LIST_EXTENDED_OPERATION 7
#define PLUGIN_LIST_BE_TXN_EXTENDED_OPERATION 8
#define PLUGIN_LIST_PREEXTENDED_OPERATION 9
#define PLUGIN_LIST_POSTEXTENDED_OPERATION 10
#define PLUGIN_LIST_BACKEND_MAX 11
/* Global Plugins */
#define PLUGIN_LIST_ACL 10
#define PLUGIN_LIST_MATCHINGRULE 11
#define PLUGIN_LIST_SYNTAX 12
#define PLUGIN_LIST_ENTRY 13
#define PLUGIN_LIST_OBJECT 14
#define PLUGIN_LIST_PWD_STORAGE_SCHEME 15
#define PLUGIN_LIST_VATTR_SP 16 /* DBDB */
#define PLUGIN_LIST_REVER_PWD_STORAGE_SCHEME 17
#define PLUGIN_LIST_LDBM_ENTRY_FETCH_STORE 18
#define PLUGIN_LIST_INDEX 19
#define PLUGIN_LIST_BETXNPREOPERATION 20
#define PLUGIN_LIST_BETXNPOSTOPERATION 21
#define PLUGIN_LIST_MMR 22
#define PLUGIN_LIST_GLOBAL_MAX 23
/* plugin configuration attributes */
#define ATTR_PLUGIN_PATH "nsslapd-pluginPath"
#define ATTR_PLUGIN_INITFN "nsslapd-pluginInitFunc"
#define ATTR_PLUGIN_TYPE "nsslapd-pluginType"
#define ATTR_PLUGIN_PLUGINID "nsslapd-pluginId"
#define ATTR_PLUGIN_VERSION "nsslapd-pluginVersion"
#define ATTR_PLUGIN_VENDOR "nsslapd-pluginVendor"
#define ATTR_PLUGIN_DESC "nsslapd-pluginDescription"
#define ATTR_PLUGIN_ENABLED "nsslapd-pluginEnabled"
#define ATTR_PLUGIN_ARG "nsslapd-pluginArg"
#define ATTR_PLUGIN_CONFIG_AREA "nsslapd-pluginConfigArea"
#define ATTR_PLUGIN_BACKEND "nsslapd-backend"
#define ATTR_PLUGIN_SCHEMA_CHECK "nsslapd-schemaCheck"
#define ATTR_PLUGIN_LOG_ACCESS "nsslapd-logAccess"
#define ATTR_PLUGIN_LOG_AUDIT "nsslapd-logAudit"
#define ATTR_PLUGIN_TARGET_SUBTREE "nsslapd-targetSubtree"
#define ATTR_PLUGIN_EXCLUDE_TARGET_SUBTREE "nsslapd-exclude-targetSubtree"
#define ATTR_PLUGIN_BIND_SUBTREE "nsslapd-bindSubtree"
#define ATTR_PLUGIN_EXCLUDE_BIND_SUBTREE "nsslapd-exclude-bindSubtree"
#define ATTR_PLUGIN_INVOKE_FOR_REPLOP "nsslapd-invokeForReplOp"
#define ATTR_PLUGIN_LOAD_NOW "nsslapd-pluginLoadNow"
#define ATTR_PLUGIN_LOAD_GLOBAL "nsslapd-pluginLoadGlobal"
#define ATTR_PLUGIN_PRECEDENCE "nsslapd-pluginPrecedence"
#define ATTR_PLUGIN_DEPENDS_ON_TYPE "nsslapd-plugin-depends-on-type"
#define ATTR_PLUGIN_DEPENDS_ON_NAMED "nsslapd-plugin-depends-on-named"
#define ATTR_PLUGIN_BE_TXN "nsslapd-pluginbetxn"
/* plugin precedence defines */
#define PLUGIN_DEFAULT_PRECEDENCE 50
#define PLUGIN_MIN_PRECEDENCE 1
#define PLUGIN_MAX_PRECEDENCE 99
/* plugin action states */
enum
{
PLGC_OFF, /* internal operation action is on */
PLGC_ON, /* internal operation action is off */
PLGC_UPTOPLUGIN /* internal operation action is left up to plugin */
};
/* special data specifications */
enum
{
PLGC_DATA_LOCAL, /* plugin has access to all data hosted by this server */
PLGC_DATA_REMOTE, /* plugin has access to all requests for data not hosted by this server */
PLGC_DATA_BIND_ANONYMOUS, /* plugin bind function should be invoked for anonymous binds */
PLGC_DATA_BIND_ROOT, /* plugin bind function should be invoked for directory manager binds */
PLGC_DATA_MAX
};
/* DataList definition */
struct datalist
{
void **elements; /* array of elements */
int element_count; /* number of elements in the array */
int alloc_count; /* number of allocated nodes in the array */
} datalist;
/* data available to plugins */
typedef struct target_data
{
DataList subtrees; /* regular DIT subtrees acessible to the plugin */
PRBool special_data[PLGC_DATA_MAX]; /* array of special data specification */
} PluginTargetData;
struct pluginconfig
{
PluginTargetData plgc_target_subtrees; /* list of subtrees accessible by the plugin */
PluginTargetData plgc_excluded_target_subtrees; /* list of subtrees inaccessible by the plugin */
PluginTargetData plgc_bind_subtrees; /* the list of subtrees for which plugin is invoked during bind operation */
PluginTargetData plgc_excluded_bind_subtrees; /* the list of subtrees for which plugin is not invoked during bind operation */
PRBool plgc_schema_check; /* inidcates whether schema check is performed during internal op */
PRBool plgc_log_change; /* indicates whether changes are logged during internal op */
PRBool plgc_log_access; /* indicates whether internal op is recorded in access log */
PRBool plgc_log_audit; /* indicates whether internal op is recorded in audit log */
PRBool plgc_invoke_for_replop; /* indicates that plugin should be invoked for internal operations */
};
struct slapdplugin
{
void *plg_private; /* data private to plugin */
char *plg_version; /* version of this plugin */
int plg_argc; /* argc from config file */
char **plg_argv; /* args from config file */
char *plg_libpath; /* library path for dll/so */
char *plg_initfunc; /* init symbol */
IFP plg_close; /* close function */
Slapi_PluginDesc plg_desc; /* vendor's info */
char *plg_name; /* used for plugin rdn in cn=config */
struct slapdplugin *plg_next; /* for plugin lists */
int plg_type; /* discriminates union */
char *plg_dn; /* config dn for this plugin */
char *plg_id; /* plugin id, used when adding/removing plugins */
struct slapi_componentid *plg_identity; /* Slapi component id */
int plg_precedence; /* for plugin execution ordering */
struct slapdplugin *plg_group; /* pointer to the group to which this plugin belongs */
struct pluginconfig plg_conf; /* plugin configuration parameters */
IFP plg_cleanup; /* cleanup function */
IFP plg_start; /* start function */
IFP plg_poststart; /* poststart function */
int plg_closed; /* mark plugin as closed */
int plg_removed; /* mark plugin as removed/deleted */
PRUint64 plg_started; /* plugin is started/running */
PRUint64 plg_stopped; /* plugin has been fully shutdown */
Slapi_Counter *plg_op_counter; /* operation counter, used for shutdown */
/* NOTE: These LDIF2DB and DB2LDIF fn pointers are internal only for now.
I don't believe you can get these functions from a plug-in and
then call them without knowing what IFP or VFP0 are. (These aren't
declared in slapi-plugin.h.) More importantly, it's a pretty ugly
way to get to these functions. (Do we want people to get locked into
this?)
The correct way to do this would be to expose these functions as
front-end API functions. We can fix this for the next release.
(No one has the time right now.)
*/
union
{ /* backend database plugin structure */
struct plg_un_database_backend
{
IFP plg_un_db_bind; /* bind */
IFP plg_un_db_unbind; /* unbind */
IFP plg_un_db_search; /* search */
IFP plg_un_db_next_search_entry; /* iterate */
IFP plg_un_db_next_search_entry_ext;
VFPP plg_un_db_search_results_release; /* PAGED RESULTS */
VFP plg_un_db_prev_search_results; /* PAGED RESULTS */