diff options
| author | Noriko Hosoi <nhosoi@redhat.com> | 2010-08-26 17:30:29 -0700 |
|---|---|---|
| committer | Noriko Hosoi <nhosoi@redhat.com> | 2010-08-31 10:37:35 -0700 |
| commit | a0282b832d09951a893a4293707a2586020d09cf (patch) | |
| tree | 722c08df4ee3c2ad18b15276978b71ae2773af83 /ldap/servers/slapd/libglobs.c | |
| parent | 7cd57ad2fc78c90a2405128df1e5414161e1ff9d (diff) | |
| download | ds-a0282b832d09951a893a4293707a2586020d09cf.tar.gz ds-a0282b832d09951a893a4293707a2586020d09cf.tar.xz ds-a0282b832d09951a893a4293707a2586020d09cf.zip | |
Bug 531642 - EntryUSN: RFE: a configuration option to make entryusn "global"
https://bugzilla.redhat.com/show_bug.cgi?id=531642
Resolves: 531642
Fix description:
1. Introduced a config parameter nsslapd-entryusn-global: on|off to
enable | disable the global mode. By default, off.
In the global mode, search on root dse returns "lastusn: <num>"
without the backend subtype (e.g., "lastusn;userroot: <num>")
2. Added slapi_get_next_suffix_ext to mapping_tree.c, which visits
children as well as siblings in the mapping tree.
(Note: slapi_get_next_suffix does just siblings.)
3. import (ldif2db) adds "entryusn: 0" to every entry unless the
entry already contains the entryusn attribute.
4. ldbm_back_delete, ldbm_back_modify, ldbm_back_modrdn: set
ldap_result_code to pblock so that bepost plugin could see if
the operation was successful or not.
See also http://directory.fedoraproject.org/wiki/Entry_USN#Global_mode
Diffstat (limited to 'ldap/servers/slapd/libglobs.c')
| -rw-r--r-- | ldap/servers/slapd/libglobs.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c index f1836567..f36588cb 100644 --- a/ldap/servers/slapd/libglobs.c +++ b/ldap/servers/slapd/libglobs.c @@ -624,7 +624,11 @@ static struct config_get_and_set { {CONFIG_FORCE_SASL_EXTERNAL_ATTRIBUTE, config_set_force_sasl_external, NULL, 0, (void**)&global_slapdFrontendConfig.force_sasl_external, CONFIG_ON_OFF, - (ConfigGetFunc)config_get_force_sasl_external} + (ConfigGetFunc)config_get_force_sasl_external}, + {CONFIG_ENTRYUSN_GLOBAL, config_set_entryusn_global, + NULL, 0, + (void**)&global_slapdFrontendConfig.entryusn_global, CONFIG_ON_OFF, + (ConfigGetFunc)config_get_entryusn_global} #ifdef MEMPOOL_EXPERIMENTAL ,{CONFIG_MEMPOOL_SWITCH_ATTRIBUTE, config_set_mempool_switch, NULL, 0, @@ -1002,6 +1006,8 @@ FrontendConfig_init () { cfg->auditlog_exptime = 1; cfg->auditlog_exptimeunit = slapi_ch_strdup("month"); + cfg->entryusn_global = LDAP_OFF; + #ifdef MEMPOOL_EXPERIMENTAL cfg->mempool_switch = LDAP_ON; cfg->mempool_maxfreelist = 1024; @@ -5526,6 +5532,30 @@ config_set_force_sasl_external( const char *attrname, char *value, return retVal; } +int +config_get_entryusn_global(void) +{ + int retVal; + slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); + CFG_LOCK_READ(slapdFrontendConfig); + retVal = slapdFrontendConfig->entryusn_global; + CFG_UNLOCK_READ(slapdFrontendConfig); + + return retVal; +} + +int +config_set_entryusn_global( const char *attrname, char *value, + char *errorbuf, int apply ) +{ + int retVal = LDAP_SUCCESS; + slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); + + retVal = config_set_onoff(attrname, value, + &(slapdFrontendConfig->entryusn_global), + errorbuf, apply); + return retVal; +} /* * This function is intended to be used from the dse code modify callback. It |
