~ubuntu-branches/ubuntu/utopic/389-ds-base/utopic-proposed

« back to all changes in this revision

Viewing changes to ldap/servers/slapd/slap.h

  • Committer: Package Import Robot
  • Author(s): Timo Aaltonen
  • Date: 2014-02-03 11:08:50 UTC
  • mfrom: (0.2.1)
  • Revision ID: package-import@ubuntu.com-20140203110850-tjzx85elnke9fiu3
Tags: 1.3.2.9-1
* New upstream release.
  - fixes CVE-2013-0336 (Closes: #704077)
  - fixes CVE-2013-1897 (Closes: #704421)
  - fixes CVE-2013-2219 (Closes: #718325)
  - fixes CVE-2013-4283 (Closes: #721222)
  - fixes CVE-2013-4485 (Closes: #730115)
* Drop fix-CVE-2013-0312.diff, upstream.
* rules: Add new scripts to rename.
* fix-sasl-path.diff: Use a triplet path to find libsasl2. (LP:
  #1088822)
* admin_scripts.diff: Add patch from upstream #47511 to fix bashisms.
* control: Add ldap-utils to -base depends.
* rules, rename-online-scripts.diff: Some scripts with .pl suffix are
  meant for an online server, so instead of overwriting the offline
  scripts use -online suffix.
* rules: Enable parallel build, but limit the jobs to 1 for
  dh_auto_install.
* control: Bump policy to 3.9.5, no changes.
* rules: Add get-orig-source target.
* lintian-overrides: Drop obsolete entries, add comments for the rest.

Show diffs side-by-side

added added

removed removed

Lines of Context:
306
306
 
307
307
#define ATTR_NETSCAPEMDSUFFIX "netscapemdsuffix"
308
308
 
309
 
/* Used to make unhashed passwords available to plugins. */
310
 
#define PSEUDO_ATTR_UNHASHEDUSERPASSWORD        "unhashed#user#password"
311
 
 
312
309
#define REFERRAL_REMOVE_CMD "remove"
313
310
 
314
311
/* Filenames for DSE storage */
339
336
#define SLAPD_VALIDATE_CERT_ON          1
340
337
#define SLAPD_VALIDATE_CERT_WARN        2
341
338
 
 
339
/* if the use of atomic get/set for config parameters is enabled, enable the use for the specific parameters defined below */
 
340
#define USE_ATOMIC_GETSET 1
 
341
#ifdef USE_ATOMIC_GETSET
 
342
#define ATOMIC_GETSET_MAXTHREADSPERCONN 1
 
343
#define ATOMIC_GETSET_IOBLOCKTIMEOUT 1
 
344
#define ATOMIC_GETSET_FILTER_NEST_LEVEL 1
 
345
#define ATOMIC_GETSET_ONOFF 1
 
346
typedef PRInt32 slapi_onoff_t;
 
347
typedef PRInt32 slapi_int_t;
 
348
#else
 
349
typedef int slapi_onoff_t;
 
350
typedef int slapi_int_t;
 
351
#endif
 
352
 
342
353
struct subfilt {
343
354
        char    *sf_type;
344
355
        char    *sf_initial;
439
450
 *              struct slapi_value_tree *vt;
440
451
 *      };
441
452
 */
 
453
 
 
454
/* It is a useless layer, always use the valuarray fast version */
 
455
#define VALUE_SORT_THRESHOLD 10
442
456
struct slapi_value_set
443
457
{
 
458
        int num; /* The number of values in the array */
 
459
        int max; /* The number of slots in the array */
 
460
        int *sorted; /* sorted array of indices, if NULL va is not sorted */
444
461
        struct slapi_value **va;
445
462
};
446
463
 
480
497
    struct oid_item     *oi_next;
481
498
} oid_item_t;
482
499
 
 
500
/* schema extension item: X-ORIGIN, X-CSN, etc */
 
501
typedef struct schemaext {
 
502
    char *term;
 
503
    char **values;
 
504
    int value_count;
 
505
    struct schemaext *next;
 
506
} schemaext;
 
507
 
483
508
/* attribute description (represents an attribute, but not the value) */
484
509
typedef struct asyntaxinfo {
485
510
    char                        *asi_oid;                       /* OID */
490
515
        char                            *asi_mr_equality;       /* equality matching rule */
491
516
        char                            *asi_mr_ordering;       /* ordering matching rule */
492
517
        char                            *asi_mr_substring;      /* substring matching rule */
493
 
        char                            **asi_origin;           /* X-ORIGIN extension */
 
518
        schemaext                       *asi_extensions;        /* schema extensions (X-ORIGIN, X-?????, ...) */
494
519
        struct slapdplugin      *asi_plugin;            /* syntax */
495
520
        unsigned long           asi_flags;                      /* SLAPI_ATTR_FLAG_... */
496
521
        int                                     asi_syntaxlength;       /* length associated w/syntax */
510
535
                                                                                           if any */
511
536
#define SLAPI_ATTR_FLAG_NOLOCKING       0x0020  /* the init code doesn't lock the
512
537
                                                                                           tables */
513
 
#define SLAPI_ATTR_FLAG_CMP_BITBYBIT    0x4000  /* do memcmp, not syntax cmp */
514
538
#define SLAPI_ATTR_FLAG_KEEP            0x8000 /* keep when replacing all */
 
539
#define SLAPI_ATTR_FLAG_SYNTAX_LOOKUP_DONE              0x010000 /* syntax lookup done, flag set */
 
540
#define SLAPI_ATTR_FLAG_SYNTAX_IS_DN            0x020000 /* syntax lookup done, flag set */
515
541
 
516
542
/* This is the type of the function passed into attr_syntax_enumerate_attrs */
517
543
typedef int (*AttrEnumFunc)(struct asyntaxinfo *asi, void *arg);
520
546
#define ATTR_SYNTAX_ENUM_STOP   1       /* halt the enumeration */
521
547
#define ATTR_SYNTAX_ENUM_REMOVE 2       /* unhash current node and continue */
522
548
 
 
549
/* flags for slapi_attr_syntax_normalize_ext */
 
550
#define ATTR_SYNTAX_NORM_ORIG_ATTR 0x1 /* a space and following characters are
 
551
                                          removed from the given string */
 
552
 
523
553
/* This is the type of the function passed into plugin_syntax_enumerate */
524
554
typedef int (*SyntaxEnumFunc)(char **names, Slapi_PluginDesc *plugindesc,
525
555
                                                        void *arg);
621
651
 */
622
652
#define ENTRY_MAX_ATTRIBUTE_VALUE_COUNT 1073741824 
623
653
 
 
654
typedef struct _entry_vattr Slapi_Vattr;
624
655
/*
625
656
 * represents an entry in core
626
657
 * WARNING, if you change this stucture you MUST update slapi_entry_size()
634
665
    CSN *e_maxcsn;               /* maximum CSN of the entry */
635
666
    Slapi_Attr *e_attrs;         /* list of attributes and values   */
636
667
    Slapi_Attr *e_deleted_attrs; /* deleted list of attributes and values */
637
 
    Slapi_Attr *e_virtual_attrs; /* list of virtual attributes */
 
668
    Slapi_Vattr *e_virtual_attrs;       /* cache of virtual attributes */
638
669
    time_t e_virtual_watermark;  /* indicates cache consistency when compared
639
670
                                    to global watermark */ 
640
671
    Slapi_RWLock *e_virtual_lock;    /* for access to cached vattrs */
662
693
#define OC_FLAG_OBSOLETE                8
663
694
 
664
695
/* values for oc_kind */
665
 
#define OC_KIND_STRUCTURAL              0
666
 
#define OC_KIND_AUXILIARY               1
667
 
#define OC_KIND_ABSTRACT                2
 
696
#define OC_KIND_ABSTRACT                0
 
697
#define OC_KIND_STRUCTURAL              1
 
698
#define OC_KIND_AUXILIARY               2
668
699
 
669
700
 
670
701
/* XXXmcs: ../plugins/cos/cos_cache.c has its own copy of this definition! */
671
702
struct objclass {
672
 
        char                            *oc_name;               /* NAME */
673
 
        char                            *oc_desc;               /* DESC */
674
 
    char                        *oc_oid;                /* object identifier */
675
 
    char                        *oc_superior;   /* SUP -- XXXmcs: should be an array */
676
 
        PRUint8                         oc_kind;                /* ABSTRACT/STRUCTURAL/AUXILIARY */
677
 
    PRUint8                             oc_flags;               /* misc. flags, e.g., OBSOLETE */
678
 
        char                            **oc_required;
679
 
        char                            **oc_allowed;
680
 
    char                        **oc_orig_required;     /* MUST */
681
 
    char                        **oc_orig_allowed;      /* MAY */
682
 
        char                            **oc_origin;    /* X-ORIGIN extension */
683
 
        struct objclass         *oc_next;
 
703
    char                *oc_name;       /* NAME */
 
704
    char                *oc_desc;       /* DESC */
 
705
    char                *oc_oid;        /* object identifier */
 
706
    char                *oc_superior;   /* SUP -- XXXmcs: should be an array */
 
707
    PRUint8             oc_kind;        /* ABSTRACT/STRUCTURAL/AUXILIARY */
 
708
    PRUint8             oc_flags;       /* misc. flags, e.g., OBSOLETE */
 
709
    char                **oc_required;
 
710
    char                **oc_allowed;
 
711
    char                **oc_orig_required; /* MUST */
 
712
    char                **oc_orig_allowed;  /* MAY */
 
713
    schemaext           *oc_extensions; /* schema extensions (X-ORIGIN, X-?????, ...) */
 
714
    struct objclass     *oc_next;
684
715
};
685
716
 
686
717
struct matchingRuleList {
1353
1384
        unsigned long o_abandoned_op; /* operation abandoned by this operation - used to decide which plugins to invoke */
1354
1385
        struct slapi_operation_parameters o_params;
1355
1386
        struct slapi_operation_results o_results;
 
1387
        int o_pagedresults_sizelimit;
1356
1388
} Operation;
1357
1389
 
1358
1390
/*
1381
1413
    time_t        pr_timelimit;           /* time limit for this request */
1382
1414
    int           pr_flags;
1383
1415
    ber_int_t     pr_msgid;               /* msgid of the request; to abandon */
 
1416
    PRLock        *pr_mutex;              /* protect each conn structure    */
1384
1417
} PagedResults;
1385
1418
 
1386
1419
/* array of simple paged structure stashed in connection */
1409
1442
        char            *c_authtype;    /* auth method used to bind c_dn  */
1410
1443
        char            *c_external_dn; /* client DN of this SSL session  */
1411
1444
        char            *c_external_authtype; /* used for c_external_dn   */
1412
 
        PRNetAddr       *cin_addr;      /* address of client on this conn */
 
1445
        PRNetAddr       *cin_addr;      /* address of client on this conn */
1413
1446
        PRNetAddr       *cin_destaddr;  /* address client connected to    */
1414
1447
        struct berval   **c_domain;     /* DNS names of client            */
1415
1448
        Operation               *c_ops;         /* list of pending operations     */
1416
1449
        int                             c_gettingber;   /* in the middle of ber_get_next  */
1417
1450
        BerElement              *c_currentber;  /* ber we're getting              */
1418
1451
        time_t                  c_starttime;    /* when the connection was opened */
1419
 
        PRUint64        c_connid;       /* id of this connection for stats*/
 
1452
        PRUint64                c_connid;       /* id of this connection for stats*/
 
1453
        PRUint64                c_maxthreadscount; /* # of times a conn hit max threads */
 
1454
        PRUint64                c_maxthreadsblocked; /* # of operations blocked by maxthreads */
1420
1455
        int                             c_opsinitiated; /* # ops initiated/next op id     */
1421
1456
        PRInt32                 c_opscompleted; /* # ops completed                */
1422
1457
        PRInt32                 c_threadnumber; /* # threads used in this conn    */
1424
1459
        PRLock                  *c_mutex;       /* protect each conn structure    */
1425
1460
        PRLock                  *c_pdumutex;    /* only write one pdu at a time   */
1426
1461
        time_t                  c_idlesince;    /* last time of activity on conn  */
 
1462
        int                     c_idletimeout;  /* local copy of idletimeout */
 
1463
        int                     c_idletimeout_handle;   /* the resource limits handle */
1427
1464
        Conn_private    *c_private;     /* data which is not shared outside*/
1428
1465
                                                                /* connection.c                   */
1429
1466
        int                             c_flags;        /* Misc flags used only for SSL   */
1485
1522
                                              * processing a pagedresults search
1486
1523
                                              */
1487
1524
#define CONN_FLAG_PAGEDRESULTS_ABANDONED  512/* pagedresults abandoned */
 
1525
 
 
1526
#define CONN_FLAG_MAX_THREADS 1024 /* Flag set when connection is at the maximum number of threads */
 
1527
 
1488
1528
#define CONN_GET_SORT_RESULT_CODE (-1)
1489
1529
 
1490
1530
#define START_TLS_OID    "1.3.6.1.4.1.1466.20037"
1519
1559
} slapi_task;
1520
1560
/* End of interface to support online tasks **********************************/
1521
1561
 
 
1562
/*
 
1563
 * structure for holding password scheme info.
 
1564
 */
 
1565
struct pw_scheme {
 
1566
    /* case-insensitive name used in prefix of passwords that use scheme */
 
1567
   char    *pws_name;
 
1568
 
 
1569
   /* length of pws_name */
 
1570
   int     pws_len;
 
1571
 
 
1572
   /* thread-safe comparison function; returns 0 for positive matches */
 
1573
   /* userpwd is value sent over LDAP bind; dbpwd is from the database */
 
1574
   int     (*pws_cmp)( char *userpwd, char *dbpwd );
 
1575
 
 
1576
   /* thread-safe encoding function (returns pointer to malloc'd string) */
 
1577
   char    *(*pws_enc)( char *pwd );
 
1578
 
 
1579
   /* thread-safe decoding function (returns pointer to malloc'd string) */
 
1580
   char    *(*pws_dec)( char *pwd );
 
1581
};
 
1582
 
1522
1583
typedef struct passwordpolicyarray {
1523
 
  int pw_change;        /* 1 - indicates that users are allowed to change the pwd */
1524
 
  int pw_must_change;   /* 1 - indicates that users must change pwd upon reset */
1525
 
  int pw_syntax;
 
1584
  slapi_onoff_t pw_change;        /* 1 - indicates that users are allowed to change the pwd */
 
1585
  slapi_onoff_t pw_must_change;   /* 1 - indicates that users must change pwd upon reset */
 
1586
  slapi_onoff_t pw_syntax;
1526
1587
  int pw_minlength;
1527
1588
  int pw_mindigits;
1528
1589
  int pw_minalphas;
1533
1594
  int pw_maxrepeats;
1534
1595
  int pw_mincategories;
1535
1596
  int pw_mintokenlength;
1536
 
  int pw_exp;
 
1597
  slapi_onoff_t pw_exp;
1537
1598
  long pw_maxage;
1538
1599
  long pw_minage;
1539
1600
  long pw_warning;
1540
 
  int pw_history;
 
1601
  slapi_onoff_t pw_history;
1541
1602
  int pw_inhistory;
1542
 
  int pw_lockout;
 
1603
  slapi_onoff_t pw_lockout;
1543
1604
  int pw_maxfailure;
1544
 
  int pw_unlock;
 
1605
  slapi_onoff_t pw_unlock;
1545
1606
  long pw_lockduration;
1546
1607
  long pw_resetfailurecount;
1547
1608
  int pw_gracelimit;
1548
 
  int pw_is_legacy;
1549
 
  int pw_track_update_time;
 
1609
  slapi_onoff_t pw_is_legacy;
 
1610
  slapi_onoff_t pw_track_update_time;
1550
1611
  struct pw_scheme *pw_storagescheme;
 
1612
  Slapi_DN *pw_admin;
 
1613
  Slapi_DN **pw_admin_user;
1551
1614
} passwdPolicy;
1552
1615
 
1553
1616
typedef struct slapi_pblock {
1703
1766
        void            *pb_syntax_filter_data; /* extra data to pass to a syntax plugin function */
1704
1767
        int     pb_paged_results_index;    /* stash SLAPI_PAGED_RESULTS_INDEX */
1705
1768
        passwdPolicy *pwdpolicy;
 
1769
        void *op_stack_elem;
 
1770
 
 
1771
        /* For ACI Target Check */
 
1772
        int pb_aci_target_check; /* this flag prevents duplicate checking of ACI's target existence */
 
1773
 
1706
1774
} slapi_pblock;
1707
1775
 
1708
1776
/* index if substrlens */
1796
1864
    Slapi_Counter *dsBytesSent; /* Count of bytes sent to clients */
1797
1865
    Slapi_Counter *dsEntriesReturned;
1798
1866
    Slapi_Counter *dsReferralsReturned;
 
1867
    Slapi_Counter *dsMaxThreadsHit;
 
1868
    Slapi_Counter *dsConnectionsInMaxThreads;
1799
1869
};
1800
1870
 
1801
1871
struct snmp_entries_tbl_t{
1925
1995
#define CONFIG_ERRORLOG_LOGGING_ENABLED_ATTRIBUTE "nsslapd-errorlog-logging-enabled"
1926
1996
#define CONFIG_AUDITLOG_LOGGING_ENABLED_ATTRIBUTE "nsslapd-auditlog-logging-enabled"
1927
1997
#define CONFIG_AUDITLOG_LOGGING_HIDE_UNHASHED_PW "nsslapd-auditlog-logging-hide-unhashed-pw"
 
1998
#define CONFIG_UNHASHED_PW_SWITCH_ATTRIBUTE "nsslapd-unhashed-pw-switch"
1928
1999
#define CONFIG_ROOTDN_ATTRIBUTE "nsslapd-rootdn"
1929
2000
#define CONFIG_ROOTPW_ATTRIBUTE "nsslapd-rootpw"
1930
2001
#define CONFIG_ROOTPWSTORAGESCHEME_ATTRIBUTE "nsslapd-rootpwstoragescheme"
1949
2020
#define CONFIG_PORT_ATTRIBUTE "nsslapd-port"
1950
2021
#define CONFIG_WORKINGDIR_ATTRIBUTE "nsslapd-workingdir"
1951
2022
#define CONFIG_LISTENHOST_ATTRIBUTE "nsslapd-listenhost"
 
2023
#define CONFIG_SNMP_INDEX_ATTRIBUTE "nsslapd-snmp-index"
1952
2024
#define CONFIG_LDAPI_FILENAME_ATTRIBUTE "nsslapd-ldapifilepath"
1953
2025
#define CONFIG_LDAPI_SWITCH_ATTRIBUTE "nsslapd-ldapilisten"
1954
2026
#define CONFIG_LDAPI_BIND_SWITCH_ATTRIBUTE "nsslapd-ldapiautobind"
2008
2080
#define CONFIG_PW_GRACELIMIT_ATTRIBUTE "passwordGraceLimit"
2009
2081
#define CONFIG_PW_IS_LEGACY "passwordLegacyPolicy"
2010
2082
#define CONFIG_PW_TRACK_LAST_UPDATE_TIME "passwordTrackUpdateTime"
 
2083
#define CONFIG_PW_ADMIN_DN_ATTRIBUTE "passwordAdminDN"
2011
2084
#define CONFIG_ACCESSLOG_BUFFERING_ATTRIBUTE "nsslapd-accesslog-logbuffering"
2012
2085
#define CONFIG_CSNLOGGING_ATTRIBUTE "nsslapd-csnlogging"
2013
2086
#define CONFIG_RETURN_EXACT_CASE_ATTRIBUTE "nsslapd-return-exact-case"
2048
2121
#define CONFIG_DISK_MONITORING "nsslapd-disk-monitoring"
2049
2122
#define CONFIG_DISK_THRESHOLD "nsslapd-disk-monitoring-threshold"
2050
2123
#define CONFIG_DISK_GRACE_PERIOD "nsslapd-disk-monitoring-grace-period"
2051
 
#define CONFIG_DISK_PRESERVE_LOGGING "nsslapd-disk-monitoring-preserve-logging"
2052
2124
#define CONFIG_DISK_LOGGING_CRITICAL "nsslapd-disk-monitoring-logging-critical"
2053
2125
#define CONFIG_NDN_CACHE "nsslapd-ndn-cache-enabled"
2054
2126
#define CONFIG_NDN_CACHE_SIZE "nsslapd-ndn-cache-max-size"
2055
2127
#define CONFIG_ALLOWED_SASL_MECHS "nsslapd-allowed-sasl-mechanisms"
 
2128
#define CONFIG_IGNORE_VATTRS "nsslapd-ignore-virtual-attrs"
 
2129
#define CONFIG_SASL_MAPPING_FALLBACK "nsslapd-sasl-mapping-fallback"
 
2130
#define CONFIG_SASL_MAXBUFSIZE "nsslapd-sasl-max-buffer-size"
 
2131
#define CONFIG_SEARCH_RETURN_ORIGINAL_TYPE "nsslapd-search-return-original-type-switch"
 
2132
#define CONFIG_ENABLE_TURBO_MODE "nsslapd-enable-turbo-mode"
 
2133
#define CONFIG_CONNECTION_BUFFER "nsslapd-connection-buffer"
 
2134
#define CONFIG_CONNECTION_NOCANON "nsslapd-connection-nocanon"
 
2135
#define CONFIG_PLUGIN_LOGGING "nsslapd-plugin-logging"
 
2136
#define CONFIG_LISTEN_BACKLOG_SIZE      "nsslapd-listen-backlog-size"
 
2137
 
 
2138
/*
 
2139
 * Define the backlog number for use in listen() call.
 
2140
 * We use the same definition as in ldapserver/include/base/systems.h
 
2141
 */
 
2142
#ifndef DAEMON_LISTEN_SIZE
 
2143
#define DAEMON_LISTEN_SIZE 128
 
2144
#endif
 
2145
#define CONFIG_IGNORE_TIME_SKEW "nsslapd-ignore-time-skew"
2056
2146
 
2057
2147
#ifdef MEMPOOL_EXPERIMENTAL
2058
2148
#define CONFIG_MEMPOOL_SWITCH_ATTRIBUTE "nsslapd-mempool"
2075
2165
#define CFG_UNLOCK_WRITE(cfg) slapi_rwlock_unlock(cfg->cfg_rwlock)
2076
2166
#endif
2077
2167
 
 
2168
#ifdef ATOMIC_GETSET_ONOFF
 
2169
#define CFG_ONOFF_LOCK_READ(cfg)
 
2170
#define CFG_ONOFF_UNLOCK_READ(cfg)
 
2171
#define CFG_ONOFF_LOCK_WRITE(cfg)
 
2172
#define CFG_ONOFF_UNLOCK_WRITE(cfg)
 
2173
#else
 
2174
#define CFG_ONOFF_LOCK_READ(cfg) CFG_LOCK_READ(cfg)
 
2175
#define CFG_ONOFF_UNLOCK_READ(cfg) CFG_UNLOCK_READ(cfg)
 
2176
#define CFG_ONOFF_LOCK_WRITE(cfg) CFG_LOCK_WRITE(cfg)
 
2177
#define CFG_ONOFF_UNLOCK_WRITE(cfg) CFG_UNLOCK_WRITE(cfg)
 
2178
#endif
 
2179
 
2078
2180
#define REFER_MODE_OFF 0 
2079
2181
#define REFER_MODE_ON 1
2080
2182
 
2087
2189
  PRLock           *cfg_lock;
2088
2190
#endif
2089
2191
  struct pw_scheme *rootpwstoragescheme;
2090
 
  int accesscontrol;
 
2192
  slapi_onoff_t accesscontrol;
2091
2193
  int groupevalnestlevel;
2092
2194
  int idletimeout;
2093
 
  int ioblocktimeout;
2094
 
  int lastmod;
 
2195
  slapi_int_t ioblocktimeout;
 
2196
  slapi_onoff_t lastmod;
2095
2197
#if !defined(_WIN32) && !defined(AIX) 
2096
2198
  int maxdescriptors;
2097
2199
#endif /* !_WIN32 && !AIX */
2098
2200
  int conntablesize;
2099
 
  int maxthreadsperconn;
 
2201
  slapi_int_t maxthreadsperconn;
2100
2202
  int outbound_ldap_io_timeout;
2101
 
  int nagle;
 
2203
  slapi_onoff_t nagle;
2102
2204
  int port;
2103
 
  int readonly;
 
2205
  slapi_onoff_t readonly;
2104
2206
  int reservedescriptors;
2105
 
  int schemacheck;
2106
 
  int schemamod;
2107
 
  int syntaxcheck;
2108
 
  int syntaxlogging;
2109
 
  int dn_validate_strict;
2110
 
  int ds4_compatible_schema;
2111
 
  int schema_ignore_trailing_spaces;
 
2207
  slapi_onoff_t schemacheck;
 
2208
  slapi_onoff_t schemamod;
 
2209
  slapi_onoff_t syntaxcheck;
 
2210
  slapi_onoff_t syntaxlogging;
 
2211
  slapi_onoff_t dn_validate_strict;
 
2212
  slapi_onoff_t ds4_compatible_schema;
 
2213
  slapi_onoff_t schema_ignore_trailing_spaces;
2112
2214
  int secureport;
2113
 
  int security;
 
2215
  slapi_onoff_t security;
2114
2216
  int SSLclientAuth;
2115
 
  int ssl_check_hostname;
 
2217
  slapi_onoff_t ssl_check_hostname;
2116
2218
  int validate_cert;
2117
2219
  int sizelimit;
2118
2220
  int SNMPenabled;
2127
2229
  char *encryptionalias;
2128
2230
  char *errorlog;
2129
2231
  char *listenhost;
 
2232
  int snmp_index;
2130
2233
#ifndef _WIN32
2131
2234
  char *localuser;
2132
2235
#endif /* _WIN32 */
2142
2245
  char **backendconfig;
2143
2246
  char **include;
2144
2247
  char **plugin;
2145
 
  int plugin_track;
 
2248
  slapi_onoff_t plugin_track;
2146
2249
  struct pw_scheme *pw_storagescheme;
2147
2250
 
2148
 
  int pwpolicy_local;
2149
 
  int pw_is_global_policy;
 
2251
  slapi_onoff_t pwpolicy_local;
 
2252
  slapi_onoff_t pw_is_global_policy;
2150
2253
  passwdPolicy pw_policy;
2151
2254
 
2152
2255
  /* ACCESS LOG */
2153
 
  int  accesslog_logging_enabled;
 
2256
  slapi_onoff_t accesslog_logging_enabled;
2154
2257
  char *accesslog_mode;
2155
2258
  int  accesslog_maxnumlogs;
2156
2259
  int  accesslog_maxlogsize;
2157
 
  int  accesslog_rotationsync_enabled;
 
2260
  slapi_onoff_t accesslog_rotationsync_enabled;
2158
2261
  int  accesslog_rotationsynchour;
2159
2262
  int  accesslog_rotationsyncmin;
2160
2263
  int  accesslog_rotationtime;
2164
2267
  int  accesslog_exptime;
2165
2268
  char *accesslog_exptimeunit;
2166
2269
  int   accessloglevel;
2167
 
  int  accesslogbuffering;
2168
 
  int  csnlogging;
 
2270
  slapi_onoff_t accesslogbuffering;
 
2271
  slapi_onoff_t csnlogging;
2169
2272
 
2170
2273
   /* ERROR LOG */
2171
 
  int errorlog_logging_enabled;
 
2274
  slapi_onoff_t errorlog_logging_enabled;
2172
2275
  char *errorlog_mode;
2173
2276
  int  errorlog_maxnumlogs;
2174
2277
  int  errorlog_maxlogsize;
2175
 
  int  errorlog_rotationsync_enabled;
 
2278
  slapi_onoff_t errorlog_rotationsync_enabled;
2176
2279
  int  errorlog_rotationsynchour;
2177
2280
  int  errorlog_rotationsyncmin;
2178
2281
  int  errorlog_rotationtime;
2186
2289
  /* AUDIT LOG */
2187
2290
  char *auditlog;               /* replication audit file */
2188
2291
  int  auditloglevel;
2189
 
  int  auditlog_logging_enabled;
 
2292
  slapi_onoff_t auditlog_logging_enabled;
2190
2293
  char *auditlog_mode;
2191
2294
  int  auditlog_maxnumlogs;
2192
2295
  int  auditlog_maxlogsize;
2193
 
  int  auditlog_rotationsync_enabled;
 
2296
  slapi_onoff_t auditlog_rotationsync_enabled;
2194
2297
  int  auditlog_rotationsynchour;
2195
2298
  int  auditlog_rotationsyncmin;
2196
2299
  int  auditlog_rotationtime;
2199
2302
  int  auditlog_minfreespace;
2200
2303
  int  auditlog_exptime;
2201
2304
  char *auditlog_exptimeunit;
2202
 
  int  auditlog_logging_hide_unhashed_pw;
2203
 
 
2204
 
  int return_exact_case;        /* Return attribute names with the same case 
2205
 
                                 * as they appear in at.conf */
2206
 
 
2207
 
  int result_tweak;
 
2305
  slapi_onoff_t auditlog_logging_hide_unhashed_pw;
 
2306
 
 
2307
  slapi_onoff_t return_exact_case;      /* Return attribute names with the same case
 
2308
                                       as they appear in at.conf */
 
2309
 
 
2310
  slapi_onoff_t result_tweak;
2208
2311
  char *refer_url;              /* for referral mode */
2209
2312
  int refer_mode;       /* for quick test */
2210
2313
  int   slapd_type;             /* Directory type; Full or Lite */
2211
2314
  
2212
2315
  ber_len_t maxbersize; /* Maximum BER element size we'll accept */
2213
 
  int max_filter_nest_level;/* deepest nested filter we will accept */
2214
 
  int enquote_sup_oc;       /* put single quotes around an oc's 
2215
 
                               superior oc in cn=schema */
 
2316
  slapi_int_t max_filter_nest_level;/* deepest nested filter we will accept */
 
2317
  slapi_onoff_t enquote_sup_oc;       /* put single quotes around an oc's
 
2318
                                         superior oc in cn=schema */
2216
2319
 
2217
2320
  char *certmap_basedn;     /* Default Base DN for certmap */
2218
2321
 
2227
2330
  char *bakdir;     /* full path name of directory containing bakup files */
2228
2331
  char *rundir;     /* where pid, snmp stats, and ldapi files go */
2229
2332
  char *saslpath;   /* full path name of directory containing sasl plugins */
2230
 
  int attrname_exceptions;  /* if true, allow questionable attribute names */
2231
 
  int rewrite_rfc1274;          /* return attrs for both v2 and v3 names */
 
2333
  slapi_onoff_t attrname_exceptions;  /* if true, allow questionable attribute names */
 
2334
  slapi_onoff_t rewrite_rfc1274;                /* return attrs for both v2 and v3 names */
2232
2335
  char *schemareplace;          /* see CONFIG_SCHEMAREPLACE_* #defines below */
2233
2336
  char *ldapi_filename;         /* filename for ldapi socket */
2234
 
  int ldapi_switch;             /* switch to turn ldapi on/off */
2235
 
  int ldapi_bind_switch;        /* switch to turn ldapi auto binding on/off */
 
2337
  slapi_onoff_t ldapi_switch;             /* switch to turn ldapi on/off */
 
2338
  slapi_onoff_t ldapi_bind_switch;        /* switch to turn ldapi auto binding on/off */
2236
2339
  char *ldapi_root_dn;          /* DN to map root to over LDAPI */
2237
 
  int ldapi_map_entries;        /* turns ldapi entry bind mapping on/off */
 
2340
  slapi_onoff_t ldapi_map_entries;        /* turns ldapi entry bind mapping on/off */
2238
2341
  char *ldapi_uidnumber_type;   /* type that contains uid number */
2239
2342
  char *ldapi_gidnumber_type;   /* type that contains gid number */
2240
2343
  char *ldapi_search_base_dn;   /* base dn to search for mapped entries */
2241
2344
  char *ldapi_auto_dn_suffix;   /* suffix to be appended to auto gen DNs */
2242
 
  int slapi_counters;           /* switch to turn slapi_counters on/off */
2243
 
  int allow_unauth_binds;       /* switch to enable/disable unauthenticated binds */
2244
 
  int require_secure_binds;     /* switch to require simple binds to use a secure channel */
2245
 
  int allow_anon_access;        /* switch to enable/disable anonymous access */
 
2345
  slapi_onoff_t slapi_counters;           /* switch to turn slapi_counters on/off */
 
2346
  slapi_onoff_t allow_unauth_binds;       /* switch to enable/disable unauthenticated binds */
 
2347
  slapi_onoff_t require_secure_binds;   /* switch to require simple binds to use a secure channel */
 
2348
  slapi_onoff_t allow_anon_access;      /* switch to enable/disable anonymous access */
2246
2349
  int localssf;                 /* the security strength factor to assign to local conns (ldapi) */
2247
2350
  int minssf;                   /* minimum security strength factor (for SASL and SSL/TLS) */
2248
 
  int minssf_exclude_rootdse; /* ON: minssf is ignored when searching rootdse */
 
2351
  slapi_onoff_t minssf_exclude_rootdse; /* ON: minssf is ignored when searching rootdse */
2249
2352
  size_t maxsasliosize;         /* limit incoming SASL IO packet size */
2250
2353
  char *anon_limits_dn;         /* template entry for anonymous resource limits */
 
2354
  slapi_int_t listen_backlog_size;      /* size of backlog parameter to PR_Listen */
2251
2355
#ifndef _WIN32
2252
2356
  struct passwd *localuserinfo; /* userinfo of localuser */
2253
2357
#endif /* _WIN32 */
2254
2358
#ifdef MEMPOOL_EXPERIMENTAL
2255
 
  int mempool_switch;           /* switch to turn memory pool on/off */
 
2359
  slapi_onoff_t mempool_switch;           /* switch to turn memory pool on/off */
2256
2360
  int mempool_maxfreelist;      /* max free list length per memory pool item */
2257
2361
  long system_page_size;                /* system page size */
2258
2362
  int system_page_bits;                 /* bit count to shift the system page size */
2259
2363
#endif /* MEMPOOL_EXPERIMENTAL */
2260
 
  int force_sasl_external;      /* force SIMPLE bind to be SASL/EXTERNAL if client cert credentials were supplied */
2261
 
  int entryusn_global;          /* Entry USN: Use global counter */
 
2364
  slapi_onoff_t force_sasl_external;      /* force SIMPLE bind to be SASL/EXTERNAL if client cert credentials were supplied */
 
2365
  slapi_onoff_t entryusn_global;          /* Entry USN: Use global counter */
2262
2366
  char *allowed_to_delete_attrs;/* list of config attrs allowed to delete */
2263
2367
  char *entryusn_import_init;   /* Entry USN: determine the initital value of import */
2264
2368
  int pagedsizelimit;
2265
2369
  char *default_naming_context; /* Default naming context (normalized) */
2266
2370
  char *allowed_sasl_mechs;     /* comma/space separated list of allowed sasl mechs */
 
2371
  int sasl_max_bufsize;         /* The max receive buffer size for SASL */
2267
2372
 
2268
2373
  /* disk monitoring */
2269
 
  int disk_monitoring;
2270
 
  int disk_threshold;
 
2374
  slapi_onoff_t disk_monitoring;
 
2375
  PRUint64 disk_threshold;
2271
2376
  int disk_grace_period;
2272
 
  int disk_preserve_logging;
2273
 
  int disk_logging_critical;
 
2377
  slapi_onoff_t disk_logging_critical;
2274
2378
 
2275
2379
  /* normalized dn cache */
2276
 
  int ndn_cache_enabled;
 
2380
  slapi_onoff_t ndn_cache_enabled;
2277
2381
  size_t ndn_cache_max_size;
 
2382
 
 
2383
  slapi_onoff_t return_orig_type; /* if on, search returns original type set in attr list */
 
2384
  slapi_onoff_t sasl_mapping_fallback;
 
2385
  slapi_onoff_t ignore_vattrs;
 
2386
  slapi_onoff_t unhashed_pw_switch;     /* switch to on/off/nolog unhashed pw */
 
2387
  slapi_onoff_t enable_turbo_mode;
 
2388
  slapi_int_t connection_buffer; /* values are CONNECTION_BUFFER_* below */
 
2389
  slapi_onoff_t connection_nocanon; /* if "on" sets LDAP_OPT_X_SASL_NOCANON */
 
2390
  slapi_onoff_t plugin_logging; /* log all internal plugin operations */
 
2391
  slapi_onoff_t ignore_time_skew;
2278
2392
} slapdFrontendConfig_t;
2279
2393
 
2280
2394
/* possible values for slapdFrontendConfig_t.schemareplace */
2282
2396
#define CONFIG_SCHEMAREPLACE_STR_ON                                     "on"
2283
2397
#define CONFIG_SCHEMAREPLACE_STR_REPLICATION_ONLY       "replication-only"
2284
2398
 
 
2399
#define CONNECTION_BUFFER_OFF 0
 
2400
#define CONNECTION_BUFFER_ON 1
 
2401
#define CONNECTION_BUFFER_ADAPT 2
 
2402
 
2285
2403
 
2286
2404
slapdFrontendConfig_t *getFrontendConfig();
2287
2405
 
2380
2498
 
2381
2499
#define MTN_CONTROL_USE_ONE_BACKEND_OID "2.16.840.1.113730.3.4.14"
2382
2500
#define MTN_CONTROL_USE_ONE_BACKEND_EXT_OID     "2.16.840.1.113730.3.4.20"
2383
 
 
 
2501
#if defined(USE_OLD_UNHASHED)
2384
2502
#define PSEUDO_ATTR_UNHASHEDUSERPASSWORD_OID "2.16.840.1.113730.3.1.2110"
 
2503
#endif
2385
2504
 
2386
2505
/* virtualListViewError is a relatively new concept that was added long 
2387
2506
 * after we implemented VLV. Until added to LDAP SDK, we define