commit_id
string
repo
string
commit_message
string
diff
string
label
int64
7506eeab153820853075754ecc553008b25f1736
389ds/389-ds-base
Resolves: #452328 Summary: range search anomaly on the integer type Description: Retro changelog plugin automatically creates an index for changeNumber, which has an integer type. To support the reange search againt changeNumber, the index should have the matching order "integerOrderingMatch".
commit 7506eeab153820853075754ecc553008b25f1736 Author: Noriko Hosoi <[email protected]> Date: Mon Jun 23 20:41:36 2008 +0000 Resolves: #452328 Summary: range search anomaly on the integer type Description: Retro changelog plugin automatically creates an index for changeNumber, which has an integer type. To support the reange search againt changeNumber, the index should have the matching order "integerOrderingMatch". diff --git a/ldap/servers/plugins/retrocl/retrocl_create.c b/ldap/servers/plugins/retrocl/retrocl_create.c index e4de45de2..88974b722 100644 --- a/ldap/servers/plugins/retrocl/retrocl_create.c +++ b/ldap/servers/plugins/retrocl/retrocl_create.c @@ -166,6 +166,10 @@ static int retrocl_create_be(const char *bedir) val.bv_len = strlen(val.bv_val); slapi_entry_add_values( e, "nsindextype", vals ); + val.bv_val = "integerOrderingMatch"; + val.bv_len = strlen(val.bv_val); + slapi_entry_add_values( e, "nsMatchingRule", vals ); + pb = slapi_pblock_new (); slapi_add_entry_internal_set_pb( pb, e, NULL /* controls */, g_plg_identity[PLUGIN_RETROCL],
0
1bc50015c9e5c693ea7d1b3120778df6ddbe0878
389ds/389-ds-base
Bug 697027 - 1 - minor memory leaks found by Valgrind + TET https://bugzilla.redhat.com/show_bug.cgi?id=697027 [Case 1] Description: Adding slapi_ch_free to free group_slapiattrs to memberof_free_config. Note: attributes which addresses are stored in group_slapiattrs are freed properly.
commit 1bc50015c9e5c693ea7d1b3120778df6ddbe0878 Author: Noriko Hosoi <[email protected]> Date: Fri Apr 15 10:13:12 2011 -0700 Bug 697027 - 1 - minor memory leaks found by Valgrind + TET https://bugzilla.redhat.com/show_bug.cgi?id=697027 [Case 1] Description: Adding slapi_ch_free to free group_slapiattrs to memberof_free_config. Note: attributes which addresses are stored in group_slapiattrs are freed properly. diff --git a/ldap/servers/plugins/memberof/memberof_config.c b/ldap/servers/plugins/memberof/memberof_config.c index 1a258d3d7..d31e690e5 100644 --- a/ldap/servers/plugins/memberof/memberof_config.c +++ b/ldap/servers/plugins/memberof/memberof_config.c @@ -471,6 +471,7 @@ memberof_free_config(MemberOfConfig *config) { slapi_attr_free(&config->group_slapiattrs[i]); } + slapi_ch_free((void **)&config->group_slapiattrs); slapi_ch_free_string(&config->memberof_attr); }
0
c8f5d4faa45855feb7234a1c36bfd50009a543ef
389ds/389-ds-base
Revert "Ticket #48178 add config param to enable nunc-stans" This reverts commit a7caededb70b86f9bcd8503ea2099215504423a7.
commit c8f5d4faa45855feb7234a1c36bfd50009a543ef Author: Rich Megginson <[email protected]> Date: Fri May 1 09:57:19 2015 -0600 Revert "Ticket #48178 add config param to enable nunc-stans" This reverts commit a7caededb70b86f9bcd8503ea2099215504423a7. diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c index 6d719fd9a..58668f021 100644 --- a/ldap/servers/slapd/connection.c +++ b/ldap/servers/slapd/connection.c @@ -282,7 +282,6 @@ connection_cleanup(Connection *conn) ns_enable_listeners(); } #ifdef ENABLE_NUNC_STANS - /* even if !config_get_enable_nunc_stans, it is ok to set to 0 here */ conn->c_ns_close_jobs = 0; #endif } @@ -2358,8 +2357,9 @@ connection_threadmain() int replication_connection = 0; /* If this connection is from a replication supplier, we want to ensure that operation processing is serialized */ int doshutdown = 0; int maxthreads = 0; - int enable_nunc_stans = config_get_enable_nunc_stans(); +#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0 long bypasspollcnt = 0; +#endif #if defined( OSF1 ) || defined( hpux ) /* Arrange to ignore SIGPIPE signals. */ @@ -2552,7 +2552,8 @@ connection_threadmain() * when using nunc-stans - it is supposed to be an optimization but turns out * to not be the opposite with nunc-stans */ - } else if (!enable_nunc_stans) { /* more data in conn - just put back on work_q - bypass poll */ +#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0 + } else { /* more data in conn - just put back on work_q - bypass poll */ bypasspollcnt++; PR_Lock(conn->c_mutex); /* don't do this if it would put us over the max threads per conn */ @@ -2570,6 +2571,7 @@ connection_threadmain() conn->c_maxthreadsblocked++; } PR_Unlock(conn->c_mutex); +#endif } } diff --git a/ldap/servers/slapd/conntable.c b/ldap/servers/slapd/conntable.c index e7ce5e561..dc2e265b2 100644 --- a/ldap/servers/slapd/conntable.c +++ b/ldap/servers/slapd/conntable.c @@ -212,7 +212,6 @@ connection_table_get_connection(Connection_Table *ct, int sd) */ connection_cleanup(c); #ifdef ENABLE_NUNC_STANS - /* NOTE - ok to do this here even if enable_nunc_stans is off */ c->c_ct = ct; /* pointer to connection table that owns this connection */ #endif } diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c index af378f581..29f05804a 100644 --- a/ldap/servers/slapd/daemon.c +++ b/ldap/servers/slapd/daemon.c @@ -119,10 +119,12 @@ short slapd_housekeeping_timer = 10; /* Do we support timeout on socket send() ? */ int have_send_timeouts = 0; +#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0 PRFileDesc* signalpipe[2]; static int writesignalpipe = SLAPD_INVALID_SOCKET; static int readsignalpipe = SLAPD_INVALID_SOCKET; #define FDS_SIGNAL_PIPE 0 +#endif static PRThread *disk_thread_p = NULL; static PRCondVar *diskmon_cvar = NULL; @@ -146,8 +148,6 @@ typedef struct listener_info { static int listeners = 0; /* number of listener sockets */ static listener_info *listener_idxs = NULL; /* array of indexes of listener sockets in the ct->fd array */ -static int enable_nunc_stans = 0; /* if nunc-stans is set to enabled, set to 1 in slapd_daemon */ - #define SLAPD_POLL_LISTEN_READY(xxflagsxx) (xxflagsxx & PR_POLL_READ) static int get_configured_connection_table_size(); @@ -177,7 +177,9 @@ static void* catch_signals(); HANDLE hServDoneEvent = NULL; #endif +#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0 static int createsignalpipe( void ); +#endif #if defined( _WIN32 ) /* Set an event to hook the NT Service termination */ @@ -393,13 +395,14 @@ static void set_timeval_ms(struct timeval *t, int ms); static int handle_new_connection(Connection_Table *ct, int tcps, PRFileDesc *pr_acceptfd, int secure, int local, Connection **newconn ); #ifdef ENABLE_NUNC_STANS static void ns_handle_new_connection(struct ns_job_t *job); -#endif +#else static void handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll); #ifdef _WIN32 static int clear_signal(fd_set *readfdset); #else static int clear_signal(struct POLL_STRUCT *fds); #endif +#endif #ifdef _WIN32 static void unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, int n_tcps, PRFileDesc *s_tcps); #else @@ -931,6 +934,7 @@ disk_monitoring_thread(void *nothing) } } +#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0 static void handle_listeners(Connection_Table *ct) { @@ -954,6 +958,7 @@ handle_listeners(Connection_Table *ct) } return; } +#endif /* !ENABLE_NUNC_STANS */ /* * Convert any pre-existing DES passwords to AES. @@ -1219,9 +1224,6 @@ void ns_enable_listeners() { #ifdef ENABLE_NUNC_STANS - if (!enable_nunc_stans) { - return; - } int num_enabled = 0; listener_info *listener; while ((listener = (listener_info *)PR_StackPop(ns_disabled_listeners))) { @@ -1280,7 +1282,7 @@ nunc_stans_free(void *ptr) { slapi_ch_free((void **)&ptr); } -#endif /* ENABLE_NUNC_STANS */ +#endif void slapd_daemon( daemon_ports_t *ports ) { @@ -1304,7 +1306,9 @@ void slapd_daemon( daemon_ports_t *ports ) PRFileDesc **fdesp = NULL; #endif PRIntn num_poll = 0; +#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0 PRIntervalTime pr_timeout = PR_MillisecondsToInterval(slapd_wakeup_timer); +#endif PRThread *time_thread_p; int threads; int in_referral_mode = config_check_referral_mode(); @@ -1315,10 +1319,6 @@ void slapd_daemon( daemon_ports_t *ports ) int connection_table_size = get_configured_connection_table_size(); the_connection_table= connection_table_new(connection_table_size); -#ifdef ENABLE_NUNC_STANS - enable_nunc_stans = config_get_enable_nunc_stans(); -#endif - #ifdef RESOLVER_NEEDS_LOW_FILE_DESCRIPTORS /* * Some DNS resolver implementations, such as the one built into @@ -1342,10 +1342,10 @@ void slapd_daemon( daemon_ports_t *ports ) i_unix = ports->i_socket; #endif /* ENABLE_LDAPI */ #endif - - if (!enable_nunc_stans) { - createsignalpipe(); - } + +#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0 + createsignalpipe(); +#endif init_shutdown_detect(); @@ -1494,9 +1494,7 @@ void slapd_daemon( daemon_ports_t *ports ) #endif listener_idxs = (listener_info *)slapi_ch_calloc(listeners, sizeof(*listener_idxs)); #ifdef ENABLE_NUNC_STANS - if (enable_nunc_stans) { - ns_disabled_listeners = PR_CreateStack("disabled_listeners"); - } + ns_disabled_listeners = PR_CreateStack("disabled_listeners"); #endif /* * Convert old DES encoded passwords to AES @@ -1504,7 +1502,7 @@ void slapd_daemon( daemon_ports_t *ports ) convert_pbe_des_to_aes(); #ifdef ENABLE_NUNC_STANS - if (enable_nunc_stans && !g_get_shutdown()) { + if (!g_get_shutdown()) { int ii; PRInt32 maxthreads = 3; if (getenv("MAX_THREADS")) { @@ -1538,7 +1536,7 @@ void slapd_daemon( daemon_ports_t *ports ) } } -#endif /* ENABLE_NUNC_STANS */ +#endif /* Now we write the pid file, indicating that the server is finally and listening for connections */ write_pid_file(); @@ -1546,14 +1544,14 @@ void slapd_daemon( daemon_ports_t *ports ) unfurl_banners(the_connection_table,ports,n_tcps,s_tcps,i_unix); #ifdef ENABLE_NUNC_STANS - if (enable_nunc_stans && ns_thrpool_wait(tp)) { + if (ns_thrpool_wait(tp)) { LDAPDebug( LDAP_DEBUG_ANY, "ns_thrpool_wait failed errno %d (%s)\n", errno, slapd_system_strerror(errno), 0 ); } -#endif - /* The meat of the operation is in a loop on a call to select */ - while(!enable_nunc_stans && !g_get_shutdown()) + +#else /* The meat of the operation is in a loop on a call to select */ + while(!g_get_shutdown()) { #ifdef _WIN32 fd_set readfds; @@ -1616,6 +1614,7 @@ void slapd_daemon( daemon_ports_t *ports ) break; } } +#endif /* ENABLE_NUNC_STANS */ /* We get here when the server is shutting down */ /* Do what we have to do before death */ @@ -1689,36 +1688,36 @@ void slapd_daemon( daemon_ports_t *ports ) threads = g_get_active_threadcnt(); while ( threads > 0 ) { - if (!enable_nunc_stans) { - PRPollDesc xpd; - char x; - int spe = 0; - - /* try to read from the signal pipe, in case threads are - * blocked on it. */ - xpd.fd = signalpipe[0]; - xpd.in_flags = PR_POLL_READ; - xpd.out_flags = 0; - spe = PR_Poll(&xpd, 1, PR_INTERVAL_NO_WAIT); - if (spe > 0) { - spe = PR_Read(signalpipe[0], &x, 1); - if (spe < 0) { - PRErrorCode prerr = PR_GetError(); - LDAPDebug( LDAP_DEBUG_ANY, "listener could not clear signal pipe, " - SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - prerr, slapd_system_strerror(prerr), 0 ); - break; - } - } else if (spe == -1) { - PRErrorCode prerr = PR_GetError(); - LDAPDebug( LDAP_DEBUG_ANY, "PR_Poll() failed, " +#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0 + PRPollDesc xpd; + char x; + int spe = 0; + + /* try to read from the signal pipe, in case threads are + * blocked on it. */ + xpd.fd = signalpipe[0]; + xpd.in_flags = PR_POLL_READ; + xpd.out_flags = 0; + spe = PR_Poll(&xpd, 1, PR_INTERVAL_NO_WAIT); + if (spe > 0) { + spe = PR_Read(signalpipe[0], &x, 1); + if (spe < 0) { + PRErrorCode prerr = PR_GetError(); + LDAPDebug( LDAP_DEBUG_ANY, "listener could not clear signal pipe, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", prerr, slapd_system_strerror(prerr), 0 ); - break; - } else { - /* no data */ - } + break; + } + } else if (spe == -1) { + PRErrorCode prerr = PR_GetError(); + LDAPDebug( LDAP_DEBUG_ANY, "PR_Poll() failed, " + SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", + prerr, slapd_system_strerror(prerr), 0 ); + break; + } else { + /* no data */ } +#endif DS_Sleep(PR_INTERVAL_NO_WAIT); if ( threads != g_get_active_threadcnt() ) { LDAPDebug( LDAP_DEBUG_TRACE, @@ -1763,9 +1762,7 @@ void slapd_daemon( daemon_ports_t *ports ) connection_table_free(the_connection_table); the_connection_table= NULL; #ifdef ENABLE_NUNC_STANS - if (enable_nunc_stans) { - ns_thrpool_destroy(tp); - } + ns_thrpool_destroy(tp); #endif be_cleanupall (); connection_post_shutdown_cleanup(); @@ -1792,9 +1789,7 @@ void slapd_daemon( daemon_ports_t *ports ) int signal_listner() { - if (enable_nunc_stans) { - return( 0 ); - } +#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0 /* Replaces previous macro---called to bump the thread out of select */ #if defined( _WIN32 ) if ( PR_Write( signalpipe[1], "", 1) != 1 ) { @@ -1815,19 +1810,18 @@ int signal_listner() "listener could not write to signal pipe %d\n", errno, 0, 0 ); } +#endif #endif return( 0 ); } +#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0 #ifdef _WIN32 static int clear_signal(fd_set *readfdset) #else static int clear_signal(struct POLL_STRUCT *fds) #endif { - if (enable_nunc_stans) { - return 0; - } #ifdef _WIN32 if ( FD_ISSET(readsignalpipe, readfdset)) { #else @@ -1850,6 +1844,7 @@ static int clear_signal(struct POLL_STRUCT *fds) } return 0; } +#endif /* !ENABLE_NUNC_STANS */ #ifdef _WIN32 static void set_timeval_ms(struct timeval *t, int ms) @@ -1994,18 +1989,18 @@ setup_pr_read_pds(Connection_Table *ct, PRFileDesc **n_tcps, PRFileDesc **s_tcps ct->c[i].c_fdi = SLAPD_INVALID_SOCKET_INDEX; } - if (!enable_nunc_stans) { - /* The fds entry for the signalpipe is always FDS_SIGNAL_PIPE (== 0) */ - count = FDS_SIGNAL_PIPE; +#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0 + /* The fds entry for the signalpipe is always FDS_SIGNAL_PIPE (== 0) */ + count = FDS_SIGNAL_PIPE; #if !defined(_WIN32) - ct->fd[count].fd = signalpipe[0]; - ct->fd[count].in_flags = SLAPD_POLL_FLAGS; - ct->fd[count].out_flags = 0; + ct->fd[count].fd = signalpipe[0]; + ct->fd[count].in_flags = SLAPD_POLL_FLAGS; + ct->fd[count].out_flags = 0; #else - ct->fd[count].fd = NULL; + ct->fd[count].fd = NULL; +#endif + count++; #endif - count++; - } /* The fds entry for n_tcps starts with n_tcps and less than n_tcpe */ ct->n_tcps = count; if (n_tcps != NULL && accept_new_connections) @@ -2267,6 +2262,7 @@ handle_read_ready(Connection_Table *ct, fd_set *readfds) #endif /* _WIN32 */ +#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0 static void handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll) { @@ -2422,6 +2418,7 @@ handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll) } #endif } +#endif /* !ENABLE_NUNC_STANS */ #ifdef ENABLE_NUNC_STANS #define CONN_NEEDS_CLOSING(c) (c->c_flags & CONN_FLAG_CLOSING) || (c->c_sd == SLAPD_INVALID_SOCKET) @@ -2481,10 +2478,6 @@ ns_connection_post_io_or_closing(Connection *conn) #ifdef ENABLE_NUNC_STANS struct timeval tv; - if (!enable_nunc_stans) { - return; - } - if (CONN_NEEDS_CLOSING(conn)) { /* there should only ever be 0 or 1 active closure jobs */ PR_ASSERT((conn->c_ns_close_jobs == 0) || (conn->c_ns_close_jobs == 1)); @@ -3393,10 +3386,10 @@ static int init_shutdown_detect() (void) SIGNAL( SIGUSR1, slapd_do_nothing ); (void) SIGNAL( SIGUSR2, set_shutdown ); #endif - if (!enable_nunc_stans) { - (void) SIGNAL( SIGTERM, set_shutdown ); - (void) SIGNAL( SIGHUP, set_shutdown ); - } +#ifndef ENABLE_NUNC_STANS + (void) SIGNAL( SIGTERM, set_shutdown ); + (void) SIGNAL( SIGHUP, set_shutdown ); +#endif #endif /* _WIN32 */ return 0; } @@ -3991,12 +3984,10 @@ netaddr2string(const PRNetAddr *addr, char *addrbuf, size_t addrbuflen) } +#if !defined(ENABLE_NUNC_STANS) || ENABLE_NUNC_STANS == 0 static int createsignalpipe( void ) { - if (enable_nunc_stans) { - return( 0 ); - } #if defined( _WIN32 ) if ( PR_NewTCPSocketPair(&signalpipe[0])) { PRErrorCode prerr = PR_GetError(); @@ -4028,6 +4019,7 @@ createsignalpipe( void ) #endif return( 0 ); } +#endif #ifdef HPUX10 diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c index 5aee1c4ba..d03d39b3e 100644 --- a/ldap/servers/slapd/libglobs.c +++ b/ldap/servers/slapd/libglobs.c @@ -274,9 +274,6 @@ slapi_onoff_t init_ignore_time_skew; slapi_onoff_t init_dynamic_plugins; slapi_onoff_t init_cn_uses_dn_syntax_in_dns; slapi_onoff_t init_global_backend_local; -#ifdef ENABLE_NUNC_STANS -slapi_onoff_t init_enable_nunc_stans; -#endif #if defined (LINUX) slapi_int_t init_malloc_mxfast; slapi_int_t init_malloc_trim_threshold; @@ -1130,13 +1127,7 @@ static struct config_get_and_set { {CONFIG_GLOBAL_BACKEND_LOCK, config_set_global_backend_lock, NULL, 0, (void**)&global_slapdFrontendConfig.global_backend_lock, - CONFIG_ON_OFF, (ConfigGetFunc)config_get_global_backend_lock, &init_global_backend_local} -#ifdef ENABLE_NUNC_STANS - ,{CONFIG_ENABLE_NUNC_STANS, config_set_enable_nunc_stans, - NULL, 0, - (void**)&global_slapdFrontendConfig.enable_nunc_stans, - CONFIG_ON_OFF, (ConfigGetFunc)config_get_enable_nunc_stans, &init_enable_nunc_stans} -#endif + CONFIG_ON_OFF, (ConfigGetFunc)config_get_global_backend_lock, &init_global_backend_local} #ifdef MEMPOOL_EXPERIMENTAL ,{CONFIG_MEMPOOL_SWITCH_ATTRIBUTE, config_set_mempool_switch, NULL, 0, @@ -1585,9 +1576,6 @@ FrontendConfig_init () { init_dynamic_plugins = cfg->dynamic_plugins = LDAP_OFF; init_cn_uses_dn_syntax_in_dns = cfg->cn_uses_dn_syntax_in_dns = LDAP_OFF; init_global_backend_local = LDAP_OFF; -#ifdef ENABLE_NUNC_STANS - init_enable_nunc_stans = cfg->enable_nunc_stans = LDAP_OFF; -#endif #if defined(LINUX) init_malloc_mxfast = cfg->malloc_mxfast = DEFAULT_MALLOC_UNSET; init_malloc_trim_threshold = cfg->malloc_trim_threshold = DEFAULT_MALLOC_UNSET; @@ -7412,33 +7400,6 @@ config_get_listen_backlog_size() return retVal; } -#ifdef ENABLE_NUNC_STANS -int -config_get_enable_nunc_stans() -{ - int retVal; - slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); - CFG_LOCK_READ(slapdFrontendConfig); - retVal = slapdFrontendConfig->enable_nunc_stans; - CFG_UNLOCK_READ(slapdFrontendConfig); - - return retVal; -} - -int -config_set_enable_nunc_stans( const char *attrname, char *value, - char *errorbuf, int apply ) -{ - int retVal = LDAP_SUCCESS; - slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); - - retVal = config_set_onoff(attrname, value, - &(slapdFrontendConfig->enable_nunc_stans), - errorbuf, apply); - return retVal; -} -#endif - static char * config_initvalue_to_onoff(struct config_get_and_set *cgas, char *initvalbuf, size_t initvalbufsize) { diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h index 408543efe..353024d61 100644 --- a/ldap/servers/slapd/proto-slap.h +++ b/ldap/servers/slapd/proto-slap.h @@ -597,10 +597,6 @@ int config_set_dynamic_plugins(const char *attrname, char *value, char *errorbuf int config_get_dynamic_plugins(); int config_set_cn_uses_dn_syntax_in_dns(const char *attrname, char *value, char *errorbuf, int apply); int config_get_cn_uses_dn_syntax_in_dns(); -#ifdef ENABLE_NUNC_STANS -int config_get_enable_nunc_stans(void); -int config_set_enable_nunc_stans(const char *attrname, char *value, char *errorbuf, int apply); -#endif PLHashNumber hashNocaseString(const void *key); PRIntn hashNocaseCompare(const void *v1, const void *v2); diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h index b7c6e802d..6447ee591 100644 --- a/ldap/servers/slapd/slap.h +++ b/ldap/servers/slapd/slap.h @@ -2126,9 +2126,7 @@ typedef struct _slapdEntryPoints { #define CONFIG_PLUGIN_BINDDN_TRACKING_ATTRIBUTE "nsslapd-plugin-binddn-tracking" #define CONFIG_MODDN_ACI_ATTRIBUTE "nsslapd-moddn-aci" #define CONFIG_GLOBAL_BACKEND_LOCK "nsslapd-global-backend-lock" -#ifdef ENABLE_NUNC_STANS -#define CONFIG_ENABLE_NUNC_STANS "nsslapd-enable-nunc-stans" -#endif + #define CONFIG_CONFIG_ATTRIBUTE "nsslapd-config" #define CONFIG_INSTDIR_ATTRIBUTE "nsslapd-instancedir" #define CONFIG_SCHEMADIR_ATTRIBUTE "nsslapd-schemadir" @@ -2435,9 +2433,6 @@ typedef struct _slapdFrontendConfig { slapi_onoff_t dynamic_plugins; /* allow plugins to be dynamically enabled/disabled */ slapi_onoff_t cn_uses_dn_syntax_in_dns; /* indicates the cn value in dns has dn syntax */ slapi_onoff_t global_backend_lock; -#ifdef ENABLE_NUNC_STANS - slapi_onoff_t enable_nunc_stans; -#endif #if defined(LINUX) int malloc_mxfast; /* mallopt M_MXFAST */ int malloc_trim_threshold; /* mallopt M_TRIM_THRESHOLD */
0
580a8757bf5d323cd47ab3372746886459cfda9b
389ds/389-ds-base
csn_as_string - use slapi_uN_to_hex instead of sprintf This introduces the following new slapi functions slapi_u8_to_hex slapi_u16_to_hex slapi_u32_to_hex slapi_u64_to_hex which convert the given unsigned integral value to a char* hexadecimal string. Using this for csn_as_string() is 7-8 times faster than sprintf. Reviewed by: nkinder (Thanks!)
commit 580a8757bf5d323cd47ab3372746886459cfda9b Author: Rich Megginson <[email protected]> Date: Tue Nov 15 11:25:56 2011 -0700 csn_as_string - use slapi_uN_to_hex instead of sprintf This introduces the following new slapi functions slapi_u8_to_hex slapi_u16_to_hex slapi_u32_to_hex slapi_u64_to_hex which convert the given unsigned integral value to a char* hexadecimal string. Using this for csn_as_string() is 7-8 times faster than sprintf. Reviewed by: nkinder (Thanks!) diff --git a/ldap/servers/slapd/csn.c b/ldap/servers/slapd/csn.c index f77086ccf..04800362c 100644 --- a/ldap/servers/slapd/csn.c +++ b/ldap/servers/slapd/csn.c @@ -249,9 +249,11 @@ csn_as_string(const CSN *csn, PRBool replicaIdOrder, char *ss) } else { - /* JCM - hex2char would be quicker */ - sprintf(s,"%08lx%04x%04x%04x", - csn->tstamp,csn->seqnum,csn->rid, csn->subseqnum); + char *ptr = slapi_u32_to_hex(csn->tstamp, s, 0); + ptr = slapi_u16_to_hex(csn->seqnum, ptr, 0); + ptr = slapi_u16_to_hex(csn->rid, ptr, 0); + ptr = slapi_u16_to_hex(csn->subseqnum, ptr, 0); + *ptr = 0; } return s; } diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h index a27f8b1cb..446c5f7ca 100644 --- a/ldap/servers/slapd/slapi-plugin.h +++ b/ldap/servers/slapd/slapi-plugin.h @@ -6738,6 +6738,94 @@ typedef struct _back_info_crypt_value back_info_crypt_value; #define BACK_CRYPT_OUTBUFF_EXTLEN 16 +/** + * Convert unsigned char (8 bit) value to a hex string. Writes to the string. + * The caller must ensure enough space to write 2 bytes. If the upper parameter + * is TRUE, will use upper case A-F instead of lower case a-f for hex numbers. + * Returns the address after the last byte written to encourage usage like this: + * \code + * char *ptr = slapi_u_to_hex(val, buf, 0); + * ptr = slapi_u_to_hex(val2, ptr, 0); + * ... + * ptr = slapi_u_to_hex(valN, ptr, 0); + * *ptr = 0; + * \endcode + * + * \param val unsigned value to convert to string + * \param s string to write hex value into + * \param upper if TRUE use A-F otherwise use a-f + * \return address of next char after writing value to s + * + * \note Does not null terminate s - caller is responsible for that + */ +char *slapi_u8_to_hex(uint8_t val, char *s, uint8_t upper); + +/** + * Convert unsigned short (16 bit) value to a hex string. Writes to the string. + * The caller must ensure enough space to write 4 bytes. If the upper parameter + * is TRUE, will use upper case A-F instead of lower case a-f for hex numbers. + * Returns the address after the last byte written to encourage usage like this: + * \code + * char *ptr = slapi_u_to_hex(val, buf, 0); + * ptr = slapi_u_to_hex(val2, ptr, 0); + * ... + * ptr = slapi_u_to_hex(valN, ptr, 0); + * *ptr = 0; + * \endcode + * + * \param val unsigned value to convert to string + * \param s string to write hex value into + * \param upper if TRUE use A-F otherwise use a-f + * \return address of next char after writing value to s + * + * \note Does not null terminate s - caller is responsible for that + */ +char *slapi_u16_to_hex(uint16_t val, char *s, uint8_t upper); + +/** + * Convert unsigned int (32 bit) value to a hex string. Writes to the string. + * The caller must ensure enough space to write 4 bytes. If the upper parameter + * is TRUE, will use upper case A-F instead of lower case a-f for hex numbers. + * Returns the address after the last byte written to encourage usage like this: + * \code + * char *ptr = slapi_u_to_hex(val, buf, 0); + * ptr = slapi_u_to_hex(val2, ptr, 0); + * ... + * ptr = slapi_u_to_hex(valN, ptr, 0); + * *ptr = 0; + * \endcode + * + * \param val unsigned value to convert to string + * \param s string to write hex value into + * \param upper if TRUE use A-F otherwise use a-f + * \return address of next char after writing value to s + * + * \note Does not null terminate s - caller is responsible for that + */ +char *slapi_u32_to_hex(uint32_t val, char *s, uint8_t upper); + +/** + * Convert unsigned long long (64 bit) value to a hex string. Writes to the string. + * The caller must ensure enough space to write 4 bytes. If the upper parameter + * is TRUE, will use upper case A-F instead of lower case a-f for hex numbers. + * Returns the address after the last byte written to encourage usage like this: + * \code + * char *ptr = slapi_u_to_hex(val, buf, 0); + * ptr = slapi_u_to_hex(val2, ptr, 0); + * ... + * ptr = slapi_u_to_hex(valN, ptr, 0); + * *ptr = 0; + * \endcode + * + * \param val unsigned value to convert to string + * \param s string to write hex value into + * \param upper if TRUE use A-F otherwise use a-f + * \return address of next char after writing value to s + * + * \note Does not null terminate s - caller is responsible for that + */ +char *slapi_u64_to_hex(uint64_t val, char *s, uint8_t upper); + #ifdef __cplusplus } #endif diff --git a/ldap/servers/slapd/util.c b/ldap/servers/slapd/util.c index b91ec129b..e2970b4db 100644 --- a/ldap/servers/slapd/util.c +++ b/ldap/servers/slapd/util.c @@ -48,6 +48,7 @@ #include <sys/param.h> #include <unistd.h> #include <pwd.h> +#include <stdint.h> #endif #include <libgen.h> #include <pk11func.h> @@ -911,3 +912,95 @@ slapd_comp_path(char *p0, char *p1) slapi_ch_free_string(&norm_p1); return rval; } + +/* + Takes an unsigned char value and converts it to a hex string. + The string s is written, and the caller must ensure s has enough + space. For hex numbers, the upper argument says to use a-f or A-F. + The return value is the address of the next char after the last one written. +*/ +char * +slapi_u8_to_hex(uint8_t val, char *s, uint8_t upper) { + static char ldigits[] = "0123456789abcdef"; + static char udigits[] = "0123456789ABCDEF"; + char *digits; + + if (upper) { + digits = udigits; + } else { + digits = ldigits; + } + s[0] = digits[val >> 4]; + s[1] = digits[val & 0xf]; + return &s[2]; +} + +char * +slapi_u16_to_hex(uint16_t val, char *s, uint8_t upper) { + static char ldigits[] = "0123456789abcdef"; + static char udigits[] = "0123456789ABCDEF"; + char *digits; + + if (upper) { + digits = udigits; + } else { + digits = ldigits; + } + s[0] = digits[val >> 12]; + s[1] = digits[(val >> 8) & 0xf]; + s[2] = digits[(val >> 4) & 0xf]; + s[3] = digits[val & 0xf]; + return &s[4]; +} + +char * +slapi_u32_to_hex(uint32_t val, char *s, uint8_t upper) { + static char ldigits[] = "0123456789abcdef"; + static char udigits[] = "0123456789ABCDEF"; + char *digits; + + if (upper) { + digits = udigits; + } else { + digits = ldigits; + } + s[0] = digits[val >> 28]; + s[1] = digits[(val >> 24) & 0xf]; + s[2] = digits[(val >> 20) & 0xf]; + s[3] = digits[(val >> 16) & 0xf]; + s[4] = digits[(val >> 12) & 0xf]; + s[5] = digits[(val >> 8) & 0xf]; + s[6] = digits[(val >> 4) & 0xf]; + s[7] = digits[val & 0xf]; + return &s[8]; +} + +char * +slapi_u64_to_hex(uint64_t val, char *s, uint8_t upper) { + static char ldigits[] = "0123456789abcdef"; + static char udigits[] = "0123456789ABCDEF"; + char *digits; + + if (upper) { + digits = udigits; + } else { + digits = ldigits; + } + s[0] = digits[val >> 60]; + s[1] = digits[(val >> 56) & 0xf]; + s[2] = digits[(val >> 52) & 0xf]; + s[3] = digits[(val >> 48) & 0xf]; + s[4] = digits[(val >> 44) & 0xf]; + s[5] = digits[(val >> 40) & 0xf]; + s[6] = digits[(val >> 36) & 0xf]; + s[7] = digits[(val >> 32) & 0xf]; + s[8] = digits[(val >> 28) & 0xf]; + s[9] = digits[(val >> 24) & 0xf]; + s[10] = digits[(val >> 20) & 0xf]; + s[11] = digits[(val >> 16) & 0xf]; + s[12] = digits[(val >> 12) & 0xf]; + s[13] = digits[(val >> 8) & 0xf]; + s[14] = digits[(val >> 4) & 0xf]; + s[15] = digits[val & 0xf]; + return &s[16]; +}
0
b3797a8704696ed77b69a042e75ce5553e24b68b
389ds/389-ds-base
Bug Description: Need to address 64-bit compiler warnings - part 1 Reviewed by: nhosoi (Thanks!) Fix Description: The intptr_t and uintptr_t are types which are defined as integer types that are the same size as the pointer (void *) type. On the platforms we currently support, this is the same as long and unsigned long, respectively (ILP32 and LP64). However, intptr_t and uintptr_t are more portable. These can be used to assign a value passed as a void * to get an integer value, then "cast down" to an int or PRBool, and vice versa. This seems to be a common idiom in other applications where values must be passed as void *. For the printf/scanf formats, there is a standard header called inttypes.h which defines formats to use for various 64 bit quantities, so that you don't need to figure out if you have to use %lld or %ld for a 64-bit value - you just use PRId64 which is set to the correct value. I also assumed that size_t is defined as the same size as a pointer so I used the PRIuPTR format macro for size_t. I removed many unused variables and some unused functions. I put parentheses around assignments in conditional expressions to tell the compiler not to complain about them. I cleaned up some #defines that were defined more than once. I commented out some unused goto labels. Some of our header files shared among several source files define static variables. I made it so that those variables are not defined unless a macro is set in the source file. This avoids a lot of unused variable warnings. I added some return values to functions that were declared as returning a value but did not return a value. In all of these cases no one was checking the return value anyway. I put explicit parentheses around cases like this: expr || expr && expr - the && has greater precedence than the ||. The compiler complains because it wants you to make sure you mean expr || (expr && expr), not (expr || expr) && expr. I cleaned up several places where the compiler was complaining about possible use of uninitialized variables. There are still a lot of these cases remaining. There are a lot of warnings like this: lib/ldaputil/certmap.c:1279: warning: dereferencing type-punned pointer will break strict-aliasing rules These are due to our use of void ** to pass in addresses of addresses of structures. Many of these are calls to slapi_ch_free, but many are not - they are cases where we do not know what the type is going to be and may have to cast and modify the structure or pointer. I started replacing the calls to slapi_ch_free with slapi_ch_free_string, but there are many many more that need to be fixed. The dblayer code also contains a fix for https://bugzilla.redhat.com/show_bug.cgi?id=463991 - instead of checking for dbenv->foo_handle to see if a db "feature" is enabled, instead check the flags passed to open the dbenv. This works for bdb 4.2 through bdb 4.7 and probably other releases as well. Platforms tested: RHEL5 x86_64, Fedora 8 i386 Flag Day: no Doc impact: no
commit b3797a8704696ed77b69a042e75ce5553e24b68b Author: Rich Megginson <[email protected]> Date: Wed Oct 8 17:29:05 2008 +0000 Bug Description: Need to address 64-bit compiler warnings - part 1 Reviewed by: nhosoi (Thanks!) Fix Description: The intptr_t and uintptr_t are types which are defined as integer types that are the same size as the pointer (void *) type. On the platforms we currently support, this is the same as long and unsigned long, respectively (ILP32 and LP64). However, intptr_t and uintptr_t are more portable. These can be used to assign a value passed as a void * to get an integer value, then "cast down" to an int or PRBool, and vice versa. This seems to be a common idiom in other applications where values must be passed as void *. For the printf/scanf formats, there is a standard header called inttypes.h which defines formats to use for various 64 bit quantities, so that you don't need to figure out if you have to use %lld or %ld for a 64-bit value - you just use PRId64 which is set to the correct value. I also assumed that size_t is defined as the same size as a pointer so I used the PRIuPTR format macro for size_t. I removed many unused variables and some unused functions. I put parentheses around assignments in conditional expressions to tell the compiler not to complain about them. I cleaned up some #defines that were defined more than once. I commented out some unused goto labels. Some of our header files shared among several source files define static variables. I made it so that those variables are not defined unless a macro is set in the source file. This avoids a lot of unused variable warnings. I added some return values to functions that were declared as returning a value but did not return a value. In all of these cases no one was checking the return value anyway. I put explicit parentheses around cases like this: expr || expr && expr - the && has greater precedence than the ||. The compiler complains because it wants you to make sure you mean expr || (expr && expr), not (expr || expr) && expr. I cleaned up several places where the compiler was complaining about possible use of uninitialized variables. There are still a lot of these cases remaining. There are a lot of warnings like this: lib/ldaputil/certmap.c:1279: warning: dereferencing type-punned pointer will break strict-aliasing rules These are due to our use of void ** to pass in addresses of addresses of structures. Many of these are calls to slapi_ch_free, but many are not - they are cases where we do not know what the type is going to be and may have to cast and modify the structure or pointer. I started replacing the calls to slapi_ch_free with slapi_ch_free_string, but there are many many more that need to be fixed. The dblayer code also contains a fix for https://bugzilla.redhat.com/show_bug.cgi?id=463991 - instead of checking for dbenv->foo_handle to see if a db "feature" is enabled, instead check the flags passed to open the dbenv. This works for bdb 4.2 through bdb 4.7 and probably other releases as well. Platforms tested: RHEL5 x86_64, Fedora 8 i386 Flag Day: no Doc impact: no diff --git a/configure b/configure index 4e6e4b348..0ae6ecd08 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for dirsrv 1.1.3. +# Generated by GNU Autoconf 2.59 for dirsrv 1.1.4. # # Report bugs to <http://bugzilla.redhat.com/>. # @@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='dirsrv' PACKAGE_TARNAME='dirsrv' -PACKAGE_VERSION='1.1.3' -PACKAGE_STRING='dirsrv 1.1.3' +PACKAGE_VERSION='1.1.4' +PACKAGE_STRING='dirsrv 1.1.4' PACKAGE_BUGREPORT='http://bugzilla.redhat.com/' # Factoring default headers for most tests. @@ -954,7 +954,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures dirsrv 1.1.3 to adapt to many kinds of systems. +\`configure' configures dirsrv 1.1.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1020,7 +1020,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dirsrv 1.1.3:";; + short | recursive ) echo "Configuration of dirsrv 1.1.4:";; esac cat <<\_ACEOF @@ -1203,7 +1203,7 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -dirsrv configure 1.1.3 +dirsrv configure 1.1.4 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -1217,7 +1217,7 @@ cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by dirsrv $as_me 1.1.3, which was +It was created by dirsrv $as_me 1.1.4, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1863,7 +1863,7 @@ fi # Define the identity of the package. PACKAGE='dirsrv' - VERSION='1.1.3' + VERSION='1.1.4' cat >>confdefs.h <<_ACEOF @@ -19369,7 +19369,8 @@ fi -for ac_header in arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h unistd.h + +for ac_header in arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h unistd.h inttypes.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -25795,7 +25796,7 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by dirsrv $as_me 1.1.3, which was +This file was extended by dirsrv $as_me 1.1.4, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -25858,7 +25859,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -dirsrv config.status 1.1.3 +dirsrv config.status 1.1.4 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index 086111a9f..962d1157a 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) # This version is the version returned by ns-slapd -v -AC_INIT([dirsrv], [1.1.3], [http://bugzilla.redhat.com/]) +AC_INIT([dirsrv], [1.1.4], [http://bugzilla.redhat.com/]) # AC_CONFIG_HEADER must be called right after AC_INIT. AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([1.9 foreign subdir-objects]) @@ -21,7 +21,7 @@ AC_PROG_LIBTOOL AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h unistd.h]) +AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h unistd.h inttypes.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STAT diff --git a/include/i18n.h b/include/i18n.h index aa76997ce..6a614c84f 100644 --- a/include/i18n.h +++ b/include/i18n.h @@ -111,11 +111,11 @@ typedef struct res_RESOURCE_GLOBAL #ifdef RESOURCE_STR #define BEGIN_STR(argLibraryName) \ - RESOURCE_TABLE argLibraryName[] = { 0, #argLibraryName, + RESOURCE_TABLE argLibraryName[] = { {0, #argLibraryName}, #define ResDef(argToken,argID,argString) \ - argID, argString, + {argID, argString}, #define END_STR(argLibraryName) \ - 0, 0 }; + {0, 0} }; #else #define BEGIN_STR(argLibraryName) \ enum { diff --git a/include/ldaputil/certmap.h b/include/ldaputil/certmap.h index 4320ff489..ccfa7fe55 100644 --- a/include/ldaputil/certmap.h +++ b/include/ldaputil/certmap.h @@ -61,6 +61,8 @@ enum { LDAPU_STR_MAX_INDEX }; +#ifdef DEFINE_LDAPU_STRINGS +/* used only in certmap.c and ldaputil.c */ static char *ldapu_strings[] = { "objectclass=*", /* LDAPU_STR_DEFAULT */ "uid=%s", /* LDAPU_STR_FILTER_USER */ @@ -71,7 +73,8 @@ static char *ldapu_strings[] = { "userCertificate;binary", /* LDAPU_STR_ATTR_CERT */ "userCertificate" /* LDAPU_STR_ATTR_CERT_NOSUBTYPE */ }; - +#endif /* DEFINE_LDAPU_STRINGS */ + typedef struct { char *str; int size; diff --git a/ldap/servers/plugins/acl/aclparse.c b/ldap/servers/plugins/acl/aclparse.c index 36ed8456c..4659658eb 100644 --- a/ldap/servers/plugins/acl/aclparse.c +++ b/ldap/servers/plugins/acl/aclparse.c @@ -936,8 +936,8 @@ __aclp__getNextLASRule (aci_t *aci_item, char *original_str , char **endOfCurrRu * eg. "'ldap:///all"' or 'ldap:///all")' then exit in_dn_expr mode. */ if ( in_dn_expr && (word[len-1] == '"' || - len>1 && word[len-2] == '"' || - len>2 && word[len-3] == '"')) { + (len>1 && word[len-2] == '"') || + (len>2 && word[len-3] == '"')) ) { in_dn_expr = 0; } @@ -1692,7 +1692,7 @@ static int __acl__init_targetattrfilters( aci_t *aci, char *input_str) { if ((str = strstr(s , "del=")) || ((str = strstr(s , "del ="))) ) { str--; *str = '\0'; - *str++; + str++; } @@ -1704,7 +1704,7 @@ static int __acl__init_targetattrfilters( aci_t *aci, char *input_str) { if ((str = strstr(s , "add=")) || ((str = strstr(s , "add ="))) ) { str--; *str = '\0'; - *str++; + str++; } } else { return(ACL_SYNTAX_ERR); diff --git a/ldap/servers/plugins/acl/aclutil.c b/ldap/servers/plugins/acl/aclutil.c index 7c79a2996..106e5e9c2 100644 --- a/ldap/servers/plugins/acl/aclutil.c +++ b/ldap/servers/plugins/acl/aclutil.c @@ -1328,13 +1328,14 @@ void acl_ht_add_and_freeOld(acl_ht_t * acl_ht, PLHashNumber key, char *value){ char *old_value = NULL; + uintptr_t pkey = (uintptr_t)key; if ( (old_value = (char *)acl_ht_lookup( acl_ht, key)) != NULL ) { acl_ht_remove( acl_ht, key); slapi_ch_free((void **)&old_value); } - PL_HashTableAdd( acl_ht, (const void *)key, value); + PL_HashTableAdd( acl_ht, (const void *)pkey, value); } /* @@ -1349,7 +1350,7 @@ acl_ht_t *acl_ht_new(void) { static PLHashNumber acl_ht_hash( const void *key) { - return( (PLHashNumber)key ); + return( (PLHashNumber)((uintptr_t)key) ); } /* Free all the values in the ht */ @@ -1397,14 +1398,14 @@ acl_ht_display_entry(PLHashEntry *he, PRIntn i, void *arg) /* remove this entry from the ht--doesn't free the value.*/ void acl_ht_remove( acl_ht_t *acl_ht, PLHashNumber key) { - PL_HashTableRemove( acl_ht, (const void *)key); + PL_HashTableRemove( acl_ht, (const void *)((uintptr_t)key) ); } /* Retrieve a pointer to the value of the entry with key */ void *acl_ht_lookup( acl_ht_t *acl_ht, PLHashNumber key) { - return( PL_HashTableLookup( acl_ht, (const void *)key) ); + return( PL_HashTableLookup( acl_ht, (const void *)((uintptr_t)key)) ); } diff --git a/ldap/servers/plugins/chainingdb/cb_instance.c b/ldap/servers/plugins/chainingdb/cb_instance.c index 13791c0cf..15e266bd8 100644 --- a/ldap/servers/plugins/chainingdb/cb_instance.c +++ b/ldap/servers/plugins/chainingdb/cb_instance.c @@ -903,7 +903,7 @@ static int cb_instance_userpassword_set(void *arg, void *value, char *errorbuf, static void *cb_instance_sizelimit_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data = inst->sizelimit; @@ -916,10 +916,10 @@ static int cb_instance_sizelimit_set(void *arg, void *value, char *errorbuf, int cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { PR_RWLock_Wlock(inst->rwl_config_lock); - inst->sizelimit=(int) value; + inst->sizelimit=(int) ((uintptr_t)value); PR_RWLock_Unlock(inst->rwl_config_lock); if (inst->inst_be) - be_set_sizelimit(inst->inst_be, (int) value); + be_set_sizelimit(inst->inst_be, (int) ((uintptr_t)value)); } return LDAP_SUCCESS; } @@ -927,7 +927,7 @@ static int cb_instance_sizelimit_set(void *arg, void *value, char *errorbuf, int static void *cb_instance_timelimit_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data = inst->timelimit; @@ -940,10 +940,10 @@ static int cb_instance_timelimit_set(void *arg, void *value, char *errorbuf, int cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { PR_RWLock_Wlock(inst->rwl_config_lock); - inst->timelimit=(int) value; + inst->timelimit=(int) ((uintptr_t)value); PR_RWLock_Unlock(inst->rwl_config_lock); if (inst->inst_be) - be_set_timelimit(inst->inst_be, (int) value); + be_set_timelimit(inst->inst_be, (int) ((uintptr_t)value)); } return LDAP_SUCCESS; } @@ -951,7 +951,7 @@ static int cb_instance_timelimit_set(void *arg, void *value, char *errorbuf, int static void *cb_instance_max_test_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data = inst->max_test_time; @@ -964,7 +964,7 @@ static int cb_instance_max_test_set(void *arg, void *value, char *errorbuf, int cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { PR_RWLock_Wlock(inst->rwl_config_lock); - inst->max_test_time=(int) value; + inst->max_test_time=(int) ((uintptr_t)value); PR_RWLock_Unlock(inst->rwl_config_lock); } return LDAP_SUCCESS; @@ -973,7 +973,7 @@ static int cb_instance_max_test_set(void *arg, void *value, char *errorbuf, int static void *cb_instance_max_idle_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data = inst->max_idle_time; @@ -986,7 +986,7 @@ static int cb_instance_max_idle_set(void *arg, void *value, char *errorbuf, int cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { PR_RWLock_Wlock(inst->rwl_config_lock); - inst->max_idle_time=(int) value; + inst->max_idle_time=(int) ((uintptr_t)value); PR_RWLock_Unlock(inst->rwl_config_lock); } return LDAP_SUCCESS; @@ -996,7 +996,7 @@ static int cb_instance_max_idle_set(void *arg, void *value, char *errorbuf, int static void *cb_instance_hoplimit_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data = inst->hoplimit; @@ -1009,7 +1009,7 @@ static int cb_instance_hoplimit_set(void *arg, void *value, char *errorbuf, int cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { PR_RWLock_Wlock(inst->rwl_config_lock); - inst->hoplimit=(int) value; + inst->hoplimit=(int) ((uintptr_t)value); PR_RWLock_Unlock(inst->rwl_config_lock); } return LDAP_SUCCESS; @@ -1018,7 +1018,7 @@ static int cb_instance_hoplimit_set(void *arg, void *value, char *errorbuf, int static void *cb_instance_maxbconn_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data = inst->bind_pool->conn.maxconnections; @@ -1031,7 +1031,7 @@ static int cb_instance_maxbconn_set(void *arg, void *value, char *errorbuf, int cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { PR_RWLock_Wlock(inst->rwl_config_lock); - inst->bind_pool->conn.maxconnections=(int) value; + inst->bind_pool->conn.maxconnections=(int) ((uintptr_t)value); PR_RWLock_Unlock(inst->rwl_config_lock); } return LDAP_SUCCESS; @@ -1040,7 +1040,7 @@ static int cb_instance_maxbconn_set(void *arg, void *value, char *errorbuf, int static void *cb_instance_maxconn_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data = inst->pool->conn.maxconnections; @@ -1053,7 +1053,7 @@ static int cb_instance_maxconn_set(void *arg, void *value, char *errorbuf, int p cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { PR_RWLock_Wlock(inst->rwl_config_lock); - inst->pool->conn.maxconnections=(int) value; + inst->pool->conn.maxconnections=(int) ((uintptr_t)value); PR_RWLock_Unlock(inst->rwl_config_lock); } return LDAP_SUCCESS; @@ -1062,7 +1062,7 @@ static int cb_instance_maxconn_set(void *arg, void *value, char *errorbuf, int p static void *cb_instance_abandonto_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data = inst->abandon_timeout.tv_sec; @@ -1084,7 +1084,7 @@ static int cb_instance_abandonto_set(void *arg, void *value, char *errorbuf, int } PR_RWLock_Wlock(inst->rwl_config_lock); - inst->abandon_timeout.tv_sec=(int) value; + inst->abandon_timeout.tv_sec=(int) ((uintptr_t)value); inst->abandon_timeout.tv_usec=0; PR_RWLock_Unlock(inst->rwl_config_lock); } @@ -1094,7 +1094,7 @@ static int cb_instance_abandonto_set(void *arg, void *value, char *errorbuf, int static void *cb_instance_maxbconc_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data = inst->bind_pool->conn.maxconcurrency; @@ -1107,7 +1107,7 @@ static int cb_instance_maxbconc_set(void *arg, void *value, char *errorbuf, int cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { PR_RWLock_Wlock(inst->rwl_config_lock); - inst->bind_pool->conn.maxconcurrency=(int) value; + inst->bind_pool->conn.maxconcurrency=(int) ((uintptr_t)value); PR_RWLock_Unlock(inst->rwl_config_lock); } return LDAP_SUCCESS; @@ -1116,7 +1116,7 @@ static int cb_instance_maxbconc_set(void *arg, void *value, char *errorbuf, int static void *cb_instance_maxconc_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data = inst->pool->conn.maxconcurrency; @@ -1129,7 +1129,7 @@ static int cb_instance_maxconc_set(void *arg, void *value, char *errorbuf, int p cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { PR_RWLock_Wlock(inst->rwl_config_lock); - inst->pool->conn.maxconcurrency=(int) value; + inst->pool->conn.maxconcurrency=(int) ((uintptr_t)value); PR_RWLock_Unlock(inst->rwl_config_lock); } return LDAP_SUCCESS; @@ -1138,7 +1138,7 @@ static int cb_instance_maxconc_set(void *arg, void *value, char *errorbuf, int p static void *cb_instance_imperson_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data = inst->impersonate; @@ -1153,7 +1153,7 @@ static int cb_instance_imperson_set(void *arg, void *value, char *errorbuf, int if (apply) { PR_RWLock_Wlock(inst->rwl_config_lock); - inst->impersonate=(int) value; + inst->impersonate=(int) ((uintptr_t)value); PR_RWLock_Unlock(inst->rwl_config_lock); } else { /* Security check: Make sure the proxing user is */ @@ -1162,7 +1162,7 @@ static int cb_instance_imperson_set(void *arg, void *value, char *errorbuf, int char * rootdn=cb_get_rootdn(); PR_RWLock_Rlock(inst->rwl_config_lock); - if (((int) value) && inst->pool && inst->pool->binddn && + if (((int) ((uintptr_t)value)) && inst->pool && inst->pool->binddn && !strcmp(inst->pool->binddn,rootdn)) { /* UTF-8 aware */ rc=LDAP_UNWILLING_TO_PERFORM; if (errorbuf) @@ -1179,7 +1179,7 @@ static int cb_instance_imperson_set(void *arg, void *value, char *errorbuf, int static void *cb_instance_connlife_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data=inst->pool->conn.connlifetime; @@ -1192,7 +1192,7 @@ static int cb_instance_connlife_set(void *arg, void *value, char *errorbuf, int cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { PR_RWLock_Wlock(inst->rwl_config_lock); - inst->pool->conn.connlifetime=(int) value; + inst->pool->conn.connlifetime=(int) ((uintptr_t)value); PR_RWLock_Unlock(inst->rwl_config_lock); } return LDAP_SUCCESS; @@ -1201,7 +1201,7 @@ static int cb_instance_connlife_set(void *arg, void *value, char *errorbuf, int static void *cb_instance_bindto_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data=inst->bind_pool->conn.op_timeout.tv_sec; @@ -1214,12 +1214,12 @@ static int cb_instance_bindto_set(void *arg, void *value, char *errorbuf, int ph cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { PR_RWLock_Wlock(inst->rwl_config_lock); - inst->bind_pool->conn.op_timeout.tv_sec=(int) value; + inst->bind_pool->conn.op_timeout.tv_sec=(int) ((uintptr_t)value); inst->bind_pool->conn.op_timeout.tv_usec=0; - inst->bind_pool->conn.bind_timeout.tv_sec=(int) value; + inst->bind_pool->conn.bind_timeout.tv_sec=(int) ((uintptr_t)value); inst->bind_pool->conn.bind_timeout.tv_usec=0; /* Used to bind to the farm server */ - inst->pool->conn.bind_timeout.tv_sec=(int) value; + inst->pool->conn.bind_timeout.tv_sec=(int) ((uintptr_t)value); inst->pool->conn.bind_timeout.tv_usec=0; PR_RWLock_Unlock(inst->rwl_config_lock); } @@ -1229,7 +1229,7 @@ static int cb_instance_bindto_set(void *arg, void *value, char *errorbuf, int ph static void *cb_instance_opto_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data=inst->pool->conn.op_timeout.tv_sec; @@ -1242,7 +1242,7 @@ static int cb_instance_opto_set(void *arg, void *value, char *errorbuf, int phas cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { PR_RWLock_Wlock(inst->rwl_config_lock); - inst->pool->conn.op_timeout.tv_sec=(int) value; + inst->pool->conn.op_timeout.tv_sec=(int) ((uintptr_t)value); inst->pool->conn.op_timeout.tv_usec=0; PR_RWLock_Unlock(inst->rwl_config_lock); } @@ -1252,7 +1252,7 @@ static int cb_instance_opto_set(void *arg, void *value, char *errorbuf, int phas static void *cb_instance_ref_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data=inst->searchreferral; @@ -1265,7 +1265,7 @@ static int cb_instance_ref_set(void *arg, void *value, char *errorbuf, int phase cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { PR_RWLock_Wlock(inst->rwl_config_lock); - inst->searchreferral=(int) value; + inst->searchreferral=(int) ((uintptr_t)value); PR_RWLock_Unlock(inst->rwl_config_lock); } return LDAP_SUCCESS; @@ -1274,7 +1274,7 @@ static int cb_instance_ref_set(void *arg, void *value, char *errorbuf, int phase static void *cb_instance_acl_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data=inst->local_acl; @@ -1295,7 +1295,7 @@ static int cb_instance_acl_set(void *arg, void *value, char *errorbuf, int phase return LDAP_SUCCESS; } PR_RWLock_Wlock(inst->rwl_config_lock); - inst->local_acl=(int) value; + inst->local_acl=(int) ((uintptr_t)value); PR_RWLock_Unlock(inst->rwl_config_lock); } return LDAP_SUCCESS; @@ -1304,7 +1304,7 @@ static int cb_instance_acl_set(void *arg, void *value, char *errorbuf, int phase static void *cb_instance_bindretry_get(void *arg) { cb_backend_instance * inst=(cb_backend_instance *) arg; - int data; + uintptr_t data; PR_RWLock_Rlock(inst->rwl_config_lock); data=inst->bind_retry; @@ -1317,7 +1317,7 @@ static int cb_instance_bindretry_set(void *arg, void *value, char *errorbuf, int cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { PR_RWLock_Wlock(inst->rwl_config_lock); - inst->bind_retry=(int) value; + inst->bind_retry=(int) ((uintptr_t)value); PR_RWLock_Unlock(inst->rwl_config_lock); } return LDAP_SUCCESS; @@ -1383,7 +1383,7 @@ struct berval *bval, char *err_buf, int phase, int apply_mod) } else { int_val = cb_atoi((char *)bval->bv_val); } - retval = config->config_set_fn(arg, (void *) int_val, err_buf, phase, apply_mod); + retval = config->config_set_fn(arg, (void *) ((uintptr_t)int_val), err_buf, phase, apply_mod); break; case CB_CONFIG_TYPE_INT_OCTAL: if (use_default) { @@ -1391,7 +1391,7 @@ struct berval *bval, char *err_buf, int phase, int apply_mod) } else { int_val = (int) strtol((char *)bval->bv_val, NULL, 8); } - retval = config->config_set_fn(arg, (void *) int_val, err_buf, phase, apply_mod); + retval = config->config_set_fn(arg, (void *) ((uintptr_t)int_val), err_buf, phase, apply_mod); break; case CB_CONFIG_TYPE_LONG: if (use_default) { @@ -1414,7 +1414,7 @@ struct berval *bval, char *err_buf, int phase, int apply_mod) } else { int_val = !strcasecmp((char *) bval->bv_val, "on"); } - retval = config->config_set_fn(arg, (void *) int_val, err_buf, phase, apply_mod); + retval = config->config_set_fn(arg, (void *) ((uintptr_t)int_val), err_buf, phase, apply_mod); break; } return retval; @@ -1435,10 +1435,10 @@ void cb_instance_config_get(void *arg, cb_instance_config_info *config, char *bu switch(config->config_type) { case CB_CONFIG_TYPE_INT: - sprintf(buf, "%d", (int) config->config_get_fn(arg)); + sprintf(buf, "%d", (int) ((uintptr_t)config->config_get_fn(arg))); break; case CB_CONFIG_TYPE_INT_OCTAL: - sprintf(buf, "%o", (int) config->config_get_fn(arg)); + sprintf(buf, "%o", (int) ((uintptr_t)config->config_get_fn(arg))); break; case CB_CONFIG_TYPE_LONG: sprintf(buf, "%ld", (long) config->config_get_fn(arg)); @@ -1451,7 +1451,7 @@ void cb_instance_config_get(void *arg, cb_instance_config_info *config, char *bu slapi_ch_free((void **)&tmp_string); break; case CB_CONFIG_TYPE_ONOFF: - if ((int) config->config_get_fn(arg)) { + if ((int) ((uintptr_t)config->config_get_fn(arg))) { sprintf(buf,"%s","on"); } else { sprintf(buf,"%s","off"); diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c index 7b7470bd8..24184914b 100644 --- a/ldap/servers/plugins/dna/dna.c +++ b/ldap/servers/plugins/dna/dna.c @@ -55,6 +55,13 @@ #include "prclist.h" #include "ldif.h" +/* Required to get portable printf/scanf format macros */ +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#else +#error Need to define portable format macros such as PRIu64 +#endif /* HAVE_INTTYPES_H */ + /* get file mode flags for unix */ #ifndef _WIN32 #include <sys/stat.h> @@ -708,7 +715,7 @@ dna_parse_config_entry(Slapi_Entry * e, int apply) } slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, - "----------> %s [%llu]\n", DNA_NEXTVAL, entry->nextval, 0, + "----------> %s [%" PRIu64 "]\n", DNA_NEXTVAL, entry->nextval, 0, 0); value = slapi_entry_attr_get_charptr(e, DNA_PREFIX); @@ -736,7 +743,7 @@ dna_parse_config_entry(Slapi_Entry * e, int apply) } slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, - "----------> %s [%llu]\n", DNA_INTERVAL, entry->interval, 0, 0); + "----------> %s [%" PRIu64 "]\n", DNA_INTERVAL, entry->interval, 0, 0); #endif value = slapi_entry_attr_get_charptr(e, DNA_GENERATE); @@ -844,7 +851,7 @@ dna_parse_config_entry(Slapi_Entry * e, int apply) entry->threshold = strtoull(value, 0, 0); slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, - "----------> %s [%llu]\n", DNA_THRESHOLD, value, 0, 0); + "----------> %s [%" PRIu64 "]\n", DNA_THRESHOLD, value, 0, 0); slapi_ch_free_string(&value); } else { @@ -1319,8 +1326,8 @@ dna_notice_allocation(struct configEntry *config_entry, PRUint64 new, * don't need to do this if we already have a next range on deck. */ if ((config_entry->next_range_lower == 0) && (config_entry->remaining <= config_entry->threshold)) { slapi_log_error(SLAPI_LOG_FATAL, DNA_PLUGIN_SUBSYSTEM, - "dna_notice_allocation: Passed threshold of %llu remaining values " - "for range %s. (%llu values remain)\n", + "dna_notice_allocation: Passed threshold of %" PRIu64 " remaining values " + "for range %s. (%" PRIu64 " values remain)\n", config_entry->threshold, config_entry->dn, config_entry->remaining); /* Only attempt to fix maxval if the fix flag is set. */ if (fix != 0) { @@ -1461,13 +1468,11 @@ static int dna_request_range(struct configEntry *config_entry, struct dnaServer *server, PRUint64 *lower, PRUint64 *upper) { - Slapi_DN *agmt_sdn = NULL; char *bind_dn = NULL; char *bind_passwd = NULL; char *bind_method = NULL; int is_ssl = 0; int is_client_auth = 0; - int replport = 0; struct berval *request = NULL; char *retoid = NULL; struct berval *responsedata = NULL; @@ -1767,12 +1772,12 @@ dna_first_free_value(struct configEntry *config_entry, if (prefix) { /* The 7 below is for all of the filter characters "(&(=))" * plus the trailing \0. The 20 is for the maximum string - * representation of a %llu. */ + * representation of a " PRIu64 ". */ filterlen = strlen(config_entry->filter) + strlen(prefix) + strlen(type) + 7 + 20; filter = slapi_ch_malloc(filterlen); - snprintf(filter, filterlen, "(&%s(%s=%s%llu))", + snprintf(filter, filterlen, "(&%s(%s=%s%" PRIu64 "))", config_entry->filter, type, prefix, tmpval); } else { ctrls = (LDAPControl **)slapi_ch_calloc(2, sizeof(LDAPControl)); @@ -1785,7 +1790,7 @@ dna_first_free_value(struct configEntry *config_entry, return LDAP_OPERATIONS_ERROR; } - filter = slapi_ch_smprintf("(&%s(&(%s>=%llu)(%s<=%llu)))", + filter = slapi_ch_smprintf("(&%s(&(%s>=%" PRIu64 ")(%s<=%" PRIu64 ")))", config_entry->filter, type, tmpval, type, config_entry->maxval); @@ -1836,7 +1841,7 @@ dna_first_free_value(struct configEntry *config_entry, /* filter is guaranteed to be big enough since we allocated * enough space to fit a string representation of any unsigned * 64-bit integer */ - snprintf(filter, filterlen, "(&%s(%s=%s%llu))", + snprintf(filter, filterlen, "(&%s(%s=%s%" PRIu64 "))", config_entry->filter, type, prefix, tmpval); /* clear out the pblock so we can re-use it */ @@ -1968,7 +1973,7 @@ static int dna_get_next_value(struct configEntry *config_entry, * of our current range */ if (nextval <= (config_entry->maxval + config_entry->interval)) { /* try to set the new next value in the config entry */ - snprintf(next_value, sizeof(next_value),"%llu", nextval); + snprintf(next_value, sizeof(next_value),"%" PRIu64, nextval); /* set up our replace modify operation */ replace_val[0] = next_value; @@ -1998,7 +2003,7 @@ static int dna_get_next_value(struct configEntry *config_entry, if (LDAP_SUCCESS == ret) { slapi_ch_free_string(next_value_ret); - *next_value_ret = slapi_ch_smprintf("%llu", setval); + *next_value_ret = slapi_ch_smprintf("%" PRIu64, setval); if (NULL == *next_value_ret) { ret = LDAP_OPERATIONS_ERROR; goto done; @@ -2045,7 +2050,7 @@ dna_update_shared_config(struct configEntry * config_entry) /* We store the number of remaining assigned values * in the shared config entry. */ - snprintf(remaining_vals, sizeof(remaining_vals),"%llu", config_entry->remaining); + snprintf(remaining_vals, sizeof(remaining_vals),"%" PRIu64, config_entry->remaining); /* set up our replace modify operation */ replace_val[0] = remaining_vals; @@ -2130,7 +2135,7 @@ dna_update_next_range(struct configEntry *config_entry, int ret = 0; /* Try to set the new next range in the config entry. */ - snprintf(nextrange_value, sizeof(nextrange_value), "%llu-%llu", + snprintf(nextrange_value, sizeof(nextrange_value), "%" PRIu64 "-%" PRIu64, lower, upper); /* set up our replace modify operation */ @@ -2199,8 +2204,8 @@ dna_activate_next_range(struct configEntry *config_entry) int ret = 0; /* Setup the modify operation for the config entry */ - snprintf(maxval_val, sizeof(maxval_val),"%llu", config_entry->next_range_upper); - snprintf(nextval_val, sizeof(nextval_val),"%llu", config_entry->next_range_lower); + snprintf(maxval_val, sizeof(maxval_val),"%" PRIu64, config_entry->next_range_upper); + snprintf(nextval_val, sizeof(nextval_val),"%" PRIu64, config_entry->next_range_lower); maxval_vals[0] = maxval_val; maxval_vals[1] = 0; @@ -2817,8 +2822,8 @@ static int dna_extend_exop(Slapi_PBlock *pb) char highstr[16]; /* Create the exop response */ - snprintf(lowstr, sizeof(lowstr), "%llu", lower); - snprintf(highstr, sizeof(highstr), "%llu", upper); + snprintf(lowstr, sizeof(lowstr), "%" PRIu64, lower); + snprintf(highstr, sizeof(highstr), "%" PRIu64, upper); range_low.bv_val = lowstr; range_low.bv_len = strlen(range_low.bv_val); range_high.bv_val = highstr; @@ -2846,12 +2851,12 @@ static int dna_extend_exop(Slapi_PBlock *pb) slapi_pblock_set(pb, SLAPI_EXT_OP_RET_VALUE, respdata); /* send the response ourselves */ - send_ldap_result( pb, ret, NULL, NULL, 0, NULL ); + slapi_send_ldap_result( pb, ret, NULL, NULL, 0, NULL ); ret = SLAPI_PLUGIN_EXTENDED_SENT_RESULT; ber_bvfree(respdata); slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, - "dna_extend_exop: Released range %llu-%llu.\n", + "dna_extend_exop: Released range %" PRIu64 "-%" PRIu64 ".\n", lower, upper); } @@ -2993,7 +2998,7 @@ dna_release_range(char *range_dn, PRUint64 *lower, PRUint64 *upper) *lower = *upper - release + 1; /* try to set the new maxval in the config entry */ - snprintf(max_value, sizeof(max_value),"%llu", (*lower - 1)); + snprintf(max_value, sizeof(max_value),"%" PRIu64, (*lower - 1)); /* set up our replace modify operation */ replace_val[0] = max_value; @@ -3092,11 +3097,11 @@ void dna_dump_config_entry(struct configEntry * entry) printf("<---- filter ---------> %s\n", entry->filter); printf("<---- prefix ---------> %s\n", entry->prefix); printf("<---- scope ----------> %s\n", entry->scope); - printf("<---- next value -----> %llu\n", entry->nextval); - printf("<---- max value ------> %llu\n", entry->maxval); - printf("<---- interval -------> %llu\n", entry->interval); + printf("<---- next value -----> %" PRIu64 "\n", entry->nextval); + printf("<---- max value ------> %" PRIu64 "\n", entry->maxval); + printf("<---- interval -------> %" PRIu64 "\n", entry->interval); printf("<---- generate flag --> %s\n", entry->generate); printf("<---- shared cfg base > %s\n", entry->shared_cfg_base); printf("<---- shared cfg DN --> %s\n", entry->shared_cfg_dn); - printf("<---- threshold -----> %llu", entry->threshold); + printf("<---- threshold ------> %" PRIu64 "", entry->threshold); } diff --git a/ldap/servers/plugins/pam_passthru/pam_ptimpl.c b/ldap/servers/plugins/pam_passthru/pam_ptimpl.c index 1f3b5db42..93aa9207f 100644 --- a/ldap/servers/plugins/pam_passthru/pam_ptimpl.c +++ b/ldap/servers/plugins/pam_passthru/pam_ptimpl.c @@ -177,7 +177,7 @@ free_pam_response(int nresp, struct pam_response *resp) * tell if this is actually the case. */ static int -pam_conv_func(int num_msg, struct pam_message **msg, struct pam_response **resp, void *mydata) +pam_conv_func(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *mydata) { int ii; struct berval *creds; diff --git a/ldap/servers/plugins/passthru/ptconfig.c b/ldap/servers/plugins/passthru/ptconfig.c index e929483bb..28579183c 100644 --- a/ldap/servers/plugins/passthru/ptconfig.c +++ b/ldap/servers/plugins/passthru/ptconfig.c @@ -102,7 +102,7 @@ int passthru_config( int argc, char **argv ) { int i, j, rc, tosecs, using_def_connlifetime; - char *p, **suffixarray; + char **suffixarray; PassThruServer *prevsrvr, *srvr; PassThruSuffix *suffix, *prevsuffix; LDAPURLDesc *ludp; @@ -144,7 +144,7 @@ passthru_config( int argc, char **argv ) and that the url does not look like this: ldap://host also assumes suffixes do not have any / in them */ - if (p = strrchr(srvr->ptsrvr_url, '/')) { /* look for last / */ + if ((p = strrchr(srvr->ptsrvr_url, '/'))) { /* look for last / */ p = strchr(p, ' '); /* look for first space after last / */ if (p) { if (!strchr(p, ',')) { /* no comma */ diff --git a/ldap/servers/plugins/presence/presence.c b/ldap/servers/plugins/presence/presence.c index 9a6e97b86..18739a751 100644 --- a/ldap/servers/plugins/presence/presence.c +++ b/ldap/servers/plugins/presence/presence.c @@ -66,13 +66,7 @@ /*** from proto-slap.h ***/ -int slapd_log_error_proc( char *subsystem, char *fmt, ... ) -#ifdef __GNUC__ - __attribute__ ((format (printf, 2, 3))); -#else - ; -#endif - +int slapd_log_error_proc( char *subsystem, char *fmt, ... ); /*** from ldaplog.h ***/ @@ -346,7 +340,6 @@ int presence_init( Slapi_PBlock *pb ) int presence_start( Slapi_PBlock *pb ) { char * plugindn = NULL; - char * httpRootDir = NULL; LDAPDebug( LDAP_DEBUG_PLUGIN, "--> presence_start -- begin\n",0,0,0); @@ -1105,7 +1098,6 @@ static int setTypes(PLHashEntry *he, PRIntn i, void *arg) { int status; int props = SLAPI_ATTR_FLAG_OPATTR; - Slapi_Attr *attr = NULL; Slapi_ValueSet *results = NULL; int type_name_disposition = 0; char *actual_type_name = 0; @@ -1150,7 +1142,6 @@ logGraphicAttributeValue( Slapi_Attr *attr, const char *attrname ) v = slapi_value_get_berval(val); if (v) { char *ldifvalue; - size_t attrnamelen = strlen( attrname ); LDAPDebug( LDAP_DEBUG_PLUGIN, "----------> %s size [%d] \n", attrname,v->bv_len,0); diff --git a/ldap/servers/plugins/pwdstorage/crypt_pwd.c b/ldap/servers/plugins/pwdstorage/crypt_pwd.c index aa7ac3a7f..02ec7d088 100644 --- a/ldap/servers/plugins/pwdstorage/crypt_pwd.c +++ b/ldap/servers/plugins/pwdstorage/crypt_pwd.c @@ -53,7 +53,9 @@ char *crypt(char *key, char *salt); #else #include <sys/socket.h> #if defined( hpux ) || defined ( AIX ) || defined (LINUX) || defined (OSF1) +#ifndef __USE_XOPEN #define __USE_XOPEN /* linux */ +#endif /* __USE_XOPEN */ #include <unistd.h> #else /* hpux */ #include <crypt.h> diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c index 034174ab9..d81e2a09b 100644 --- a/ldap/servers/plugins/replication/cl5_api.c +++ b/ldap/servers/plugins/replication/cl5_api.c @@ -3376,8 +3376,6 @@ out: */ static int _cl5Upgrade4_4(char *fromVersion, char *toVersion) { - PRDirEntry *entry = NULL; - DB *thisdb = NULL; CL5OpenMode backup; int rc = 0; diff --git a/ldap/servers/plugins/replication/repl5_agmt.c b/ldap/servers/plugins/replication/repl5_agmt.c index b37ef756c..60d3565be 100644 --- a/ldap/servers/plugins/replication/repl5_agmt.c +++ b/ldap/servers/plugins/replication/repl5_agmt.c @@ -1183,7 +1183,7 @@ agmt_validate_replicated_attributes(Repl_Agmt *ra) { char *this_attr = NULL; int i = 0; - for (i = 0; this_attr = frac_attrs[i]; i++) + for (i = 0; (this_attr = frac_attrs[i]); i++) { if (charray_inlist(verbotten_attrs,this_attr)) { int k = 0; diff --git a/ldap/servers/plugins/replication/repl5_connection.c b/ldap/servers/plugins/replication/repl5_connection.c index aa754cf40..a8aecafea 100644 --- a/ldap/servers/plugins/replication/repl5_connection.c +++ b/ldap/servers/plugins/replication/repl5_connection.c @@ -1728,7 +1728,7 @@ repl5_stop_debug_timeout(Slapi_Eq_Context eqctx, int *setlevel) char msg[SLAPI_DSE_RETURNTEXT_SIZE]; if (eqctx && !*setlevel) { - int found = slapi_eq_cancel(eqctx); + (void)slapi_eq_cancel(eqctx); } if (s_debug_timeout && s_debug_level && *setlevel) { diff --git a/ldap/servers/plugins/replication/repl5_protocol_util.c b/ldap/servers/plugins/replication/repl5_protocol_util.c index 4a4114d71..f1b703648 100644 --- a/ldap/servers/plugins/replication/repl5_protocol_util.c +++ b/ldap/servers/plugins/replication/repl5_protocol_util.c @@ -417,7 +417,8 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv) } } } -error: + +/* error: */ if (NULL != ruv_bervals) ber_bvecfree(ruv_bervals); if (NULL != replarea_sdn) diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c index 87b8b6d3e..69a446736 100644 --- a/ldap/servers/plugins/replication/repl5_replica.c +++ b/ldap/servers/plugins/replication/repl5_replica.c @@ -1076,7 +1076,7 @@ replica_update_csngen_state_ext (Replica *r, const RUV *ruv, const CSN *extracsn rc = csngen_adjust_time (gen, csn); /* rc will be either CSN_SUCCESS (0) or clock skew */ -done: +/* done: */ PR_Unlock(r->repl_lock); if (csn != extracsn) /* do not free the given csn */ diff --git a/ldap/servers/plugins/replication/repl5_updatedn_list.c b/ldap/servers/plugins/replication/repl5_updatedn_list.c index 3d8971987..8cdb8d5ea 100644 --- a/ldap/servers/plugins/replication/repl5_updatedn_list.c +++ b/ldap/servers/plugins/replication/repl5_updatedn_list.c @@ -193,7 +193,7 @@ replica_updatedn_list_ismember(ReplicaUpdateDNList list, const Slapi_DN *dn) /* Bug 605169 - null ndn would cause core dump */ if ( ndn ) { - ret = (PRBool)PL_HashTableLookupConst(hash, ndn); + ret = (PRBool)((uintptr_t)PL_HashTableLookupConst(hash, ndn)); } return ret; diff --git a/ldap/servers/plugins/roles/roles_plugin.c b/ldap/servers/plugins/roles/roles_plugin.c index 9edc903cc..96f92756b 100644 --- a/ldap/servers/plugins/roles/roles_plugin.c +++ b/ldap/servers/plugins/roles/roles_plugin.c @@ -50,15 +50,9 @@ #include "vattr_spi.h" #include "roles_cache.h" +#define DEFINE_STATECHANGE_STATICS 1 #include "statechange.h" - -#ifdef SOURCEFILE -#undef SOURCEFILE -#endif -#define SOURCEFILE "roles_plugin.c" -static char *sourcefile = SOURCEFILE; - #define STATECHANGE_ROLES_ID "Roles" #define STATECHANGE_ROLES_CONFG_FILTER "objectclass=nsRoleDefinition" #define STATECHANGE_ROLES_ENTRY_FILTER "objectclass=*" diff --git a/ldap/servers/slapd/agtmmap.c b/ldap/servers/slapd/agtmmap.c index 180abb0a6..db04273a2 100644 --- a/ldap/servers/slapd/agtmmap.c +++ b/ldap/servers/slapd/agtmmap.c @@ -195,7 +195,7 @@ agt_mopen_stats (char * statsfile, int mode, int *hdl) { /* Without this we will get segv when we try to read/write later */ buf = calloc (1, sz); - write (fd, buf, sz); + (void)write (fd, buf, sz); free (buf); } diff --git a/ldap/servers/slapd/auth.c b/ldap/servers/slapd/auth.c index 6e6ffe14a..0b68a688f 100644 --- a/ldap/servers/slapd/auth.c +++ b/ldap/servers/slapd/auth.c @@ -449,7 +449,7 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData) if ( conn->c_flags & CONN_FLAG_START_TLS ) { if ( cipherInfo.symKeyBits == 0 ) { start_tls_graceful_closure( conn, NULL, 1 ); - slapi_ch_free((void **)&cipher); + slapi_ch_free_string(&cipher); return ; } } @@ -457,7 +457,7 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData) if (config_get_SSLclientAuth() == SLAPD_SSLCLIENTAUTH_OFF ) { slapi_log_access (LDAP_DEBUG_STATS, "conn=%d SSL %i-bit %s\n", conn->c_connid, keySize, cipher ? cipher : "NULL" ); - slapi_ch_free((void **)&cipher); + slapi_ch_free_string(&cipher); return; } if (clientCert == NULL) { @@ -499,7 +499,7 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData) LDAPDebug (LDAP_DEBUG_TRACE, "<= ldapu_cert_to_ldap_entry() %i (%s)%s\n", err, extraErrorMsg, chain ? "" : " NULL"); } - slapi_ch_free((void**)&basedn); + slapi_ch_free_string(&basedn); slapu_msgfree (internal_ld, chain); } if (subject) free (subject); @@ -522,6 +522,6 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData) bind_credentials_set( conn, SLAPD_AUTH_SSL, clientDN, SLAPD_AUTH_SSL, clientDN, clientCert , NULL); - slapi_ch_free((void **)&cipher); + slapi_ch_free_string(&cipher); /* clientDN and clientCert will be freed later */ } diff --git a/ldap/servers/slapd/back-ldbm/back-ldbm.h b/ldap/servers/slapd/back-ldbm/back-ldbm.h index d589f0d6e..f362f76c3 100644 --- a/ldap/servers/slapd/back-ldbm/back-ldbm.h +++ b/ldap/servers/slapd/back-ldbm/back-ldbm.h @@ -114,6 +114,15 @@ typedef unsigned short u_int16_t; #define MEGABYTE (1024 * 1024) #define GIGABYTE (1024 * MEGABYTE) +#define DB_USES_LOCKING(env) \ + (DB_INIT_LOCK & ((env)->get_open_flags((env), NULL))) +#define DB_USES_TRANSACTIONS(env) \ + (DB_INIT_TXN & ((env)->get_open_flags((env), NULL))) +#define DB_USES_MPOOL(env) \ + (DB_INIT_MPOOL & ((env)->get_open_flags((env), NULL))) +#define DB_USES_LOGGING(env) \ + (DB_INIT_LOG & ((env)->get_open_flags((env), NULL))) + /* include NSPR header files */ #include "nspr.h" diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c index abd71b85d..bc8b55f77 100644 --- a/ldap/servers/slapd/back-ldbm/dblayer.c +++ b/ldap/servers/slapd/back-ldbm/dblayer.c @@ -97,6 +97,13 @@ #include "dblayer.h" #include <prrwlock.h> +/* Required to get portable printf/scanf format macros */ +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#else +#error Need to define portable format macros such as PRIu64 +#endif /* HAVE_INTTYPES_H */ + #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4100 #define DB_OPEN(oflags, db, txnid, file, database, type, flags, mode, rval) \ { \ @@ -284,7 +291,7 @@ dblayer_bt_compare(DB *db, const DBT *dbt1, const DBT *dbt2) int dblayer_set_batch_transactions(void *arg, void *value, char *errorbuf, int phase, int apply) { - int val = (int) value; + int val = (int)((uintptr_t)value); int retval = LDAP_SUCCESS; if (apply) { @@ -304,7 +311,7 @@ dblayer_set_batch_transactions(void *arg, void *value, char *errorbuf, int phase void * dblayer_get_batch_transactions(void *arg) { - return (void *)trans_batch_limit; + return (void *)((uintptr_t)trans_batch_limit); } @@ -465,25 +472,25 @@ int dblayer_open_huge_file(const char *path, int oflag, int mode) } -/* Helper function for large seeks, db2.4 */ -static int dblayer_seek24_large(int fd, size_t pgsize, db_pgno_t pageno, - u_long relative, int isrewind, int whence) +#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4300 +/* Helper function for large seeks, db4.3 */ +static int dblayer_seek43_large(int fd, off64_t offset, int whence) { - off64_t offset = 0, ret; + int ret = 0; - offset = (off64_t)pgsize * pageno + relative; - if (isrewind) offset = -offset; ret = lseek64(fd, offset, whence); return (ret < 0) ? errno : 0; } - -#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4300 -/* Helper function for large seeks, db4.3 */ -static int dblayer_seek43_large(int fd, off64_t offset, int whence) +#else +/* Helper function for large seeks, db2.4 */ +static int dblayer_seek24_large(int fd, size_t pgsize, db_pgno_t pageno, + u_long relative, int isrewind, int whence) { - int ret = 0; + off64_t offset = 0, ret; + offset = (off64_t)pgsize * pageno + relative; + if (isrewind) offset = -offset; ret = lseek64(fd, offset, whence); return (ret < 0) ? errno : 0; @@ -892,7 +899,7 @@ void dblayer_sys_pages(size_t *pagesize, size_t *pages, size_t *procpages, size_ if (feof(f)) break; if (strncmp(s, "VmSize:", 7) == 0) { - sscanf(s+7, "%d", procpages); + sscanf(s+7, "%" PRIuPTR, procpages); break; } } @@ -3449,7 +3456,7 @@ static int deadlock_threadmain(void *param) { if (priv->dblayer_enable_transactions) { - if (NULL != priv->dblayer_env->dblayer_DB_ENV->lk_handle) { + if (DB_USES_LOCKING(priv->dblayer_env->dblayer_DB_ENV)) { int aborted; if ((rval = LOCK_DETECT(priv->dblayer_env->dblayer_DB_ENV, 0, @@ -3619,7 +3626,7 @@ static int checkpoint_threadmain(void *param) checkpoint_interval) continue; - if (NULL == priv->dblayer_env->dblayer_DB_ENV->tx_handle) + if (!DB_USES_TRANSACTIONS(priv->dblayer_env->dblayer_DB_ENV)) continue; /* now checkpoint */ @@ -3777,7 +3784,7 @@ static int trickle_threadmain(void *param) DS_Sleep(interval); /* 622855: wait for other threads fully started */ if (priv->dblayer_enable_transactions) { - if ( (NULL != priv->dblayer_env->dblayer_DB_ENV->mp_handle) && + if ( DB_USES_MPOOL(priv->dblayer_env->dblayer_DB_ENV) && (0 != priv->dblayer_trickle_percentage) ) { int pages_written = 0; diff --git a/ldap/servers/slapd/back-ldbm/dbverify.c b/ldap/servers/slapd/back-ldbm/dbverify.c index c6f910b90..aaece1fff 100644 --- a/ldap/servers/slapd/back-ldbm/dbverify.c +++ b/ldap/servers/slapd/back-ldbm/dbverify.c @@ -50,7 +50,6 @@ dbverify_ext( ldbm_instance *inst, int verbose ) char *filep = NULL; PRDir *dirhandle = NULL; PRDirEntry *direntry = NULL; - backend *be = inst->inst_be; DB *dbp = NULL; int tmplen = 0; int filelen = 0; @@ -87,7 +86,6 @@ dbverify_ext( ldbm_instance *inst, int verbose ) (direntry = PR_ReadDir(dirhandle, PR_SKIP_DOT | PR_SKIP_DOT_DOT))) { /* struct attrinfo *ai = NULL; */ - char *p = NULL; dbp = NULL; if (!direntry->name) diff --git a/ldap/servers/slapd/back-ldbm/import-merge.c b/ldap/servers/slapd/back-ldbm/import-merge.c index 445860ece..b2d2074d1 100644 --- a/ldap/servers/slapd/back-ldbm/import-merge.c +++ b/ldap/servers/slapd/back-ldbm/import-merge.c @@ -49,6 +49,13 @@ #include "back-ldbm.h" #include "import.h" +/* Required to get portable printf/scanf format macros */ +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#else +#error Need to define portable format macros such as PRIu64 +#endif /* HAVE_INTTYPES_H */ + struct _import_merge_thang { int type; @@ -667,7 +674,7 @@ int import_mega_merge(ImportJob *job) if (1 == job->number_indexers) { import_log_notice(job, "Beginning %d-way merge of one file...", passes); } else { - import_log_notice(job, "Beginning %d-way merge of up to %lu files...", + import_log_notice(job, "Beginning %d-way merge of up to %" PRIuPTR " files...", passes, job->number_indexers); } diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c b/ldap/servers/slapd/back-ldbm/import-threads.c index afbc178d1..c6303d339 100644 --- a/ldap/servers/slapd/back-ldbm/import-threads.c +++ b/ldap/servers/slapd/back-ldbm/import-threads.c @@ -49,6 +49,13 @@ * a wire import (aka "fast replica" import) won't have a producer thread. */ +/* Required to get portable printf/scanf format macros */ +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#else +#error Need to define portable format macros such as PRIu64 +#endif /* HAVE_INTTYPES_H */ + #include "back-ldbm.h" #include "vlv_srch.h" #include "import.h" @@ -56,6 +63,7 @@ #define STDIN_FILENO 0 #endif +static void import_wait_for_space_in_fifo(ImportJob *job, size_t new_esize); static struct backentry *import_make_backentry(Slapi_Entry *e, ID id) { @@ -570,8 +578,8 @@ void import_producer(void *param) "ending line %d of file \"%s\"", escape_string(slapi_entry_get_dn(e), ebuf), curr_lineno, curr_filename); - import_log_notice(job, "REASON: entry too large (%d bytes) for " - "the buffer size (%d bytes)", newesize, job->fifo.bsize); + import_log_notice(job, "REASON: entry too large (%ld bytes) for " + "the buffer size (%" PRIuPTR " bytes)", newesize, job->fifo.bsize); backentry_free(&ep); job->skipped++; continue; @@ -804,8 +812,8 @@ void index_producer(void *param) char ebuf[BUFSIZ]; import_log_notice(job, "WARNING: skipping entry \"%s\"", escape_string(slapi_entry_get_dn(e), ebuf)); - import_log_notice(job, "REASON: entry too large (%d bytes) for " - "the buffer size (%d bytes)", newesize, job->fifo.bsize); + import_log_notice(job, "REASON: entry too large (%" PRIuPTR " bytes) for " + "the buffer size (%" PRIuPTR " bytes)", newesize, job->fifo.bsize); backentry_free(&ep); job->skipped++; continue; @@ -1185,7 +1193,7 @@ void import_worker(void *param) int idl_disposition = 0; struct vlvIndex* vlv_index = NULL; void *substring_key_buffer = NULL; - FifoItem *fi; + FifoItem *fi = NULL; int is_objectclass_attribute; int is_nsuniqueid_attribute; void *attrlist_cursor; @@ -1598,8 +1606,8 @@ static int bulk_import_queue(ImportJob *job, Slapi_Entry *entry) char ebuf[BUFSIZ]; import_log_notice(job, "WARNING: skipping entry \"%s\"", escape_string(slapi_entry_get_dn(ep->ep_entry), ebuf)); - import_log_notice(job, "REASON: entry too large (%d bytes) for " - "the import buffer size (%d bytes). Try increasing nsslapd-cachememsize.", newesize, job->fifo.bsize); + import_log_notice(job, "REASON: entry too large (%" PRIuPTR " bytes) for " + "the import buffer size (%" PRIuPTR " bytes). Try increasing nsslapd-cachememsize.", newesize, job->fifo.bsize); backentry_clear_entry(ep); /* entry is released in the frontend on failure*/ backentry_free( &ep ); /* release the backend wrapper, here */ PR_Unlock(job->wire_lock); @@ -1670,7 +1678,7 @@ int ldbm_back_wire_import(Slapi_PBlock *pb) { struct ldbminfo *li; backend *be = NULL; - ImportJob *job; + ImportJob *job = NULL; PRThread *thread; int state; @@ -1954,7 +1962,7 @@ dse_conf_verify_core(struct ldbminfo *li, char *src_dir, char *file_name, char * if (entry_filter != NULL) /* Single instance restoration */ { - if (!(int)strstr(estr, entry_filter)) + if (NULL == strstr(estr, entry_filter)) continue; } diff --git a/ldap/servers/slapd/back-ldbm/import.c b/ldap/servers/slapd/back-ldbm/import.c index 533a61c32..2a2c69179 100644 --- a/ldap/servers/slapd/back-ldbm/import.c +++ b/ldap/servers/slapd/back-ldbm/import.c @@ -46,6 +46,12 @@ * please make sure you use 4-space indentation on this file. */ +/* Required to get portable printf/scanf format macros */ +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#else +#error Need to define portable format macros such as PRIu64 +#endif /* HAVE_INTTYPES_H */ #include "back-ldbm.h" #include "vlv_srch.h" @@ -1149,7 +1155,7 @@ int import_main_offline(void *arg) import_log_notice(job, "Index buffering is disabled."); else import_log_notice(job, - "Index buffering enabled with bucket size %lu", + "Index buffering enabled with bucket size %" PRIuPTR, job->job_index_buffer_suggestion); job->worker_list = producer; @@ -1312,7 +1318,7 @@ error: if (job->not_here_skipped) { if (job->skipped) - import_log_notice(job, "Import complete. Processed %lu entries " + import_log_notice(job, "Import complete. Processed %" PRIuPTR " entries " "(%d bad entries were skipped, " "%d entries were skipped because they don't " "belong to this database) in %d seconds. " @@ -1320,7 +1326,7 @@ error: job->skipped, job->not_here_skipped, seconds_to_import, entries_per_second); else - import_log_notice(job, "Import complete. Processed %lu entries " + import_log_notice(job, "Import complete. Processed %" PRIuPTR " entries " "(%d entries were skipped because they don't " "belong to this database) " "in %d seconds. (%.2f entries/sec)", @@ -1330,13 +1336,13 @@ error: else { if (job->skipped) - import_log_notice(job, "Import complete. Processed %lu entries " + import_log_notice(job, "Import complete. Processed %" PRIuPTR " entries " "(%d were skipped) in %d seconds. " "(%.2f entries/sec)", entries_processed, job->skipped, seconds_to_import, entries_per_second); else - import_log_notice(job, "Import complete. Processed %lu entries " + import_log_notice(job, "Import complete. Processed %" PRIuPTR " entries " "in %d seconds. (%.2f entries/sec)", entries_processed, seconds_to_import, entries_per_second); diff --git a/ldap/servers/slapd/back-ldbm/import.h b/ldap/servers/slapd/back-ldbm/import.h index f94004fd7..0ae56c1db 100644 --- a/ldap/servers/slapd/back-ldbm/import.h +++ b/ldap/servers/slapd/back-ldbm/import.h @@ -235,4 +235,3 @@ void import_producer(void *param); void index_producer(void *param); void import_foreman(void *param); void import_worker(void *param); -static void import_wait_for_space_in_fifo(ImportJob *job, size_t new_esize); diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attr.c b/ldap/servers/slapd/back-ldbm/ldbm_attr.c index 520bca912..d13495b92 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_attr.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_attr.c @@ -258,16 +258,16 @@ attr_index_config( preamble, officialOID, index_rules[j] ); slapi_ch_free((void**)&preamble); } - } else if (p = - strstr(index_rules[j], INDEX_ATTR_SUBSTRBEGIN)) { + } else if ((p = + strstr(index_rules[j], INDEX_ATTR_SUBSTRBEGIN))) { _set_attr_substrlen(INDEX_SUBSTRBEGIN, index_rules[j], &substrlens); - } else if (p = - strstr(index_rules[j], INDEX_ATTR_SUBSTRMIDDLE)) { + } else if ((p = + strstr(index_rules[j], INDEX_ATTR_SUBSTRMIDDLE))) { _set_attr_substrlen(INDEX_SUBSTRMIDDLE, index_rules[j], &substrlens); - } else if (p = - strstr(index_rules[j], INDEX_ATTR_SUBSTREND)) { + } else if ((p = + strstr(index_rules[j], INDEX_ATTR_SUBSTREND))) { _set_attr_substrlen(INDEX_SUBSTREND, index_rules[j], &substrlens); } else if (!slapi_matchingrule_is_ordering(index_rules[j], attrsyntax_oid)) { diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c index 1ddd1f210..e5e2e8896 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_config.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c @@ -42,6 +42,13 @@ /* ldbm_config.c - Handles configuration information that is global to all ldbm instances. */ +/* Required to get portable printf/scanf format macros */ +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#else +#error Need to define portable format macros such as PRIu64 +#endif /* HAVE_INTTYPES_H */ + #include "back-ldbm.h" #include "dblayer.h" @@ -147,14 +154,14 @@ static void *ldbm_config_lookthroughlimit_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) (li->li_lookthroughlimit); + return (void *) ((uintptr_t)(li->li_lookthroughlimit)); } static int ldbm_config_lookthroughlimit_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); /* Do whatever we can to make sure the data is ok. */ @@ -169,14 +176,14 @@ static void *ldbm_config_mode_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) (li->li_mode); + return (void *) ((uintptr_t)(li->li_mode)); } static int ldbm_config_mode_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); /* Do whatever we can to make sure the data is ok. */ @@ -191,14 +198,14 @@ static void *ldbm_config_allidsthreshold_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) (li->li_allidsthreshold); + return (void *) ((uintptr_t)(li->li_allidsthreshold)); } static int ldbm_config_allidsthreshold_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); /* Do whatever we can to make sure the data is ok. */ @@ -365,14 +372,14 @@ static void *ldbm_config_maxpassbeforemerge_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) (li->li_maxpassbeforemerge); + return (void *) ((uintptr_t)(li->li_maxpassbeforemerge)); } static int ldbm_config_maxpassbeforemerge_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { if (val < 0) { @@ -391,14 +398,14 @@ static void *ldbm_config_dbncache_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) (li->li_new_dbncache); + return (void *) ((uintptr_t)(li->li_new_dbncache)); } static int ldbm_config_dbncache_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { if (val < 0) { @@ -454,14 +461,14 @@ static void *ldbm_config_db_durable_transactions_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->dblayer_durable_transactions; + return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_durable_transactions); } static int ldbm_config_db_durable_transactions_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { li->li_dblayer_private->dblayer_durable_transactions = val; @@ -474,7 +481,7 @@ static void *ldbm_config_db_lockdown_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->dblayer_lockdown; + return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_lockdown); } static int ldbm_config_db_lockdown_set( @@ -487,7 +494,7 @@ static int ldbm_config_db_lockdown_set( { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { li->li_dblayer_private->dblayer_lockdown = val; @@ -500,14 +507,14 @@ static void *ldbm_config_db_circular_logging_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->dblayer_circular_logging; + return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_circular_logging); } static int ldbm_config_db_circular_logging_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { li->li_dblayer_private->dblayer_circular_logging = val; @@ -520,14 +527,14 @@ static void *ldbm_config_db_transaction_logging_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->dblayer_enable_transactions; + return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_enable_transactions); } static int ldbm_config_db_transaction_logging_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { li->li_dblayer_private->dblayer_enable_transactions = val; @@ -560,14 +567,14 @@ static void *ldbm_config_db_checkpoint_interval_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->dblayer_checkpoint_interval; + return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_checkpoint_interval); } static int ldbm_config_db_checkpoint_interval_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { li->li_dblayer_private->dblayer_checkpoint_interval = val; @@ -620,14 +627,14 @@ static void *ldbm_config_db_idl_divisor_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->dblayer_idl_divisor; + return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_idl_divisor); } static int ldbm_config_db_idl_divisor_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { li->li_dblayer_private->dblayer_idl_divisor = val; @@ -660,14 +667,14 @@ static void *ldbm_config_db_spin_count_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->dblayer_spin_count; + return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_spin_count); } static int ldbm_config_db_spin_count_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { li->li_dblayer_private->dblayer_spin_count = val; @@ -680,14 +687,14 @@ static void *ldbm_config_db_trickle_percentage_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->dblayer_trickle_percentage; + return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_trickle_percentage); } static int ldbm_config_db_trickle_percentage_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (val < 0 || val > 100) { PR_snprintf(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, @@ -707,14 +714,14 @@ static void *ldbm_config_db_verbose_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->dblayer_verbose; + return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_verbose); } static int ldbm_config_db_verbose_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { li->li_dblayer_private->dblayer_verbose = val; @@ -727,14 +734,14 @@ static void *ldbm_config_db_debug_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->dblayer_debug; + return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_debug); } static int ldbm_config_db_debug_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { li->li_dblayer_private->dblayer_debug = val; @@ -747,14 +754,14 @@ static void *ldbm_config_db_named_regions_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->dblayer_named_regions; + return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_named_regions); } static int ldbm_config_db_named_regions_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { li->li_dblayer_private->dblayer_named_regions = val; @@ -767,14 +774,14 @@ static void *ldbm_config_db_private_mem_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->dblayer_private_mem; + return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_private_mem); } static int ldbm_config_db_private_mem_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { li->li_dblayer_private->dblayer_private_mem = val; @@ -787,14 +794,14 @@ static void *ldbm_config_db_private_import_mem_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->dblayer_private_import_mem; + return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_private_import_mem); } static int ldbm_config_db_private_import_mem_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { li->li_dblayer_private->dblayer_private_import_mem = val; @@ -820,7 +827,7 @@ static int ldbm_config_db_shm_key_set( { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { li->li_dblayer_private->dblayer_shm_key = val; @@ -833,7 +840,7 @@ static void *ldbm_config_db_lock_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->dblayer_lock_config; + return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_lock_config); } @@ -859,14 +866,14 @@ static void *ldbm_config_db_cache_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->dblayer_cache_config; + return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_cache_config); } static int ldbm_config_db_cache_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { li->li_dblayer_private->dblayer_cache_config = val; @@ -879,14 +886,14 @@ static void *ldbm_config_db_debug_checkpointing_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->db_debug_checkpointing; + return (void *) ((uintptr_t)li->li_dblayer_private->db_debug_checkpointing); } static int ldbm_config_db_debug_checkpointing_set(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { li->li_dblayer_private->db_debug_checkpointing = val; @@ -922,7 +929,7 @@ static void *ldbm_config_import_cache_autosize_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *)arg; - return (void *)(li->li_import_cache_autosize); + return (void *)((uintptr_t)(li->li_import_cache_autosize)); } static int ldbm_config_import_cache_autosize_set(void *arg, void *value, char *errorbuf, @@ -931,7 +938,7 @@ static int ldbm_config_import_cache_autosize_set(void *arg, void *value, char *e struct ldbminfo *li = (struct ldbminfo *)arg; if (apply) - li->li_import_cache_autosize = (int)value; + li->li_import_cache_autosize = (int)((uintptr_t)value); return LDAP_SUCCESS; } @@ -939,7 +946,7 @@ static void *ldbm_config_cache_autosize_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *)arg; - return (void *)(li->li_cache_autosize); + return (void *)((uintptr_t)(li->li_cache_autosize)); } static int ldbm_config_cache_autosize_set(void *arg, void *value, char *errorbuf, @@ -948,7 +955,7 @@ static int ldbm_config_cache_autosize_set(void *arg, void *value, char *errorbuf struct ldbminfo *li = (struct ldbminfo *)arg; if (apply) - li->li_cache_autosize = (int)value; + li->li_cache_autosize = (int)((uintptr_t)value); return LDAP_SUCCESS; } @@ -956,7 +963,7 @@ static void *ldbm_config_cache_autosize_split_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *)arg; - return (void *)(li->li_cache_autosize_split); + return (void *)((uintptr_t)(li->li_cache_autosize_split)); } static int ldbm_config_cache_autosize_split_set(void *arg, void *value, char *errorbuf, @@ -965,7 +972,7 @@ static int ldbm_config_cache_autosize_split_set(void *arg, void *value, char *er struct ldbminfo *li = (struct ldbminfo *)arg; if (apply) - li->li_cache_autosize_split = (int)value; + li->li_cache_autosize_split = (int)((uintptr_t)value); return LDAP_SUCCESS; } @@ -1021,7 +1028,7 @@ static void *ldbm_config_serial_lock_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_fat_lock; + return (void *) ((uintptr_t)li->li_fat_lock); } static int ldbm_config_serial_lock_set(void *arg, void *value, char *errorbuf, @@ -1030,7 +1037,7 @@ static int ldbm_config_serial_lock_set(void *arg, void *value, char *errorbuf, struct ldbminfo *li = (struct ldbminfo *) arg; if (apply) { - li->li_fat_lock = (int) value; + li->li_fat_lock = (int) ((uintptr_t)value); } return LDAP_SUCCESS; @@ -1040,7 +1047,7 @@ static void *ldbm_config_legacy_errcode_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_legacy_errcode; + return (void *) ((uintptr_t)li->li_legacy_errcode); } static int ldbm_config_legacy_errcode_set(void *arg, void *value, char *errorbuf, @@ -1049,7 +1056,7 @@ static int ldbm_config_legacy_errcode_set(void *arg, void *value, char *errorbuf struct ldbminfo *li = (struct ldbminfo *) arg; if (apply) { - li->li_legacy_errcode = (int) value; + li->li_legacy_errcode = (int) ((uintptr_t)value); } return LDAP_SUCCESS; @@ -1099,7 +1106,7 @@ static void *ldbm_config_get_bypass_filter_test(void *arg) static int ldbm_config_set_use_vlv_index(void *arg, void *value, char *errorbuf, int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { if (val) { @@ -1115,7 +1122,7 @@ static void *ldbm_config_get_use_vlv_index(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_use_vlv; + return (void *) ((uintptr_t)li->li_use_vlv); } static int @@ -1174,7 +1181,7 @@ static void *ldbm_config_db_tx_max_get(void *arg) { struct ldbminfo *li = (struct ldbminfo *) arg; - return (void *) li->li_dblayer_private->dblayer_tx_max; + return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_tx_max); } static int ldbm_config_db_tx_max_set( @@ -1187,7 +1194,7 @@ static int ldbm_config_db_tx_max_set( { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; - int val = (int) value; + int val = (int) ((uintptr_t)value); if (apply) { li->li_dblayer_private->dblayer_tx_max = val; @@ -1409,17 +1416,17 @@ void ldbm_config_get(void *arg, config_info *config, char *buf) switch(config->config_type) { case CONFIG_TYPE_INT: - sprintf(buf, "%d", (int) config->config_get_fn(arg)); + sprintf(buf, "%d", (int) ((uintptr_t)config->config_get_fn(arg))); break; case CONFIG_TYPE_INT_OCTAL: - sprintf(buf, "%o", (int) config->config_get_fn(arg)); + sprintf(buf, "%o", (int) ((uintptr_t)config->config_get_fn(arg))); break; case CONFIG_TYPE_LONG: sprintf(buf, "%ld", (long) config->config_get_fn(arg)); break; case CONFIG_TYPE_SIZE_T: val = (size_t) config->config_get_fn(arg); - sprintf(buf, "%lu", val); + sprintf(buf, "%" PRIuPTR, val); break; case CONFIG_TYPE_STRING: /* Remember the get function for strings returns memory @@ -1429,7 +1436,7 @@ void ldbm_config_get(void *arg, config_info *config, char *buf) slapi_ch_free((void **)&tmp_string); break; case CONFIG_TYPE_ONOFF: - if ((int) config->config_get_fn(arg)) { + if ((int) ((uintptr_t)config->config_get_fn(arg))) { sprintf(buf, "on"); } else { sprintf(buf, "off"); @@ -1578,7 +1585,7 @@ int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struc } /* convert 64 bit value to 32 bit value */ LL_L2I(int_val, llval); - retval = config->config_set_fn(arg, (void *) int_val, err_buf, phase, apply_mod); + retval = config->config_set_fn(arg, (void *) ((uintptr_t)int_val), err_buf, phase, apply_mod); break; case CONFIG_TYPE_INT_OCTAL: if (use_default) { @@ -1586,7 +1593,7 @@ int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struc } else { int_val = (int) strtol((char *)bval->bv_val, NULL, 8); } - retval = config->config_set_fn(arg, (void *) int_val, err_buf, phase, apply_mod); + retval = config->config_set_fn(arg, (void *) ((uintptr_t)int_val), err_buf, phase, apply_mod); break; case CONFIG_TYPE_LONG: if (use_default) { @@ -1657,7 +1664,7 @@ int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struc } else { int_val = !strcasecmp((char *) bval->bv_val, "on"); } - retval = config->config_set_fn(arg, (void *) int_val, err_buf, phase, apply_mod); + retval = config->config_set_fn(arg, (void *) ((uintptr_t)int_val), err_buf, phase, apply_mod); break; } diff --git a/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c b/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c index 51d71a356..56889e5d2 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c @@ -136,7 +136,7 @@ ldbm_instance_config_readonly_get(void *arg) { ldbm_instance *inst = (ldbm_instance *)arg; - return (void *)inst->inst_be->be_readonly; + return (void *)((uintptr_t)inst->inst_be->be_readonly); } static void * @@ -165,7 +165,7 @@ ldbm_instance_config_require_index_get(void *arg) { ldbm_instance *inst = (ldbm_instance *)arg; - return (void *)inst->require_index; + return (void *)((uintptr_t)inst->require_index); } static int @@ -219,6 +219,7 @@ static int ldbm_instance_config_readonly_set(void *arg, void *value, char *errorbuf, int phase, int apply) { ldbm_instance *inst = (ldbm_instance *)arg; + uintptr_t pval = (uintptr_t)value; if (!apply) { return LDAP_SUCCESS; @@ -229,15 +230,15 @@ ldbm_instance_config_readonly_set(void *arg, void *value, char *errorbuf, int ph * but won't change them until the instance is un-busy again. */ if (! (inst->inst_flags & INST_FLAG_BUSY)) { - slapi_mtn_be_set_readonly(inst->inst_be, (int)value); + slapi_mtn_be_set_readonly(inst->inst_be, (int)pval); } - if ((int)value) { + if ((int)pval) { inst->inst_flags |= INST_FLAG_READONLY; } else { inst->inst_flags &= ~INST_FLAG_READONLY; } } else { - slapi_be_set_readonly(inst->inst_be, (int)value); + slapi_be_set_readonly(inst->inst_be, (int)pval); } return LDAP_SUCCESS; @@ -252,7 +253,7 @@ ldbm_instance_config_require_index_set(void *arg, void *value, char *errorbuf, i return LDAP_SUCCESS; } - inst->require_index = (int)value; + inst->require_index = (int)((uintptr_t)value); return LDAP_SUCCESS; } diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modify.c b/ldap/servers/slapd/back-ldbm/ldbm_modify.c index 36e842306..ee433970c 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_modify.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_modify.c @@ -578,10 +578,10 @@ mods_have_effect (Slapi_Entry *entry, Slapi_Mods *smods) */ for ( j = 0; j < smods->num_mods - 1; j++ ) { if ( (mod = smods->mods[j]) != NULL ) { - if ( (mod->mod_op & LDAP_MOD_REPLACE) == 0 || - mod->mod_vals.modv_bvals && - strcasecmp (mod->mod_type, "modifiersname") && - strcasecmp (mod->mod_type, "modifytime") ) { + if ( ((mod->mod_op & LDAP_MOD_REPLACE) == 0) || + (mod->mod_vals.modv_bvals && + strcasecmp (mod->mod_type, "modifiersname") && + strcasecmp (mod->mod_type, "modifytime") ) ) { goto done; } } @@ -589,9 +589,9 @@ mods_have_effect (Slapi_Entry *entry, Slapi_Mods *smods) if ( entry && entry->e_sdn.dn ) { for ( j = 0; j < smods->num_mods - 1; j++ ) { - if ( (mod = smods->mods[j]) != NULL && - strcasecmp (mod->mod_type, "modifiersname") && - strcasecmp (mod->mod_type, "modifytime") ) { + if ( ((mod = smods->mods[j]) != NULL) && + strcasecmp (mod->mod_type, "modifiersname") && + strcasecmp (mod->mod_type, "modifytime") ) { for ( attr = entry->e_attrs; attr; attr = attr->a_next ) { /* Mods have effect if at least a null-value-mod is * to actually remove an existing attribute diff --git a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c index e4f82b2f1..2cf91f3ad 100644 --- a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c +++ b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c @@ -47,6 +47,13 @@ * code for db2index (is this still in use?) */ +/* Required to get portable printf/scanf format macros */ +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#else +#error Need to define portable format macros such as PRIu64 +#endif /* HAVE_INTTYPES_H */ + #include "back-ldbm.h" #include "vlv_srch.h" #include "dblayer.h" @@ -76,7 +83,7 @@ size_t import_get_index_buffer_size() { static PRIntn import_subcount_hash_compare_keys(const void *v1, const void *v2) { - return( ((ID)v1 == (ID)v2 ) ? 1 : 0); + return( ((ID)((uintptr_t)v1) == (ID)((uintptr_t)v2) ) ? 1 : 0); } static PRIntn import_subcount_hash_compare_values(const void *v1, const void *v2) @@ -86,7 +93,7 @@ static PRIntn import_subcount_hash_compare_values(const void *v1, const void *v2 static PLHashNumber import_subcount_hash_fn(const void *id) { - return (PLHashNumber) id; + return (PLHashNumber) ((uintptr_t)id); } void import_subcount_stuff_init(import_subcount_stuff *stuff) @@ -263,7 +270,7 @@ int import_subcount_mother_init(import_subcount_stuff *mothers, ID parent_id, size_t count) { PR_ASSERT(NULL == PL_HashTableLookup(mothers->hashtable,(void*)parent_id)); - PL_HashTableAdd(mothers->hashtable,(void*)parent_id,(void*)count); + PL_HashTableAdd(mothers->hashtable,(void*)((uintptr_t)parent_id),(void*)count); return 0; } @@ -276,7 +283,7 @@ static int import_subcount_mothers_lookup(import_subcount_stuff *mothers, *count = 0; /* Lookup hash table for ID */ stored_count = (size_t)PL_HashTableLookup(mothers->hashtable, - (void*)parent_id); + (void*)((uintptr_t)parent_id)); /* If present, return the count found */ if (0 != stored_count) { *count = stored_count; @@ -292,11 +299,11 @@ int import_subcount_mother_count(import_subcount_stuff *mothers, ID parent_id) /* Lookup the hash table for the target ID */ stored_count = (size_t)PL_HashTableLookup(mothers->hashtable, - (void*)parent_id); + (void*)((uintptr_t)parent_id)); PR_ASSERT(0 != stored_count); /* Increment the count */ stored_count++; - PL_HashTableAdd(mothers->hashtable, (void*)parent_id, (void*)stored_count); + PL_HashTableAdd(mothers->hashtable, (void*)((uintptr_t)parent_id), (void*)stored_count); return 0; } @@ -320,7 +327,7 @@ static int import_update_entry_subcount(backend *be, ID parentid, * let's do it so we can reuse the modify routines) */ cache_lock_entry( &inst->inst_cache, e ); modify_init(&mc,e); - sprintf(value_buffer,"%lu",sub_count); + sprintf(value_buffer,"%" PRIuPTR,sub_count); /* attr numsubordinates could already exist in the entry, let's check whether it's already there or not */ isreplace = (attrlist_find(e->ep_entry->e_attrs, numsubordinates) != NULL); @@ -761,12 +768,12 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb ) int appendmode = 0; int appendmode_1 = 0; int noversion = 0; - ID lastid; + ID lastid = 0; int task_flags; Slapi_Task *task; int run_from_cmdline = 0; char *instance_name; - ldbm_instance *inst; + ldbm_instance *inst = NULL; int str2entry_options= 0; int retry; int we_start_the_backends = 0; @@ -1812,7 +1819,6 @@ err_out: dbc->c_close(dbc); } if (return_value < 0) {/* error case: undo vlv indexing */ - struct vlvIndex *vlvip = NULL; /* if jumped to out due to an error, vlv lock has not been released */ for ( vlvidx = 0; vlvidx < numvlv; vlvidx++ ) { vlvIndex_go_offline(pvlv[vlvidx], be); diff --git a/ldap/servers/slapd/back-ldbm/monitor.c b/ldap/servers/slapd/back-ldbm/monitor.c index 17d8ac039..8282d0d3a 100644 --- a/ldap/servers/slapd/back-ldbm/monitor.c +++ b/ldap/servers/slapd/back-ldbm/monitor.c @@ -42,6 +42,13 @@ /* monitor.c - ldbm backend monitor function */ +/* Required to get portable printf/scanf format macros */ +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#else +#error Need to define portable format macros such as PRIu64 +#endif /* HAVE_INTTYPES_H */ + #include "back-ldbm.h" #include "dblayer.h" /* XXXmcs: not sure this is good to do... */ #include <sys/stat.h> @@ -117,9 +124,9 @@ int ldbm_back_monitor_instance_search(Slapi_PBlock *pb, Slapi_Entry *e, MSET("entryCacheTries"); sprintf(buf, "%lu", (unsigned long)(100.0*(double)hits / (double)(tries > 0 ? tries : 1))); MSET("entryCacheHitRatio"); - sprintf(buf, "%lu", size); + sprintf(buf, "%" PRIuPTR, size); MSET("currentEntryCacheSize"); - sprintf(buf, "%lu", maxsize); + sprintf(buf, "%" PRIuPTR, maxsize); MSET("maxEntryCacheSize"); sprintf(buf, "%ld", nentries); MSET("currentEntryCacheCount"); diff --git a/ldap/servers/slapd/back-ldbm/parents.c b/ldap/servers/slapd/back-ldbm/parents.c index 7e4702416..5fb2fc1f4 100644 --- a/ldap/servers/slapd/back-ldbm/parents.c +++ b/ldap/servers/slapd/back-ldbm/parents.c @@ -44,6 +44,13 @@ #include "back-ldbm.h" +/* Required to get portable printf/scanf format macros */ +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#else +#error Need to define portable format macros such as PRIu64 +#endif /* HAVE_INTTYPES_H */ + char *numsubordinates = "numsubordinates"; char *hassubordinates = "hassubordinates"; @@ -130,7 +137,7 @@ int parent_update_on_childchange(modify_context *mc,int op, size_t *new_sub_coun else { char value_buffer[20]; /* enough digits for 2^64 children */ - sprintf(value_buffer,"%lu", current_sub_count); + sprintf(value_buffer,"%" PRIuPTR, current_sub_count); slapi_mods_add(smods, mod_op | LDAP_MOD_BVALUES, numsubordinates, strlen(value_buffer), value_buffer); } ret = modify_apply_mods(mc,smods); /* smods passed in */ diff --git a/ldap/servers/slapd/back-ldbm/perfctrs.c b/ldap/servers/slapd/back-ldbm/perfctrs.c index 458084c72..c6affe360 100644 --- a/ldap/servers/slapd/back-ldbm/perfctrs.c +++ b/ldap/servers/slapd/back-ldbm/perfctrs.c @@ -296,7 +296,7 @@ void perfctrs_update(perfctrs_private *priv, DB_ENV *db_env) return; } /* Call libdb to get the various stats */ - if (NULL != db_env->lg_handle) + if (DB_USES_LOGGING(db_env)) { DB_LOG_STAT *logstat = NULL; ret = LOG_STAT(db_env,&logstat,0,malloc); @@ -307,7 +307,7 @@ void perfctrs_update(perfctrs_private *priv, DB_ENV *db_env) } free(logstat); } - if (NULL != db_env->tx_handle) + if (DB_USES_TRANSACTIONS(db_env)) { DB_TXN_STAT *txnstat = NULL; ret = TXN_STAT(db_env, &txnstat, 0, malloc); @@ -320,7 +320,7 @@ void perfctrs_update(perfctrs_private *priv, DB_ENV *db_env) if (txnstat) free(txnstat); } - if (NULL != db_env->lk_handle) + if (DB_USES_LOCKING(db_env)) { DB_LOCK_STAT *lockstat = NULL; ret = LOCK_STAT(db_env,&lockstat,0,malloc); @@ -338,7 +338,7 @@ void perfctrs_update(perfctrs_private *priv, DB_ENV *db_env) } free(lockstat); } - if (NULL != db_env->mp_handle) + if (DB_USES_MPOOL(db_env)) { DB_MPOOL_STAT *mpstat = NULL; ret = MEMP_STAT(db_env,&mpstat,NULL,0,malloc); diff --git a/ldap/servers/slapd/bind.c b/ldap/servers/slapd/bind.c index 0e9409039..72c845309 100644 --- a/ldap/servers/slapd/bind.c +++ b/ldap/servers/slapd/bind.c @@ -103,7 +103,7 @@ is_root_dn_pw( const char *dn, const Slapi_Value *cred ) rv = slapi_pw_find_sv( rdnpwvals, cred ) == 0; value_done(&rdnpwbv); } - slapi_ch_free( (void **) &rootpw ); + slapi_ch_free_string( &rootpw ); return rv; } @@ -787,6 +787,6 @@ slapi_add_auth_response_control( Slapi_PBlock *pb, const char *binddn ) } if ( NULL != dnbuf_dynamic ) { - slapi_ch_free( (void **)&dnbuf_dynamic ); + slapi_ch_free_string( &dnbuf_dynamic ); } } diff --git a/ldap/servers/slapd/config.c b/ldap/servers/slapd/config.c index fe62e9b12..8c0c67ebf 100644 --- a/ldap/servers/slapd/config.c +++ b/ldap/servers/slapd/config.c @@ -566,11 +566,11 @@ slapd_bootstrap_config(const char *configdir) } } - slapi_ch_free((void **)&buf); + slapi_ch_free_string(&buf); } bail: - slapi_ch_free((void **)&buf); + slapi_ch_free_string(&buf); return rc; } diff --git a/ldap/servers/slapd/configdse.c b/ldap/servers/slapd/configdse.c index d8151a3cc..317c78dba 100644 --- a/ldap/servers/slapd/configdse.c +++ b/ldap/servers/slapd/configdse.c @@ -102,7 +102,7 @@ isASyntaxOrMrPluginOrPss(Slapi_Entry *e) retval = (ptype && !strcasecmp(ptype, "pwdstoragescheme")); if (!retval) retval = (ptype && !strcasecmp(ptype, "reverpwdstoragescheme")); - slapi_ch_free((void**)&ptype); + slapi_ch_free_string(&ptype); return retval; } @@ -178,7 +178,7 @@ read_config_dse (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int be = slapi_get_next_backend (cookie); } - slapi_ch_free ((void **)&cookie); + slapi_ch_free_string (&cookie); /* show be_type */ attrlist_delete( &e->e_attrs, "nsslapd-betype"); @@ -195,7 +195,7 @@ read_config_dse (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int be = slapi_get_next_backend(cookie); } - slapi_ch_free ( (void **) &cookie); + slapi_ch_free_string (&cookie); /* show private suffixes */ attrlist_delete ( &e->e_attrs, "nsslapd-privatenamespaces"); @@ -222,7 +222,7 @@ read_config_dse (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int be = slapi_get_next_backend(cookie); } - slapi_ch_free ((void **) &cookie); + slapi_ch_free_string (&cookie); /* show syntax plugins */ attrlist_delete ( &e->e_attrs, CONFIG_PLUGIN_ATTRIBUTE ); @@ -432,7 +432,7 @@ finish_and_return: /* if the password has been set, it will be hashed */ if ((pwd = config_get_rootpw()) != NULL) { slapi_entry_attr_set_charptr(e, CONFIG_ROOTPW_ATTRIBUTE, pwd); - slapi_ch_free((void**)&pwd); + slapi_ch_free_string(&pwd); } *returncode= rc; diff --git a/ldap/servers/slapd/conntable.c b/ldap/servers/slapd/conntable.c index ade877072..42cb7c6b3 100644 --- a/ldap/servers/slapd/conntable.c +++ b/ldap/servers/slapd/conntable.c @@ -438,7 +438,7 @@ connection_table_as_entry(Connection_Table *ct, Slapi_Entry *e) val.bv_len = strlen( bufptr ); attrlist_merge( &e->e_attrs, "connection", vals ); if (newbuf) { - slapi_ch_free((void **) &newbuf); + slapi_ch_free_string(&newbuf); } } PR_Unlock( ct->c[i].c_mutex ); diff --git a/ldap/servers/slapd/detach.c b/ldap/servers/slapd/detach.c index a547b50c5..dc8f9881c 100644 --- a/ldap/servers/slapd/detach.c +++ b/ldap/servers/slapd/detach.c @@ -127,7 +127,7 @@ detach( int slapd_exemode, int importexport_encrypt, } (void) chdir( errorlog ); config_set_workingdir(CONFIG_WORKINGDIR_ATTRIBUTE, errorlog, errorbuf, 1); - slapi_ch_free((void**)&errorlog); + slapi_ch_free_string(&errorlog); } } else { /* calling config_set_workingdir to check for validity of directory, don't apply */ @@ -135,7 +135,7 @@ detach( int slapd_exemode, int importexport_encrypt, exit(1); } (void) chdir( workingdir ); - slapi_ch_free((void**)&workingdir); + slapi_ch_free_string(&workingdir); } if ( (sd = open( "/dev/null", O_RDWR )) == -1 ) { diff --git a/ldap/servers/slapd/dse.c b/ldap/servers/slapd/dse.c index 49f12000f..03630a3dc 100644 --- a/ldap/servers/slapd/dse.c +++ b/ldap/servers/slapd/dse.c @@ -72,6 +72,13 @@ #include <pwd.h> #endif /* _WIN32 */ +/* Required to get portable printf/scanf format macros */ +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#else +#error Need to define portable format macros such as PRIu64 +#endif /* HAVE_INTTYPES_H */ + /* #define SLAPI_DSE_DEBUG */ /* define this to force trace log */ /* messages to always be logged */ @@ -463,6 +470,8 @@ dse_destroy(struct dse *pdse) slapi_ch_free((void **)&pdse); LDAPDebug( SLAPI_DSE_TRACELEVEL, "Removed [%d] entries from the dse tree.\n", nentries,0,0 ); + + return 0; /* no one checks this return value */ } /* @@ -603,7 +612,7 @@ dse_updateNumSubordinates(Slapi_Entry *entry, int op) struct berval val; vals[0] = &val; vals[1] = NULL; - sprintf(value_buffer,"%lu",current_sub_count); + sprintf(value_buffer,"%" PRIuPTR,current_sub_count); val.bv_val = value_buffer; val.bv_len = strlen (val.bv_val); switch(mod_op) diff --git a/ldap/servers/slapd/filter.c b/ldap/servers/slapd/filter.c index 9e0b1f0eb..867b37fde 100644 --- a/ldap/servers/slapd/filter.c +++ b/ldap/servers/slapd/filter.c @@ -1280,7 +1280,7 @@ slapi_filter_to_string_internal( const struct slapi_filter *f, char *buf, size_t if(1 < *bufsize) { sprintf( buf, ")" ); - *bufsize--; + (*bufsize)--; } } break; @@ -1313,7 +1313,7 @@ slapi_filter_to_string_internal( const struct slapi_filter *f, char *buf, size_t if(1 < *bufsize) { sprintf( buf, ")" ); - *bufsize--; + (*bufsize)--; } } break; diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c index eef97ecd1..6b8968356 100644 --- a/ldap/servers/slapd/libglobs.c +++ b/ldap/servers/slapd/libglobs.c @@ -5066,6 +5066,8 @@ config_set_value( { struct berval **values = 0; char *sval = 0; + int ival = 0; + uintptr_t pval; /* for null values, just set the attr value to the empty string */ @@ -5125,7 +5127,9 @@ config_set_value( case CONFIG_CONSTANT_INT: PR_ASSERT(value); /* should be a constant value */ - slapi_entry_attr_set_int(e, cgas->attr_name, (int)value); + pval = (uintptr_t)value; + ival = (int)pval; + slapi_entry_attr_set_int(e, cgas->attr_name, ival); break; case CONFIG_SPECIAL_SSLCLIENTAUTH: diff --git a/ldap/servers/slapd/log.c b/ldap/servers/slapd/log.c index ac055e080..26d583696 100644 --- a/ldap/servers/slapd/log.c +++ b/ldap/servers/slapd/log.c @@ -2216,12 +2216,12 @@ log__needrotation(LOGFD fp, int logtype) { time_t curr_time; time_t log_createtime= 0; - time_t syncclock; + time_t syncclock = 0; int type = LOG_CONTINUE; int f_size = 0; int maxlogsize, nlogs; int rotationtime_secs = -1; - int sync_enabled, timeunit; + int sync_enabled = 0, timeunit = 0; if (fp == NULL) { return LOG_ROTATE; diff --git a/ldap/servers/slapd/log.h b/ldap/servers/slapd/log.h index dddc4875f..8fea00bdc 100644 --- a/ldap/servers/slapd/log.h +++ b/ldap/servers/slapd/log.h @@ -49,9 +49,13 @@ *************************************************************************/ #include <stdio.h> #ifdef LINUX +#ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE /* glibc2 needs this */ +#endif +#ifndef __USE_XOPEN #define __USE_XOPEN #endif +#endif #include <time.h> #include <stdarg.h> #include <sys/types.h> diff --git a/ldap/servers/slapd/main.c b/ldap/servers/slapd/main.c index f4e44f488..61ead86f0 100644 --- a/ldap/servers/slapd/main.c +++ b/ldap/servers/slapd/main.c @@ -261,7 +261,6 @@ static void fix_ownership() { struct passwd* pw=NULL; - char dirname[MAXPATHLEN + 1]; slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); @@ -630,7 +629,6 @@ main( int argc, char **argv) slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); daemon_ports_t ports_info = {0}; Slapi_Backend *be = NULL; - int init_ssl; #ifndef __LP64__ #if defined(__hpux) && !defined(__ia64) /* for static constructors */ @@ -2598,7 +2596,6 @@ slapd_exemode_dbverify() int return_value = 0; Slapi_PBlock pb; struct slapdplugin *backend_plugin; - slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); /* this should be the first time to be called! if the init order * is ever changed, these lines should be changed (or erased)! diff --git a/ldap/servers/slapd/mapping_tree.c b/ldap/servers/slapd/mapping_tree.c index 5087c373e..12e803ea4 100644 --- a/ldap/servers/slapd/mapping_tree.c +++ b/ldap/servers/slapd/mapping_tree.c @@ -1998,7 +1998,7 @@ int slapi_mapping_tree_select(Slapi_PBlock *pb, Slapi_Backend **be, Slapi_Entry * will be transferred to the internal DSE backend */ if( sdn_is_nulldn(target_sdn) && - ((op_type == SLAPI_OPERATION_SEARCH) && (scope == LDAP_SCOPE_BASE) || + (((op_type == SLAPI_OPERATION_SEARCH) && (scope == LDAP_SCOPE_BASE)) || (op_type != SLAPI_OPERATION_SEARCH)) ) { mtn_unlock(); diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c index 4d3b13b5e..42bf77e0c 100644 --- a/ldap/servers/slapd/pblock.c +++ b/ldap/servers/slapd/pblock.c @@ -2873,7 +2873,7 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) case SLAPI_LDIF2DB_ENCRYPT: case SLAPI_DB2LDIF_DECRYPT: - pblock->pb_ldif_encrypt = (int)value; + pblock->pb_ldif_encrypt = *((int *)value); break; default: diff --git a/ldap/servers/slapd/saslbind.c b/ldap/servers/slapd/saslbind.c index a5a0692d4..eabdd0422 100644 --- a/ldap/servers/slapd/saslbind.c +++ b/ldap/servers/slapd/saslbind.c @@ -297,7 +297,6 @@ static Slapi_Entry *ids_sasl_user_to_entry( int attrsonly = 0, scope = LDAP_SCOPE_SUBTREE; LDAPControl **ctrls = NULL; Slapi_Entry *entry = NULL; - Slapi_DN *sdn; char **attrs = NULL; int regexmatch = 0; char *base = NULL; diff --git a/ldap/servers/slapd/snmp_collator.c b/ldap/servers/slapd/snmp_collator.c index 1f4d189f6..3827d3046 100644 --- a/ldap/servers/slapd/snmp_collator.c +++ b/ldap/servers/slapd/snmp_collator.c @@ -399,7 +399,6 @@ int snmp_collator_start() int err; char *statspath = config_get_rundir(); - char *lp = NULL; char *instdir = config_get_configdir(); char *instname = NULL; diff --git a/ldap/servers/slapd/statechange.h b/ldap/servers/slapd/statechange.h index c3946ee59..30438afb7 100644 --- a/ldap/servers/slapd/statechange.h +++ b/ldap/servers/slapd/statechange.h @@ -78,7 +78,9 @@ typedef void (*api_statechange_unregister_all)(char *caller_id, caller_data_free #define STATECHANGE_VATTR_ENTRY_INVALIDATE 2 /* Vattr api caller data to be passed to statechange_register() */ +#ifdef DEFINE_STATECHANGE_STATICS static int vattr_global_invalidate = STATECHANGE_VATTR_GLOBAL_INVALIDATE; -static int vattr_entry_invalidate = STATECHANGE_VATTR_ENTRY_INVALIDATE; +/* static int vattr_entry_invalidate = STATECHANGE_VATTR_ENTRY_INVALIDATE; */ +#endif /* DEFINE_STATECHANGE_STATICS */ #endif /*_STATE_NOTIFY_H_*/ diff --git a/ldap/servers/slapd/task.c b/ldap/servers/slapd/task.c index 67c93c165..3324dea2a 100644 --- a/ldap/servers/slapd/task.c +++ b/ldap/servers/slapd/task.c @@ -193,6 +193,8 @@ int slapi_task_get_state(Slapi_Task *task) if (task) { return task->task_state; } + + return 0; /* return value not currently used */ } /* this changes the 'nsTaskStatus' value, which is transient (anything logged @@ -341,6 +343,8 @@ void * slapi_task_get_data(Slapi_Task *task) if (task) { return task->task_private; } + + return NULL; /* return value not currently used */ } /* @@ -371,6 +375,8 @@ int slapi_task_get_refcount(Slapi_Task *task) if (task) { return task->task_refcount; } + + return 0; /* return value not currently used */ } /* name is, for example, "import" */ diff --git a/ldap/servers/slapd/tools/ldclt/ldapfct.c b/ldap/servers/slapd/tools/ldclt/ldapfct.c index 330377346..b2e1f7645 100644 --- a/ldap/servers/slapd/tools/ldclt/ldapfct.c +++ b/ldap/servers/slapd/tools/ldclt/ldapfct.c @@ -671,9 +671,9 @@ connectToServer ( */ tttctx->ldapCtx = ldapssl_init(mctx.hostname, mctx.port, 1); if (mctx.mode & VERY_VERBOSE) - printf ("ldclt[%d]: T%03d: After ldapssl_init (%s, %d), ldapCtx=0x%08x\n", + printf ("ldclt[%d]: T%03d: After ldapssl_init (%s, %d), ldapCtx=0x%p\n", mctx.pid, tttctx->thrdNum, mctx.hostname, mctx.port, - (unsigned int)tttctx->ldapCtx); + tttctx->ldapCtx); if (tttctx->ldapCtx == NULL) { printf ("ldclt[%d]: T%03d: Cannot ldapssl_init (%s, %d), errno=%d\n", @@ -689,14 +689,14 @@ connectToServer ( ret = ldapssl_enable_clientauth(tttctx->ldapCtx, "", mctx.keydbpin, mctx.cltcertname); if (mctx.mode & VERY_VERBOSE) printf - ("ldclt[%d]: T%03d: After ldapssl_enable_clientauth (ldapCtx=0x%08x, %s, %s)", - mctx.pid, tttctx->thrdNum, (unsigned int)tttctx->ldapCtx, mctx.keydbpin, + ("ldclt[%d]: T%03d: After ldapssl_enable_clientauth (ldapCtx=0x%p, %s, %s)", + mctx.pid, tttctx->thrdNum, tttctx->ldapCtx, mctx.keydbpin, mctx.cltcertname); if (ret < 0) { printf - ("ldclt[%d]: T%03d: Cannot ldapssl_enable_clientauth (ldapCtx=0x%08x, %s, %s)", - mctx.pid, tttctx->thrdNum, (unsigned int)tttctx->ldapCtx, mctx.keydbpin, + ("ldclt[%d]: T%03d: Cannot ldapssl_enable_clientauth (ldapCtx=0x%p, %s, %s)", + mctx.pid, tttctx->thrdNum, tttctx->ldapCtx, mctx.keydbpin, mctx.cltcertname); ldap_perror(tttctx->ldapCtx, "ldapssl_enable_clientauth"); fflush (stdout); @@ -709,9 +709,9 @@ connectToServer ( */ tttctx->ldapCtx = ldap_init (mctx.hostname, mctx.port); if (mctx.mode & VERY_VERBOSE) - printf ("ldclt[%d]: T%03d: After ldap_init (%s, %d), ldapCtx=0x%08x\n", + printf ("ldclt[%d]: T%03d: After ldap_init (%s, %d), ldapCtx=0x%p\n", mctx.pid, tttctx->thrdNum, mctx.hostname, mctx.port, - (unsigned int)tttctx->ldapCtx); + tttctx->ldapCtx); if (tttctx->ldapCtx == NULL) { printf ("ldclt[%d]: T%03d: Cannot ldap_init (%s, %d), errno=%d\n", @@ -805,7 +805,6 @@ connectToServer ( } else if ((mctx.mod2 & M2_SASLAUTH) && ((!(tttctx->binded)) || (mctx.mode & BIND_EACH_OPER))) { void *defaults; - LDAPControl **rctrls = NULL; char *my_saslauthid = NULL; if ( mctx.sasl_mech == NULL) { @@ -1836,9 +1835,9 @@ createMissingNodes ( */ tttctx->ldapCtx = ldapssl_init(mctx.hostname, mctx.port, 1); if (mctx.mode & VERY_VERBOSE) - printf ("ldclt[%d]: T%03d: After ldapssl_init (%s, %d), ldapCtx=0x%08x\n", + printf ("ldclt[%d]: T%03d: After ldapssl_init (%s, %d), ldapCtx=0x%p\n", mctx.pid, tttctx->thrdNum, mctx.hostname, mctx.port, - (unsigned int)tttctx->ldapCtx); + tttctx->ldapCtx); if (tttctx->ldapCtx == NULL) { printf ("ldclt[%d]: T%03d: Cannot ldapssl_init (%s, %d), errno=%d\n", @@ -1854,14 +1853,14 @@ createMissingNodes ( ret = ldapssl_enable_clientauth(tttctx->ldapCtx, "", mctx.keydbpin, mctx.cltcertname); if (mctx.mode & VERY_VERBOSE) printf - ("ldclt[%d]: T%03d: After ldapssl_enable_clientauth (ldapCtx=0x%08x, %s, %s)", - mctx.pid, tttctx->thrdNum, (unsigned int)tttctx->ldapCtx, mctx.keydbpin, + ("ldclt[%d]: T%03d: After ldapssl_enable_clientauth (ldapCtx=0x%p, %s, %s)", + mctx.pid, tttctx->thrdNum, tttctx->ldapCtx, mctx.keydbpin, mctx.cltcertname); if (ret < 0) { printf - ("ldclt[%d]: T%03d: Cannot ldapssl_enable_clientauth (ldapCtx=0x%08x, %s, %s)", - mctx.pid, tttctx->thrdNum, (unsigned int)tttctx->ldapCtx, mctx.keydbpin, + ("ldclt[%d]: T%03d: Cannot ldapssl_enable_clientauth (ldapCtx=0x%p, %s, %s)", + mctx.pid, tttctx->thrdNum, tttctx->ldapCtx, mctx.keydbpin, mctx.cltcertname); fflush (stdout); return (-1); diff --git a/ldap/servers/slapd/tools/ldclt/scalab01.c b/ldap/servers/slapd/tools/ldclt/scalab01.c index 2228a8529..3dc2bda86 100644 --- a/ldap/servers/slapd/tools/ldclt/scalab01.c +++ b/ldap/servers/slapd/tools/ldclt/scalab01.c @@ -524,8 +524,8 @@ scalab01_connectSuperuser (void) */ s1ctx.ldapCtx = ldapssl_init(mctx.hostname, mctx.port, 1); if (mctx.mode & VERY_VERBOSE) - printf ("ldclt[%d]: ctrl: ldapssl_init (%s, %d), ldapCtx=0x%08x\n", - mctx.pid, mctx.hostname, mctx.port, (unsigned int)s1ctx.ldapCtx); + printf ("ldclt[%d]: ctrl: ldapssl_init (%s, %d), ldapCtx=0x%p\n", + mctx.pid, mctx.hostname, mctx.port, s1ctx.ldapCtx); if (s1ctx.ldapCtx == NULL) { printf ("ldclt[%d]: ctrl: Cannot ldapssl_init (%s, %d), errno=%d\n", @@ -541,13 +541,13 @@ scalab01_connectSuperuser (void) ret = ldapssl_enable_clientauth(s1ctx.ldapCtx, "", mctx.keydbpin, mctx.cltcertname); if (mctx.mode & VERY_VERBOSE) printf - ("ldclt[%d]: ctrl: After ldapssl_enable_clientauth (ldapCtx=0x%08x, %s, %s)", - mctx.pid, (unsigned int)s1ctx.ldapCtx, mctx.keydbpin, mctx.cltcertname); + ("ldclt[%d]: ctrl: After ldapssl_enable_clientauth (ldapCtx=0x%p, %s, %s)", + mctx.pid, s1ctx.ldapCtx, mctx.keydbpin, mctx.cltcertname); if (ret < 0) { printf - ("ldclt[%d]: ctrl: Cannot ldapssl_enable_clientauth (ldapCtx=0x%08x, %s, %s)", - mctx.pid, (unsigned int)s1ctx.ldapCtx, mctx.keydbpin, mctx.cltcertname); + ("ldclt[%d]: ctrl: Cannot ldapssl_enable_clientauth (ldapCtx=0x%p, %s, %s)", + mctx.pid, s1ctx.ldapCtx, mctx.keydbpin, mctx.cltcertname); ldap_perror(s1ctx.ldapCtx, "ldapssl_enable_clientauth"); fflush (stdout); return (-1); @@ -561,8 +561,8 @@ scalab01_connectSuperuser (void) */ s1ctx.ldapCtx = ldap_init (mctx.hostname, mctx.port); if (mctx.mode & VERY_VERBOSE) - printf ("ldclt[%d]: ctrl: After ldap_init (%s, %d), ldapCtx=0x%08x\n", - mctx.pid, mctx.hostname, mctx.port, (unsigned int)s1ctx.ldapCtx); + printf ("ldclt[%d]: ctrl: After ldap_init (%s, %d), ldapCtx=0x%p\n", + mctx.pid, mctx.hostname, mctx.port, s1ctx.ldapCtx); if (s1ctx.ldapCtx == NULL) { printf ("ldclt[%d]: ctrl: Cannot ldap_init (%s, %d), errno=%d\n", diff --git a/ldap/servers/slapd/tools/ldif.c b/ldap/servers/slapd/tools/ldif.c index 5e4e63e23..bf100539e 100644 --- a/ldap/servers/slapd/tools/ldif.c +++ b/ldap/servers/slapd/tools/ldif.c @@ -145,7 +145,7 @@ int main( int argc, char **argv ) perror( "realloc" ); return( 1 ); } - fgets(buf+curlen, maxlen/2 + 1, stdin); + (void)fgets(buf+curlen, maxlen/2 + 1, stdin); } /* we have a full line, chop potential newline and turn into ldif */ if( buf[curlen-1] == '\n' ) diff --git a/ldap/servers/slapd/tools/mmldif.c b/ldap/servers/slapd/tools/mmldif.c index 19b039b12..579605a91 100644 --- a/ldap/servers/slapd/tools/mmldif.c +++ b/ldap/servers/slapd/tools/mmldif.c @@ -816,7 +816,7 @@ readrec(edfFILE * edf1, attrib1_t ** attrib) lookahead = fgetc(edf1->fp); if (lookahead != ' ') break; - fgets(line, sizeof(line), edf1->fp); + (void)fgets(line, sizeof(line), edf1->fp); len = strlen(line); for (lptr = line+len-1; len; len--, lptr--) { if ((*lptr != '\n') && (*lptr != '\r')) @@ -854,7 +854,7 @@ readrec(edfFILE * edf1, attrib1_t ** attrib) lookahead = fgetc(edf1->fp); if (lookahead != ' ') break; - fgets(line, sizeof(line), edf1->fp); + (void)fgets(line, sizeof(line), edf1->fp); len = strlen(line); for (lptr = line+len-1; len; len--, lptr--) { if ((*lptr != '\n') && (*lptr != '\r')) diff --git a/ldap/servers/slapd/tools/pwenc.c b/ldap/servers/slapd/tools/pwenc.c index 16aa4fc41..d18622ebc 100644 --- a/ldap/servers/slapd/tools/pwenc.c +++ b/ldap/servers/slapd/tools/pwenc.c @@ -145,7 +145,7 @@ init_config(char *configdir) fprintf( stderr, "%s\n", errorbuf ); return( NULL ); } - slapi_ch_free((void **)&abs_configdir); + slapi_ch_free_string(&abs_configdir); slapdFrontendConfig = getFrontendConfig(); if (0 == slapd_config(slapdFrontendConfig->configdir, configfile)) { @@ -169,11 +169,9 @@ main( argc, argv ) struct pw_scheme *pwsp, *cmppwsp; extern int optind; char *cpwd = NULL; /* candidate password for comparison */ - char errorbuf[SLAPI_DSE_RETURNTEXT_SIZE]; slapdFrontendConfig_t *slapdFrontendConfig = NULL; char *opts = "Hs:c:D:"; - char *configdir = NULL; name = argv[ 0 ]; pwsp = cmppwsp = NULL; @@ -409,7 +407,7 @@ slapd_config(const char *configdir, const char *givenconfigfile) rc= 1; /* OK */ } - slapi_ch_free((void **)&buf); + slapi_ch_free_string(&buf); } return rc; diff --git a/ldap/servers/slapd/tools/rsearch/infadd.c b/ldap/servers/slapd/tools/rsearch/infadd.c index 0ee081655..607381a33 100644 --- a/ldap/servers/slapd/tools/rsearch/infadd.c +++ b/ldap/servers/slapd/tools/rsearch/infadd.c @@ -344,11 +344,12 @@ int main(int argc, char **argv) } if (lmtCount && ntotal >= lmtCount) { if (!quiet) { + tmpv = (double)ntotal*1000.0/(counter*sampleInterval); fprintf(stdout, "Total added records: %d, Average rate: %7.2f/thrd, " "%6.2f/sec = %6.4fmsec/op\n", ntotal, (double)ntotal/(double)numThreads, - (tmpv = (double)ntotal*1000.0/(counter*sampleInterval)), + tmpv, (double)1000.0/tmpv); } exit(1); diff --git a/ldap/servers/slapd/tools/rsearch/rsearch.c b/ldap/servers/slapd/tools/rsearch/rsearch.c index 313eed3dc..621a22e51 100644 --- a/ldap/servers/slapd/tools/rsearch/rsearch.c +++ b/ldap/servers/slapd/tools/rsearch/rsearch.c @@ -501,12 +501,12 @@ int main(int argc, char** argv) exit(0); } if (timeLimit && (lifeTime >= timeLimit)) { - double tmpv; + double tmpv = (val + sumVal)/counter; if (verbose) printf("%d sec >= %d\n", lifeTime, timeLimit); printf("Final Average rate: " "%6.2f/sec = %6.4fmsec/op, total:%6u\n", - (tmpv = (val + sumVal)/counter), + tmpv, (double)1000.0/tmpv, total); exit(0); diff --git a/ldap/servers/slapd/tools/rsearch/searchthread.c b/ldap/servers/slapd/tools/rsearch/searchthread.c index 484304393..1ef0b7a2e 100644 --- a/ldap/servers/slapd/tools/rsearch/searchthread.c +++ b/ldap/servers/slapd/tools/rsearch/searchthread.c @@ -501,7 +501,7 @@ void search_start(void *v) { SearchThread *st = (SearchThread *)v; PRIntervalTime timer; - int notBound = 1, res, searches = 0; + int notBound = 1, res = LDAP_SUCCESS, searches = 0; PRUint32 span; st->alive = 1; diff --git a/ldap/servers/slapd/uuid.c b/ldap/servers/slapd/uuid.c index 92e22f42d..43aa003f5 100644 --- a/ldap/servers/slapd/uuid.c +++ b/ldap/servers/slapd/uuid.c @@ -361,8 +361,8 @@ static int uuid_create_st(guid_t *uuid) /* uuid_create -- multithreaded generation */ static int uuid_create_mt(guid_t *uuid) { - uuid_time_t timestamp; - unsigned16 clock_seq; + uuid_time_t timestamp = 0; + unsigned16 clock_seq = 0; /* just bumps time sequence number. the actual time calls are made by a uuid_update_state */ diff --git a/ldap/servers/snmp/ldap-agent.h b/ldap/servers/snmp/ldap-agent.h index f6bddbd09..28f3cc2a9 100644 --- a/ldap/servers/snmp/ldap-agent.h +++ b/ldap/servers/snmp/ldap-agent.h @@ -47,7 +47,27 @@ extern "C" { #endif +/* net-snmp-config.h defines + all of these unconditionally - so we undefine + them here to make the compiler warnings shut up + hopefully we don't need the real versions + of these, but then with no warnings the compiler + will just silently redefine them to the wrong + ones anyway + Then undefine them after the include so that + our own local defines will take effect +*/ +#undef PACKAGE_BUGREPORT +#undef PACKAGE_NAME +#undef PACKAGE_STRING +#undef PACKAGE_TARNAME +#undef PACKAGE_VERSION #include <net-snmp/net-snmp-config.h> +#undef PACKAGE_BUGREPORT +#undef PACKAGE_NAME +#undef PACKAGE_STRING +#undef PACKAGE_TARNAME +#undef PACKAGE_VERSION #include <net-snmp/net-snmp-includes.h> #include <net-snmp/agent/net-snmp-agent-includes.h> #include <net-snmp/library/snmp_assert.h> diff --git a/lib/ldaputil/certmap.c b/lib/ldaputil/certmap.c index 57d1f9108..cea403b6d 100644 --- a/lib/ldaputil/certmap.c +++ b/lib/ldaputil/certmap.c @@ -55,6 +55,7 @@ #include <key.h> #include <cert.h> +#define DEFINE_LDAPU_STRINGS 1 #include <ldaputil/certmap.h> #include <ldaputil/ldapauth.h> #include <ldaputil/errors.h> @@ -300,7 +301,8 @@ static int ldapu_list_print (LDAPUList_t *list, LDAPUListNodeFn_t print_fn, int rv; while(node) { - rv = (int)(*print_fn)(node->info, pinfo); + uintptr_t retval = (uintptr_t)(*print_fn)(node->info, pinfo); + rv = (int)retval; if (rv != LDAPU_SUCCESS) return rv; node = node->next; } @@ -1691,6 +1693,7 @@ NSAPI_PUBLIC int ldapu_certinfo_save (const char *fname, char *ptr; int eof; int rv; + uintptr_t retval; LDAPUPrintInfo_t pinfo; #ifdef XP_WIN32 @@ -1730,7 +1733,8 @@ NSAPI_PUBLIC int ldapu_certinfo_save (const char *fname, pinfo.fp = tfp; pinfo.arg = default_certmap_info->issuerName; - rv = (int)ldapu_certinfo_print (default_certmap_info, &pinfo); + retval = (uintptr_t)ldapu_certinfo_print (default_certmap_info, &pinfo); + rv = (int)retval; if (rv != LDAPU_SUCCESS) { fclose(tfp); diff --git a/lib/ldaputil/ldapauth.c b/lib/ldaputil/ldapauth.c index 0039bae5a..b483e42fb 100644 --- a/lib/ldaputil/ldapauth.c +++ b/lib/ldaputil/ldapauth.c @@ -53,6 +53,7 @@ #include <ldap.h> #include <prprf.h> +#define DEFINE_LDAPU_STRINGS 1 #include <ldaputil/certmap.h> #include <ldaputil/errors.h> #include <ldaputil/ldapauth.h> diff --git a/lib/ldaputil/ldapdb.c b/lib/ldaputil/ldapdb.c index a126c1699..478b4f8c6 100644 --- a/lib/ldaputil/ldapdb.c +++ b/lib/ldaputil/ldapdb.c @@ -171,7 +171,10 @@ ldapu_gethostbyaddr( const char *addr, int length, int type, LDAPHostEnt *result, char *buffer, int buflen, int *statusp, void *extradata ) { + /* old code did this which was clearly wrong: return( (LDAPHostEnt *)PR_GetError() ); + which leads me to believe this is not used */ + return( NULL ); } #endif /* LDAP_OPT_DNS_FN_PTRS */ diff --git a/lib/libaccess/aclerror.cpp b/lib/libaccess/aclerror.cpp index 7c1d4a26b..8e94f6423 100644 --- a/lib/libaccess/aclerror.cpp +++ b/lib/libaccess/aclerror.cpp @@ -100,7 +100,7 @@ char * ACL_Program = "NSACL"; /* ACL facility name */ void aclErrorFmt(NSErr_t * errp, char * msgbuf, int maxlen, int maxdepth) { NSEFrame_t * efp; /* error frame pointer */ - int len; /* length of error message text */ + int len = 0; /* length of error message text */ int depth = 0; /* current depth */ msgbuf[0] = 0; diff --git a/lib/libaccess/acltools.cpp b/lib/libaccess/acltools.cpp index 9eb3292d6..1b302df4f 100644 --- a/lib/libaccess/acltools.cpp +++ b/lib/libaccess/acltools.cpp @@ -3060,7 +3060,7 @@ ACL_FileGetNameList(NSErr_t *errp, char * filename, char ***name_list) const int block_size = 50; int rv, list_size, list_index; - char ** local_list; + char ** local_list = NULL; char * block ; char * name; char * next; diff --git a/lib/libaccess/lasdns.cpp b/lib/libaccess/lasdns.cpp index 0b3d3dcfa..de7d2a945 100644 --- a/lib/libaccess/lasdns.cpp +++ b/lib/libaccess/lasdns.cpp @@ -140,7 +140,7 @@ LASDnsBuild(NSErr_t *errp, char *attr_pattern, LASDnsContext_t *context, int ali size_t delimiter; /* length of valid token */ char token[256]; /* max length dns name */ int i; - int ipcnt; + int ipcnt = 0; char **p; unsigned long *ipaddrs=0; pool_handle_t *pool; @@ -347,7 +347,7 @@ int LASDnsEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, int result; int aliasflg; char *my_dns; - LASDnsContext_t *context; + LASDnsContext_t *context = NULL; int rv; *cachable = ACL_INDEF_CACHABLE; diff --git a/lib/libaccess/lasip.cpp b/lib/libaccess/lasip.cpp index aa698de68..01c76aa66 100644 --- a/lib/libaccess/lasip.cpp +++ b/lib/libaccess/lasip.cpp @@ -340,7 +340,7 @@ LASIpAddPattern(NSErr_t *errp, int netmask, int pattern, LASIpTree_t **treetop) int stopbit; /* Don't care after this point */ int curbit; /* current bit we're working on */ int curval; /* value of pattern[curbit] */ - LASIpTree_t *curptr; /* pointer to the current node */ + LASIpTree_t *curptr = NULL; /* pointer to the current node */ LASIpTree_t *newptr; /* stop at the first 1 in the netmask from low to high */ @@ -448,7 +448,7 @@ int LASIpEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, IPAddr_t ip; int retcode; LASIpTree_t *node; - LASIpContext_t *context; + LASIpContext_t *context = NULL; int rv; char ip_str[124]; diff --git a/lib/libaccess/ldapacl.cpp b/lib/libaccess/ldapacl.cpp index 6be89b185..4b7fdc8bb 100644 --- a/lib/libaccess/ldapacl.cpp +++ b/lib/libaccess/ldapacl.cpp @@ -762,7 +762,7 @@ NSAPI_PUBLIC int acl_user_exists (const char *user, const char *userdn, PList_t resource = 0; PList_t auth_info = 0; PList_t global_auth = NULL; - int rv; + int rv = 0; /* Check if the userdn is available in the usr_cache */ if (acl_usr_cache_enabled() && userdn) { diff --git a/lib/libaccess/oneeval.cpp b/lib/libaccess/oneeval.cpp index a8f2b2486..05de0e36b 100644 --- a/lib/libaccess/oneeval.cpp +++ b/lib/libaccess/oneeval.cpp @@ -344,7 +344,7 @@ ACLEvalBuildContext( ACLHandle_t *acl; ACLExprHandle_t *ace; int ace_cnt = -1; - ACLAceEntry_t *acelast, *new_ace; + ACLAceEntry_t *acelast = NULL, *new_ace; ACLAceNumEntry_t *entry, *temp_entry; char **argp; ACLListCache_t *cache; @@ -635,7 +635,7 @@ ACL_INTEvalTestRights( int i, j, right_num, delta; ACLCachable_t ace_cachable; int result; - int absolute; + int absolute = 0; int skipflag; int g_num; /* index into the generic rights array. */ char **g_rights; diff --git a/lib/libsi18n/getstrmem.h b/lib/libsi18n/getstrmem.h index 12f58cafe..cbdcbd178 100644 --- a/lib/libsi18n/getstrmem.h +++ b/lib/libsi18n/getstrmem.h @@ -53,7 +53,6 @@ static char emptyString[] = ""; #define NUM_BUCKETS 32 /* must be a power of 2 */ /* strings in library libadmin */ -static char* libadminid[] = {"$DBT: libadmin in memory v1 $"}; static char* libadmin[] = { "", " Help ", @@ -89,7 +88,6 @@ static struct DATABIN bucket5[] = { {emptyString,NULL,0} }; /* strings in library userforms */ -static char* userformsid[] = {"$DBT: userforms in memory v1 $"}; static char* userforms[] = { "", "Error: could not open servers list file.<p>\n", @@ -113,7 +111,6 @@ static struct DATABIN bucket8[] = { {emptyString,NULL,0} }; /* strings in library libaccess */ -static char* libaccessid[] = {"$DBT: libaccess in memory v1 $"}; static char* libaccess[] = { "", "basic-ncsa", @@ -274,7 +271,6 @@ static struct DATABIN bucket10[] = { {emptyString,NULL,0} }; /* strings in library frame */ -static char* frameid[] = {"$DBT: frame in memory v1 $"}; static char* frame[] = { "", "<TITLE>Not Found</TITLE><H1>Not Found</H1> The requested object does not exist on this server. The link you followed is either outdated, inaccurate, or the server has been instructed not to let you have it. ", @@ -465,7 +461,6 @@ static struct DATABIN bucket17[] = { {emptyString,NULL,0} }; /* strings in library admserv */ -static char* admservid[] = {"$DBT: admserv in memory v1 $"}; static char* admserv[] = { "", "Unauthorized host", @@ -477,7 +472,6 @@ static char* admserv[] = { emptyString }; /* strings in library libir */ -static char* libirid[] = {"$DBT: libadmin in memory v1 $"}; static char* libir[] = { "", "An I/O error occurred before all form data could be read.", @@ -494,7 +488,6 @@ static struct DATABIN bucket19[] = { {emptyString,NULL,0} }; /* strings in library httpdaemon */ -static char* httpdaemonid[] = {"$DBT: httpdaemon in memory v1 $"}; static char* httpdaemon[] = { "", "Error in ConvertThreadToFiber", @@ -540,7 +533,6 @@ static struct DATABIN bucket20[] = { {emptyString,NULL,0} }; /* strings in library dsgw */ -static char* dsgwid[] = {"$DBT: dsgw in memory v1 $"}; static char* dsgw[] = { "", "Unknown HTTP request method", @@ -856,7 +848,6 @@ static struct DATABIN bucket26[] = { {emptyString,NULL,0} }; /* strings in library base */ -static char* baseid[] = {"$DBT: base in memory v1 $"}; static char* base[] = { "", "insufficient memory to create hash table", @@ -1072,7 +1063,6 @@ static struct DATABIN bucket27[] = { {emptyString,NULL,0} }; /* strings in library cgiadmin */ -static char* cgiadminid[] = {"$DBT: cgiadmin in memory v1 $"}; static char* cgiadmin[] = { "", "Missing REQUEST_METHOD", diff --git a/lib/libsi18n/gsslapd.h b/lib/libsi18n/gsslapd.h index ce77ed330..aad6ac20c 100644 --- a/lib/libsi18n/gsslapd.h +++ b/lib/libsi18n/gsslapd.h @@ -54,10 +54,10 @@ #undef LIBRARY_NAME static RESOURCE_GLOBAL allxpstr[] = { - base, - libaccess, - libadmin, - 0 + {base}, + {libaccess}, + {libadmin}, + {0} }; #endif /* ifdef RESOURCE_STR */
0
a2e3c02ec0cf7ec0f4a500188979d41d276308cc
389ds/389-ds-base
Issue 50634 - Clean up CLI errors output Description: CLI tools should print human easy readable messages if something went wrong. As discussed here: https://pagure.io/389-ds-base/pull-request/50624 Change the CLI error processing so the dict type is always transformed. https://pagure.io/389-ds-base/issue/50634 Reviewed by: mreynolds, mhonek (Thanks!)
commit a2e3c02ec0cf7ec0f4a500188979d41d276308cc Author: Simon Pichugin <[email protected]> Date: Thu Oct 17 13:46:56 2019 +0200 Issue 50634 - Clean up CLI errors output Description: CLI tools should print human easy readable messages if something went wrong. As discussed here: https://pagure.io/389-ds-base/pull-request/50624 Change the CLI error processing so the dict type is always transformed. https://pagure.io/389-ds-base/issue/50634 Reviewed by: mreynolds, mhonek (Thanks!) diff --git a/src/lib389/cli/dsconf b/src/lib389/cli/dsconf index 1940b8e6e..2059a06e9 100755 --- a/src/lib389/cli/dsconf +++ b/src/lib389/cli/dsconf @@ -15,7 +15,6 @@ import ldap import sys import signal import json -import ast from lib389._constants import DSRC_HOME from lib389.cli_conf import config as cli_config from lib389.cli_conf import backend as cli_backend @@ -34,6 +33,7 @@ from lib389.cli_conf import security as cli_security from lib389.cli_base import disconnect_instance, connect_instance from lib389.cli_base.dsrc import dsrc_to_ldap, dsrc_arg_concat from lib389.cli_base import setup_script_logger +from lib389.cli_base import format_error_to_dict parser = argparse.ArgumentParser(allow_abbrev=True) @@ -138,15 +138,12 @@ if __name__ == '__main__': log.info("Command successful.") except Exception as e: log.debug(e, exc_info=True) - errmsg = str(e) + msg = format_error_to_dict(e) + if args and args.json: - try: - msg = ast.literal_eval(errmsg) - except: - msg = {'desc': errmsg} sys.stderr.write(json.dumps(msg)) else: - log.error("Error: %s" % errmsg) + log.error("Error: %s" % " - ".join(msg.values())) result = False disconnect_instance(inst) diff --git a/src/lib389/cli/dscreate b/src/lib389/cli/dscreate index 4af852bd4..b516eb947 100755 --- a/src/lib389/cli/dscreate +++ b/src/lib389/cli/dscreate @@ -17,6 +17,7 @@ import signal from lib389 import DirSrv from lib389.cli_ctl import instance as cli_instance from lib389.cli_base import setup_script_logger +from lib389.cli_base import format_error_to_dict parser = argparse.ArgumentParser() parser.add_argument('-v', '--verbose', @@ -74,7 +75,8 @@ if __name__ == '__main__': result = args.func(inst, log, args) except Exception as e: log.debug(e, exc_info=True) - log.error("Error: %s" % str(e)) + msg = format_error_to_dict(e) + log.error("Error: %s" % " - ".join(msg.values())) result = False # Done! diff --git a/src/lib389/cli/dsctl b/src/lib389/cli/dsctl index e76f3e5be..3be9540e1 100755 --- a/src/lib389/cli/dsctl +++ b/src/lib389/cli/dsctl @@ -21,6 +21,7 @@ from lib389 import DirSrv from lib389.cli_ctl import instance as cli_instance from lib389.cli_ctl import dbtasks as cli_dbtasks from lib389.cli_base import disconnect_instance, setup_script_logger +from lib389.cli_base import format_error_to_dict from lib389.cli_ctl.instance import instance_remove_all from lib389._constants import DSRC_CONTAINER @@ -106,10 +107,12 @@ if __name__ == '__main__': insts = inst.list(serverid=args.instance) except (PermissionError, IOError) as e: log.error("Unable to access instance information. Are you running as the correct user? (usually dirsrv or root)") - log.error("Error: %s" % str(e)) + msg = format_error_to_dict(e) + log.error("Error: %s" % " - ".join(msg.values())) sys.exit(1) except Exception as e: - log.error("Error: %s" % str(e)) + msg = format_error_to_dict(e) + log.error("Error: %s" % " - ".join(msg.values())) sys.exit(1) if len(insts) != 1: log.error("No such instance '%s'" % args.instance) @@ -123,11 +126,11 @@ if __name__ == '__main__': result = args.func(inst, log, args) except Exception as e: log.debug(e, exc_info=True) - log.error("Error: %s" % str(e)) + msg = format_error_to_dict(e) + log.error("Error: %s" % " - ".join(msg.values())) result = False disconnect_instance(inst) # Done! if result is False: sys.exit(1) - diff --git a/src/lib389/cli/dsidm b/src/lib389/cli/dsidm index 7fd77b63d..da246b5ae 100755 --- a/src/lib389/cli/dsidm +++ b/src/lib389/cli/dsidm @@ -26,6 +26,7 @@ from lib389.cli_idm import client_config as cli_client_config from lib389.cli_idm import role as cli_role from lib389.cli_base import connect_instance, disconnect_instance, setup_script_logger from lib389.cli_base.dsrc import dsrc_to_ldap, dsrc_arg_concat +from lib389.cli_base import format_error_to_dict parser = argparse.ArgumentParser(allow_abbrev=True) @@ -131,7 +132,8 @@ if __name__ == '__main__': log.info("Command successful.") except Exception as e: log.debug(e, exc_info=True) - log.error("Error: %s" % str(e)) + msg = format_error_to_dict(e) + log.error("Error: %s" % " - ".join(msg.values())) result = False disconnect_instance(inst) diff --git a/src/lib389/lib389/cli_base/__init__.py b/src/lib389/lib389/cli_base/__init__.py index 932938b0e..23fc312b0 100644 --- a/src/lib389/lib389/cli_base/__init__.py +++ b/src/lib389/lib389/cli_base/__init__.py @@ -7,6 +7,7 @@ # See LICENSE for details. # --- END COPYRIGHT BLOCK --- +import ast import logging import sys import json @@ -406,3 +407,22 @@ def setup_script_logger(name, verbose=False): root.addHandler(log_handler) return log + + +def format_error_to_dict(exception): + """python-ldap str(exception) processing is not consistent. + This function makes sure that the result is dict + + :param exception: Exception you need to print + :type exception: ldap.LDAPError + :returns: dict + """ + + # The issue was raise on python-ldap repo: https://github.com/python-ldap/python-ldap/issues/304 + # We should fix the code here after the issue is fixed + errmsg = str(exception) + try: + msg = ast.literal_eval(errmsg) + except ValueError: + msg = {'desc': errmsg} + return msg
0
354249c1255c6b616e7821bb7615bccea8b395bf
389ds/389-ds-base
Bug 712855 - Directory Server 8.2 logs "Netscape Portable Runtime error -5961 (TCP connection reset by peer.)" to error log whereas Directory Server 8.1 did not https://bugzilla.redhat.com/show_bug.cgi?id=712855 Description: In write_function, all failures of PR_Write except PR_WOULD_BLOCK_ERROR and PR_IO_TIMEOUT_ERROR were logged. This patch changes it so that PR_CONNECT_RESET_ERROR (TCP connection reset by peer) will not be logged since it is not an error.
commit 354249c1255c6b616e7821bb7615bccea8b395bf Author: Noriko Hosoi <[email protected]> Date: Thu Jul 7 17:40:25 2011 -0700 Bug 712855 - Directory Server 8.2 logs "Netscape Portable Runtime error -5961 (TCP connection reset by peer.)" to error log whereas Directory Server 8.1 did not https://bugzilla.redhat.com/show_bug.cgi?id=712855 Description: In write_function, all failures of PR_Write except PR_WOULD_BLOCK_ERROR and PR_IO_TIMEOUT_ERROR were logged. This patch changes it so that PR_CONNECT_RESET_ERROR (TCP connection reset by peer) will not be logged since it is not an error. diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c index 312db6abc..a6ed94fee 100644 --- a/ldap/servers/slapd/daemon.c +++ b/ldap/servers/slapd/daemon.c @@ -1716,9 +1716,12 @@ write_function( int ignore, const void *buffer, int count, struct lextiof_socket SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", fd, prerr, slapd_pr_strerror( prerr )); if ( !SLAPD_PR_WOULD_BLOCK_ERROR(prerr)) { - LDAPDebug(LDAP_DEBUG_ANY, "PR_Write(%d) " - SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", - fd, prerr, slapd_pr_strerror( prerr )); + if (prerr != PR_CONNECT_RESET_ERROR) { + /* 'TCP connection reset by peer': no need to log */ + LDAPDebug(LDAP_DEBUG_ANY, "PR_Write(%d) " + SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", + fd, prerr, slapd_pr_strerror( prerr )); + } if (sentbytes < count) { LDAPDebug(LDAP_DEBUG_CONNS, "PR_Write(%d) - wrote only %d bytes (expected %d bytes) - 0 (EOF)\n", /* disconnected */
0
d620d791329ff676a964b81ae6a50ac1321d634f
389ds/389-ds-base
Issue 6753 - Add 'add_exclude_subtree' and 'remove_exclude_subtree' methods to Attribute uniqueness plugin Description: Adding 'add_exclude_subtree' and 'remove_exclude_subtree' methods to AttributeUniquenessPlugin in order to be able to easily add or remove an exclude subtree. Porting ticket 47927 test to dirsrvtests/tests/suites/plugins/attruniq_test.py Relates: #6753 Author: Lenka Doudova Reviewers: Simon Pichugin, Mark Reynolds
commit d620d791329ff676a964b81ae6a50ac1321d634f Author: Lenka Doudova <[email protected]> Date: Mon Jun 9 15:15:04 2025 +0200 Issue 6753 - Add 'add_exclude_subtree' and 'remove_exclude_subtree' methods to Attribute uniqueness plugin Description: Adding 'add_exclude_subtree' and 'remove_exclude_subtree' methods to AttributeUniquenessPlugin in order to be able to easily add or remove an exclude subtree. Porting ticket 47927 test to dirsrvtests/tests/suites/plugins/attruniq_test.py Relates: #6753 Author: Lenka Doudova Reviewers: Simon Pichugin, Mark Reynolds diff --git a/dirsrvtests/tests/suites/plugins/attruniq_test.py b/dirsrvtests/tests/suites/plugins/attruniq_test.py index c1ccad9ae..aac659c29 100644 --- a/dirsrvtests/tests/suites/plugins/attruniq_test.py +++ b/dirsrvtests/tests/suites/plugins/attruniq_test.py @@ -10,6 +10,7 @@ import pytest import ldap import logging from lib389.plugins import AttributeUniquenessPlugin +from lib389.idm.nscontainer import nsContainers from lib389.idm.user import UserAccounts from lib389.idm.group import Groups from lib389._constants import DEFAULT_SUFFIX @@ -22,6 +23,19 @@ log = logging.getLogger(__name__) MAIL_ATTR_VALUE = '[email protected]' MAIL_ATTR_VALUE_ALT = '[email protected]' +EXCLUDED_CONTAINER_CN = "excluded_container" +EXCLUDED_CONTAINER_DN = "cn={},{}".format(EXCLUDED_CONTAINER_CN, DEFAULT_SUFFIX) + +EXCLUDED_BIS_CONTAINER_CN = "excluded_bis_container" +EXCLUDED_BIS_CONTAINER_DN = "cn={},{}".format(EXCLUDED_BIS_CONTAINER_CN, DEFAULT_SUFFIX) + +ENFORCED_CONTAINER_CN = "enforced_container" + +USER_1_CN = "test_1" +USER_2_CN = "test_2" +USER_3_CN = "test_3" +USER_4_CN = "test_4" + def test_modrdn_attr_uniqueness(topology_st): """Test that we can not add two entries that have the same attr value that is @@ -154,3 +168,160 @@ def test_multiple_attr_uniqueness(topology_st): testuser2.delete() attruniq.disable() attruniq.delete() + + +def test_exclude_subtrees(topology_st): + """ Test attribute uniqueness with exclude scope + + :id: 43d29a60-40e1-4ebd-b897-6ef9f20e9f27 + :setup: Standalone instance + :steps: + 1. Setup and enable attribute uniqueness plugin for telephonenumber unique attribute + 2. Create subtrees and test users + 3. Add a unique attribute to a user within uniqueness scope + 4. Add exclude subtree + 5. Try to add existing value attribute to an entry within uniqueness scope + 6. Try to add existing value attribute to an entry within exclude scope + 7. Remove the attribute from affected entries + 8. Add a unique attribute to a user within exclude scope + 9. Try to add existing value attribute to an entry within uniqueness scope + 10. Try to add existing value attribute to another entry within uniqueness scope + 11. Remove the attribute from affected entries + 12. Add another exclude subtree + 13. Add a unique attribute to a user within uniqueness scope + 14. Try to add existing value attribute to an entry within uniqueness scope + 15. Try to add existing value attribute to an entry within exclude scope + 16. Try to add existing value attribute to an entry within another exclude scope + 17. Clean up entries + :expectedresults: + 1. Success + 2. Success + 3. Success + 4. Success + 5. Should raise CONSTRAINT_VIOLATION + 6. Success + 7. Success + 8. Success + 9. Success + 10. Should raise CONSTRAINT_VIOLATION + 11. Success + 12. Success + 13. Success + 14. Should raise CONSTRAINT_VIOLATION + 15. Success + 16. Success + 17. Success + """ + log.info('Setup attribute uniqueness plugin') + attruniq = AttributeUniquenessPlugin(topology_st.standalone, dn="cn=attruniq,cn=plugins,cn=config") + attruniq.create(properties={'cn': 'attruniq'}) + attruniq.add_unique_attribute('telephonenumber') + attruniq.add_unique_subtree(DEFAULT_SUFFIX) + attruniq.enable_all_subtrees() + attruniq.enable() + topology_st.standalone.restart() + + log.info('Create subtrees container') + containers = nsContainers(topology_st.standalone, DEFAULT_SUFFIX) + cont1 = containers.create(properties={'cn': EXCLUDED_CONTAINER_CN}) + cont2 = containers.create(properties={'cn': EXCLUDED_BIS_CONTAINER_CN}) + cont3 = containers.create(properties={'cn': ENFORCED_CONTAINER_CN}) + + log.info('Create test users') + users = UserAccounts(topology_st.standalone, DEFAULT_SUFFIX, + rdn='cn={}'.format(ENFORCED_CONTAINER_CN)) + users_excluded = UserAccounts(topology_st.standalone, DEFAULT_SUFFIX, + rdn='cn={}'.format(EXCLUDED_CONTAINER_CN)) + users_excluded2 = UserAccounts(topology_st.standalone, DEFAULT_SUFFIX, + rdn='cn={}'.format(EXCLUDED_BIS_CONTAINER_CN)) + + user1 = users.create(properties={'cn': USER_1_CN, + 'uid': USER_1_CN, + 'sn': USER_1_CN, + 'uidNumber': '1', + 'gidNumber': '11', + 'homeDirectory': '/home/{}'.format(USER_1_CN)}) + user2 = users.create(properties={'cn': USER_2_CN, + 'uid': USER_2_CN, + 'sn': USER_2_CN, + 'uidNumber': '2', + 'gidNumber': '22', + 'homeDirectory': '/home/{}'.format(USER_2_CN)}) + user3 = users_excluded.create(properties={'cn': USER_3_CN, + 'uid': USER_3_CN, + 'sn': USER_3_CN, + 'uidNumber': '3', + 'gidNumber': '33', + 'homeDirectory': '/home/{}'.format(USER_3_CN)}) + user4 = users_excluded2.create(properties={'cn': USER_4_CN, + 'uid': USER_4_CN, + 'sn': USER_4_CN, + 'uidNumber': '4', + 'gidNumber': '44', + 'homeDirectory': '/home/{}'.format(USER_4_CN)}) + + UNIQUE_VALUE = '1234' + + try: + log.info('Create user with unique attribute') + user1.add('telephonenumber', UNIQUE_VALUE) + assert user1.present('telephonenumber', UNIQUE_VALUE) + + log.info('Add exclude subtree') + attruniq.add_exclude_subtree(EXCLUDED_CONTAINER_DN) + topology_st.standalone.restart() + + log.info('Verify an already used attribute value cannot be added within the same subtree') + with pytest.raises(ldap.CONSTRAINT_VIOLATION): + user2.add('telephonenumber', UNIQUE_VALUE) + + log.info('Verify an entry with same attribute value can be added within exclude subtree') + user3.add('telephonenumber', UNIQUE_VALUE) + assert user3.present('telephonenumber', UNIQUE_VALUE) + + log.info('Cleanup unique attribute values') + user1.remove_all('telephonenumber') + user3.remove_all('telephonenumber') + + log.info('Add a unique value to an entry in excluded scope') + user3.add('telephonenumber', UNIQUE_VALUE) + assert user3.present('telephonenumber', UNIQUE_VALUE) + + log.info('Verify the same value can be added to an entry within uniqueness scope') + user1.add('telephonenumber', UNIQUE_VALUE) + assert user1.present('telephonenumber', UNIQUE_VALUE) + + log.info('Verify that yet another same value cannot be added to another entry within uniqueness scope') + with pytest.raises(ldap.CONSTRAINT_VIOLATION): + user2.add('telephonenumber', UNIQUE_VALUE) + + log.info('Cleanup unique attribute values') + user1.remove_all('telephonenumber') + user3.remove_all('telephonenumber') + + log.info('Add another exclude subtree') + attruniq.add_exclude_subtree(EXCLUDED_BIS_CONTAINER_DN) + topology_st.standalone.restart() + + user1.add('telephonenumber', UNIQUE_VALUE) + log.info('Verify an already used attribute value cannot be added within the same subtree') + with pytest.raises(ldap.CONSTRAINT_VIOLATION): + user2.add('telephonenumber', UNIQUE_VALUE) + + log.info('Verify an already used attribute can be added to an entry in exclude scope') + user3.add('telephonenumber', UNIQUE_VALUE) + assert user3.present('telephonenumber', UNIQUE_VALUE) + user4.add('telephonenumber', UNIQUE_VALUE) + assert user4.present('telephonenumber', UNIQUE_VALUE) + + finally: + log.info('Clean up users, containers and attribute uniqueness plugin') + user1.delete() + user2.delete() + user3.delete() + user4.delete() + cont1.delete() + cont2.delete() + cont3.delete() + attruniq.disable() + attruniq.delete() \ No newline at end of file diff --git a/dirsrvtests/tests/tickets/ticket47927_test.py b/dirsrvtests/tests/tickets/ticket47927_test.py deleted file mode 100644 index 887fe1af4..000000000 --- a/dirsrvtests/tests/tickets/ticket47927_test.py +++ /dev/null @@ -1,267 +0,0 @@ -# --- BEGIN COPYRIGHT BLOCK --- -# Copyright (C) 2016 Red Hat, Inc. -# All rights reserved. -# -# License: GPL (version 3 or any later version). -# See LICENSE for details. -# --- END COPYRIGHT BLOCK --- -# -import pytest -from lib389.tasks import * -from lib389.utils import * -from lib389.topologies import topology_st - -from lib389._constants import SUFFIX, DEFAULT_SUFFIX, PLUGIN_ATTR_UNIQUENESS - -# Skip on older versions -pytestmark = [pytest.mark.tier2, - pytest.mark.skipif(ds_is_older('1.3.4'), reason="Not implemented")] - -logging.getLogger(__name__).setLevel(logging.DEBUG) -log = logging.getLogger(__name__) - -EXCLUDED_CONTAINER_CN = "excluded_container" -EXCLUDED_CONTAINER_DN = "cn=%s,%s" % (EXCLUDED_CONTAINER_CN, SUFFIX) - -EXCLUDED_BIS_CONTAINER_CN = "excluded_bis_container" -EXCLUDED_BIS_CONTAINER_DN = "cn=%s,%s" % (EXCLUDED_BIS_CONTAINER_CN, SUFFIX) - -ENFORCED_CONTAINER_CN = "enforced_container" -ENFORCED_CONTAINER_DN = "cn=%s,%s" % (ENFORCED_CONTAINER_CN, SUFFIX) - -USER_1_CN = "test_1" -USER_1_DN = "cn=%s,%s" % (USER_1_CN, ENFORCED_CONTAINER_DN) -USER_2_CN = "test_2" -USER_2_DN = "cn=%s,%s" % (USER_2_CN, ENFORCED_CONTAINER_DN) -USER_3_CN = "test_3" -USER_3_DN = "cn=%s,%s" % (USER_3_CN, EXCLUDED_CONTAINER_DN) -USER_4_CN = "test_4" -USER_4_DN = "cn=%s,%s" % (USER_4_CN, EXCLUDED_BIS_CONTAINER_DN) - - -def test_ticket47927_init(topology_st): - topology_st.standalone.plugins.enable(name=PLUGIN_ATTR_UNIQUENESS) - try: - topology_st.standalone.modify_s('cn=' + PLUGIN_ATTR_UNIQUENESS + ',cn=plugins,cn=config', - [(ldap.MOD_REPLACE, 'uniqueness-attribute-name', b'telephonenumber'), - (ldap.MOD_REPLACE, 'uniqueness-subtrees', ensure_bytes(DEFAULT_SUFFIX)), - ]) - except ldap.LDAPError as e: - log.fatal('test_ticket47927: Failed to configure plugin for "telephonenumber": error ' + e.args[0]['desc']) - assert False - topology_st.standalone.restart(timeout=120) - - topology_st.standalone.add_s(Entry((EXCLUDED_CONTAINER_DN, {'objectclass': "top nscontainer".split(), - 'cn': EXCLUDED_CONTAINER_CN}))) - topology_st.standalone.add_s(Entry((EXCLUDED_BIS_CONTAINER_DN, {'objectclass': "top nscontainer".split(), - 'cn': EXCLUDED_BIS_CONTAINER_CN}))) - topology_st.standalone.add_s(Entry((ENFORCED_CONTAINER_DN, {'objectclass': "top nscontainer".split(), - 'cn': ENFORCED_CONTAINER_CN}))) - - # adding an entry on a stage with a different 'cn' - topology_st.standalone.add_s(Entry((USER_1_DN, { - 'objectclass': "top person".split(), - 'sn': USER_1_CN, - 'cn': USER_1_CN}))) - # adding an entry on a stage with a different 'cn' - topology_st.standalone.add_s(Entry((USER_2_DN, { - 'objectclass': "top person".split(), - 'sn': USER_2_CN, - 'cn': USER_2_CN}))) - topology_st.standalone.add_s(Entry((USER_3_DN, { - 'objectclass': "top person".split(), - 'sn': USER_3_CN, - 'cn': USER_3_CN}))) - topology_st.standalone.add_s(Entry((USER_4_DN, { - 'objectclass': "top person".split(), - 'sn': USER_4_CN, - 'cn': USER_4_CN}))) - - -def test_ticket47927_one(topology_st): - ''' - Check that uniqueness is enforce on all SUFFIX - ''' - UNIQUE_VALUE = b'1234' - try: - topology_st.standalone.modify_s(USER_1_DN, - [(ldap.MOD_REPLACE, 'telephonenumber', UNIQUE_VALUE)]) - except ldap.LDAPError as e: - log.fatal('test_ticket47927_one: Failed to set the telephonenumber for %s: %s' % (USER_1_DN, e.args[0]['desc'])) - assert False - - # we expect to fail because user1 is in the scope of the plugin - try: - topology_st.standalone.modify_s(USER_2_DN, - [(ldap.MOD_REPLACE, 'telephonenumber', UNIQUE_VALUE)]) - log.fatal('test_ticket47927_one: unexpected success to set the telephonenumber for %s' % (USER_2_DN)) - assert False - except ldap.LDAPError as e: - log.fatal('test_ticket47927_one: Failed (expected) to set the telephonenumber for %s: %s' % ( - USER_2_DN, e.args[0]['desc'])) - pass - - # we expect to fail because user1 is in the scope of the plugin - try: - topology_st.standalone.modify_s(USER_3_DN, - [(ldap.MOD_REPLACE, 'telephonenumber', UNIQUE_VALUE)]) - log.fatal('test_ticket47927_one: unexpected success to set the telephonenumber for %s' % (USER_3_DN)) - assert False - except ldap.LDAPError as e: - log.fatal('test_ticket47927_one: Failed (expected) to set the telephonenumber for %s: %s' % ( - USER_3_DN, e.args[0]['desc'])) - pass - - -def test_ticket47927_two(topology_st): - ''' - Exclude the EXCLUDED_CONTAINER_DN from the uniqueness plugin - ''' - try: - topology_st.standalone.modify_s('cn=' + PLUGIN_ATTR_UNIQUENESS + ',cn=plugins,cn=config', - [(ldap.MOD_REPLACE, 'uniqueness-exclude-subtrees', ensure_bytes(EXCLUDED_CONTAINER_DN))]) - except ldap.LDAPError as e: - log.fatal('test_ticket47927_two: Failed to configure plugin for to exclude %s: error %s' % ( - EXCLUDED_CONTAINER_DN, e.args[0]['desc'])) - assert False - topology_st.standalone.restart(timeout=120) - - -def test_ticket47927_three(topology_st): - ''' - Check that uniqueness is enforced on full SUFFIX except EXCLUDED_CONTAINER_DN - First case: it exists an entry (with the same attribute value) in the scope - of the plugin and we set the value in an entry that is in an excluded scope - ''' - UNIQUE_VALUE = b'9876' - try: - topology_st.standalone.modify_s(USER_1_DN, - [(ldap.MOD_REPLACE, 'telephonenumber', UNIQUE_VALUE)]) - except ldap.LDAPError as e: - log.fatal('test_ticket47927_three: Failed to set the telephonenumber ' + e.args[0]['desc']) - assert False - - # we should not be allowed to set this value (because user1 is in the scope) - try: - topology_st.standalone.modify_s(USER_2_DN, - [(ldap.MOD_REPLACE, 'telephonenumber', UNIQUE_VALUE)]) - log.fatal('test_ticket47927_three: unexpected success to set the telephonenumber for %s' % (USER_2_DN)) - assert False - except ldap.LDAPError as e: - log.fatal('test_ticket47927_three: Failed (expected) to set the telephonenumber for %s: %s' % ( - USER_2_DN, e.args[0]['desc'])) - - # USER_3_DN is in EXCLUDED_CONTAINER_DN so update should be successful - try: - topology_st.standalone.modify_s(USER_3_DN, - [(ldap.MOD_REPLACE, 'telephonenumber', UNIQUE_VALUE)]) - log.fatal('test_ticket47927_three: success to set the telephonenumber for %s' % (USER_3_DN)) - except ldap.LDAPError as e: - log.fatal('test_ticket47927_three: Failed (unexpected) to set the telephonenumber for %s: %s' % ( - USER_3_DN, e.args[0]['desc'])) - assert False - - -def test_ticket47927_four(topology_st): - ''' - Check that uniqueness is enforced on full SUFFIX except EXCLUDED_CONTAINER_DN - Second case: it exists an entry (with the same attribute value) in an excluded scope - of the plugin and we set the value in an entry is in the scope - ''' - UNIQUE_VALUE = b'1111' - # USER_3_DN is in EXCLUDED_CONTAINER_DN so update should be successful - try: - topology_st.standalone.modify_s(USER_3_DN, - [(ldap.MOD_REPLACE, 'telephonenumber', UNIQUE_VALUE)]) - log.fatal('test_ticket47927_four: success to set the telephonenumber for %s' % USER_3_DN) - except ldap.LDAPError as e: - log.fatal('test_ticket47927_four: Failed (unexpected) to set the telephonenumber for %s: %s' % ( - USER_3_DN, e.args[0]['desc'])) - assert False - - # we should be allowed to set this value (because user3 is excluded from scope) - try: - topology_st.standalone.modify_s(USER_1_DN, - [(ldap.MOD_REPLACE, 'telephonenumber', UNIQUE_VALUE)]) - except ldap.LDAPError as e: - log.fatal( - 'test_ticket47927_four: Failed to set the telephonenumber for %s: %s' % (USER_1_DN, e.args[0]['desc'])) - assert False - - # we should not be allowed to set this value (because user1 is in the scope) - try: - topology_st.standalone.modify_s(USER_2_DN, - [(ldap.MOD_REPLACE, 'telephonenumber', UNIQUE_VALUE)]) - log.fatal('test_ticket47927_four: unexpected success to set the telephonenumber %s' % USER_2_DN) - assert False - except ldap.LDAPError as e: - log.fatal('test_ticket47927_four: Failed (expected) to set the telephonenumber for %s: %s' % ( - USER_2_DN, e.args[0]['desc'])) - pass - - -def test_ticket47927_five(topology_st): - ''' - Exclude the EXCLUDED_BIS_CONTAINER_DN from the uniqueness plugin - ''' - try: - topology_st.standalone.modify_s('cn=' + PLUGIN_ATTR_UNIQUENESS + ',cn=plugins,cn=config', - [(ldap.MOD_ADD, 'uniqueness-exclude-subtrees', ensure_bytes(EXCLUDED_BIS_CONTAINER_DN))]) - except ldap.LDAPError as e: - log.fatal('test_ticket47927_five: Failed to configure plugin for to exclude %s: error %s' % ( - EXCLUDED_BIS_CONTAINER_DN, e.args[0]['desc'])) - assert False - topology_st.standalone.restart(timeout=120) - topology_st.standalone.getEntry('cn=' + PLUGIN_ATTR_UNIQUENESS + ',cn=plugins,cn=config', ldap.SCOPE_BASE) - - -def test_ticket47927_six(topology_st): - ''' - Check that uniqueness is enforced on full SUFFIX except EXCLUDED_CONTAINER_DN - and EXCLUDED_BIS_CONTAINER_DN - First case: it exists an entry (with the same attribute value) in the scope - of the plugin and we set the value in an entry that is in an excluded scope - ''' - UNIQUE_VALUE = b'222' - try: - topology_st.standalone.modify_s(USER_1_DN, - [(ldap.MOD_REPLACE, 'telephonenumber', UNIQUE_VALUE)]) - except ldap.LDAPError as e: - log.fatal('test_ticket47927_six: Failed to set the telephonenumber ' + e.args[0]['desc']) - assert False - - # we should not be allowed to set this value (because user1 is in the scope) - try: - topology_st.standalone.modify_s(USER_2_DN, - [(ldap.MOD_REPLACE, 'telephonenumber', UNIQUE_VALUE)]) - log.fatal('test_ticket47927_six: unexpected success to set the telephonenumber for %s' % (USER_2_DN)) - assert False - except ldap.LDAPError as e: - log.fatal('test_ticket47927_six: Failed (expected) to set the telephonenumber for %s: %s' % ( - USER_2_DN, e.args[0]['desc'])) - - # USER_3_DN is in EXCLUDED_CONTAINER_DN so update should be successful - try: - topology_st.standalone.modify_s(USER_3_DN, - [(ldap.MOD_REPLACE, 'telephonenumber', UNIQUE_VALUE)]) - log.fatal('test_ticket47927_six: success to set the telephonenumber for %s' % (USER_3_DN)) - except ldap.LDAPError as e: - log.fatal('test_ticket47927_six: Failed (unexpected) to set the telephonenumber for %s: %s' % ( - USER_3_DN, e.args[0]['desc'])) - assert False - # USER_4_DN is in EXCLUDED_CONTAINER_DN so update should be successful - try: - topology_st.standalone.modify_s(USER_4_DN, - [(ldap.MOD_REPLACE, 'telephonenumber', UNIQUE_VALUE)]) - log.fatal('test_ticket47927_six: success to set the telephonenumber for %s' % (USER_4_DN)) - except ldap.LDAPError as e: - log.fatal('test_ticket47927_six: Failed (unexpected) to set the telephonenumber for %s: %s' % ( - USER_4_DN, e.args[0]['desc'])) - assert False - - -if __name__ == '__main__': - # Run isolated - # -s for DEBUG mode - CURRENT_FILE = os.path.realpath(__file__) - pytest.main("-s %s" % CURRENT_FILE) diff --git a/src/lib389/lib389/plugins.py b/src/lib389/lib389/plugins.py index 31bbfa502..977091726 100644 --- a/src/lib389/lib389/plugins.py +++ b/src/lib389/lib389/plugins.py @@ -175,6 +175,16 @@ class AttributeUniquenessPlugin(Plugin): self.set('uniqueness-across-all-subtrees', 'off') + def add_exclude_subtree(self, basedn): + """Add a uniqueness-exclude-subtrees attribute""" + + self.add('uniqueness-exclude-subtrees', basedn) + + def remove_exclude_subtree(self, basedn): + """Remove a uniqueness-exclude-subtrees attribute""" + + self.remove('uniqueness-exclude-subtrees', basedn) + class AttributeUniquenessPlugins(DSLdapObjects): """A DSLdapObjects entity which represents Attribute Uniqueness plugin instances
0
9982521af11c246814846f2afc02f6dde364b23a
389ds/389-ds-base
Issue 5989 - RFE support of inChain Matching Rule (#5990) Bug description: Computation of membership (like 'memberof') is a common issue. The issue is more expensive to solve when there are nested membership. For example "gives me all the groups this entry belongs to" or "gives me all subordinates having this manager". Either the LDAP client computes the values or dedicated plugin (like 'memberof') maintains direct membership attribute for the LDAP client. InChain Matching Rule allow a LDAP client to request the server to compute this membership. Fix description: The implementation is designed https://www.port389.org/docs/389ds/design/matching-rule-in-chain.html A specific fix in aclanom.c because inChain MR adds a acl DENY on 'cn=config'. There was a bug that cleared anonymous aci if the it existed a DENY acl anywhere (except a specific list of entries like 'cn=monitor'). It triggered a failure on chaining backend suite relates: #5989 Reviewed by: William Brown, Mark Reynolds, Pierre Rogier, Simon Pichugin (Thanks !)
commit 9982521af11c246814846f2afc02f6dde364b23a Author: tbordaz <[email protected]> Date: Wed Jan 10 16:53:08 2024 +0100 Issue 5989 - RFE support of inChain Matching Rule (#5990) Bug description: Computation of membership (like 'memberof') is a common issue. The issue is more expensive to solve when there are nested membership. For example "gives me all the groups this entry belongs to" or "gives me all subordinates having this manager". Either the LDAP client computes the values or dedicated plugin (like 'memberof') maintains direct membership attribute for the LDAP client. InChain Matching Rule allow a LDAP client to request the server to compute this membership. Fix description: The implementation is designed https://www.port389.org/docs/389ds/design/matching-rule-in-chain.html A specific fix in aclanom.c because inChain MR adds a acl DENY on 'cn=config'. There was a bug that cleared anonymous aci if the it existed a DENY acl anywhere (except a specific list of entries like 'cn=monitor'). It triggered a failure on chaining backend suite relates: #5989 Reviewed by: William Brown, Mark Reynolds, Pierre Rogier, Simon Pichugin (Thanks !) diff --git a/Makefile.am b/Makefile.am index c448694c9..e402378b7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1738,6 +1738,7 @@ libsyntax_plugin_la_SOURCES = ldap/servers/plugins/syntaxes/bin.c \ ldap/servers/plugins/syntaxes/facsimile.c \ ldap/servers/plugins/syntaxes/guide.c \ ldap/servers/plugins/syntaxes/int.c \ + ldap/servers/plugins/syntaxes/inchain.c \ ldap/servers/plugins/syntaxes/nameoptuid.c \ ldap/servers/plugins/syntaxes/numericstring.c \ ldap/servers/plugins/syntaxes/phonetic.c \ diff --git a/dirsrvtests/tests/suites/filter/inchain_test.py b/dirsrvtests/tests/suites/filter/inchain_test.py new file mode 100644 index 000000000..c650b9374 --- /dev/null +++ b/dirsrvtests/tests/suites/filter/inchain_test.py @@ -0,0 +1,817 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2023 RED Hat, Inc. +# All rights reserved. +# +# License: GPL (version 3 or any later version). +# See LICENSE for details. +# --- END COPYRIGHT BLOCK ---- + +import pytest, os, re +from lib389.tasks import * +from lib389.utils import * +from ldap import SCOPE_SUBTREE, ALREADY_EXISTS + +from lib389._constants import DEFAULT_SUFFIX, PW_DM, PLUGIN_MEMBER_OF +from lib389.topologies import topology_st as topo +from lib389.plugins import MemberOfPlugin + +from lib389.idm.user import UserAccount, UserAccounts +from lib389.idm.account import Accounts +from lib389.idm.account import Anonymous + +INCHAIN_OID = "1.2.840.113556.1.4.1941" + +pytestmark = pytest.mark.tier0 + [email protected](scope="function") +def provision_inchain(topo): + """fixture that provision a hierachical tree + with 'manager' membership relation + + """ + # hierarchy of the entries is + # 3_1 + # |__ 2_1 + # | |__ 1_1 + # | |__ 100 + # | | |__ 101 + # | | |__ 102 + # | | |__ 103 + # | | |__ 104 + # | | + # | |__ 1_2 + # | | |__ 200 + # | | |__ 201 + # | | |__ 202 + # | | |__ 203 + # | | |__ 204 + # | + # |__ 2_2 + # |__ 1_3 + # | |__ 300 + # | |__ 301 + # | |__ 302 + # | |__ 303 + # | |__ 304 + # | + # |__ 1_4 + # |__ 400 + # |__ 401 + # |__ 402 + # |__ 403 + # |__ 404 + # + user = UserAccounts(topo.standalone, DEFAULT_SUFFIX) + try: + manager_lvl_3_1 = user.create_test_user(uid=31) + except ALREADY_EXISTS: + manager_lvl_3_1 = None + pass + + try: + manager_lvl_2_1 = user.create_test_user(uid=21) + if manager_lvl_3_1: + manager_lvl_2_1.set("manager", manager_lvl_3_1.dn) + else: + manager_lvl_2_1.set("manager", "uid=test_user_31,ou=People,%s" % DEFAULT_SUFFIX) + except ALREADY_EXISTS: + manager_lvl_2_1 = None + pass + + try: + manager_lvl_2_2 = user.create_test_user(uid=22) + if manager_lvl_3_1: + manager_lvl_2_2.set("manager", manager_lvl_3_1.dn) + else: + manager_lvl_2_2.set("manager", "uid=test_user_31,ou=People,%s" % DEFAULT_SUFFIX) + except ALREADY_EXISTS: + manager_lvl_2_2 = None + pass + + try: + manager_lvl_1_1 = user.create_test_user(uid=11) + if manager_lvl_2_1: + manager_lvl_1_1.set("manager", manager_lvl_2_1.dn) + else: + manager_lvl_1_1.set("manager", "uid=test_user_21,ou=People,%s" % DEFAULT_SUFFIX) + except ALREADY_EXISTS: + manager_lvl_1_1 = None + pass + + try: + manager_lvl_1_2 = user.create_test_user(uid=12) + if manager_lvl_2_1: + manager_lvl_1_2.set("manager", manager_lvl_2_1.dn) + else: + manager_lvl_1_2.set("manager", "uid=test_user_21,ou=People,%s" % DEFAULT_SUFFIX) + except ALREADY_EXISTS: + manager_lvl_1_2 = None + pass + + try: + manager_lvl_1_3 = user.create_test_user(uid=13) + if manager_lvl_2_2: + manager_lvl_1_3.set("manager", manager_lvl_2_2.dn) + else: + manager_lvl_1_3.set("manager", "uid=test_user_22,ou=People,%s" % DEFAULT_SUFFIX) + except ALREADY_EXISTS: + manager_lvl_1_3 = None + pass + + try: + manager_lvl_1_4 = user.create_test_user(uid=14) + if manager_lvl_2_2: + manager_lvl_1_4.set("manager", manager_lvl_2_2.dn) + else: + manager_lvl_1_4.set("manager", "uid=test_user_22,ou=People,%s" % DEFAULT_SUFFIX) + except ALREADY_EXISTS: + manager_lvl_1_4 = None + pass + + for i in range(100, 105): + try: + user1 = user.create_test_user(uid=i) + if manager_lvl_1_1: + user1.set("manager", manager_lvl_1_1.dn) + else: + user1.set("manager", "uid=test_user_11,ou=People,%s" % DEFAULT_SUFFIX) + except ALREADY_EXISTS: + pass + + for i in range(200, 205): + try: + user1 = user.create_test_user(uid=i) + if manager_lvl_1_2: + user1.set("manager", manager_lvl_1_2.dn) + else: + user1.set("manager", "uid=test_user_12,ou=People,%s" % DEFAULT_SUFFIX) + except ALREADY_EXISTS: + pass + + for i in range(300, 305): + try: + user1 = user.create_test_user(uid=i) + if manager_lvl_1_3: + user1.set("manager", manager_lvl_1_3.dn) + else: + user1.set("manager", "uid=test_user_13,ou=People,%s" % DEFAULT_SUFFIX) + except ALREADY_EXISTS: + pass + + for i in range(400, 405): + try: + user1 = user.create_test_user(uid=i) + if manager_lvl_1_4: + user1.set("manager", manager_lvl_1_4.dn) + else: + user1.set("manager", "uid=test_user_14,ou=People,%s" % DEFAULT_SUFFIX) + except ALREADY_EXISTS: + pass + +def check_subordinates(topo, uid, expected): + """Test filter can search attributes + + :id: 39640b4b-0e64-44a4-8611-191aae412370 + :setup: Standalone instance + :steps: + 1. Add test entry + 2. make search + :expectedresults: + 1. Entry should be added + 2. Operation should succeed + """ + manager = "uid=%s,ou=People,%s" % (uid, DEFAULT_SUFFIX) + topo.standalone.log.info("Subordinate of manager %s" % manager) + + subordinates = topo.standalone.search_s(DEFAULT_SUFFIX, SCOPE_SUBTREE, "(manager:%s:=%s)" % (INCHAIN_OID, manager)) + found = [] + for sub in subordinates: + p =re.compile("uid=(.*),ou.*$") + res = p.search(sub.dn) + found.append(res.group(1)) + topo.standalone.log.info("Subordinate found : %s" % res.group(1)) + + + for sub in expected: + assert sub in found + + for sub in found: + assert sub in expected + + +def test_manager_lvl_1(topo, provision_inchain): + """Test that it succeeds to retrieve the subordinate + of level 1 manager + + :id: 193040ef-861e-41bd-84c7-c07a53a74e18 + :setup: Standalone instance + :steps: + 1. fixture provision a hierachical tree + 2. Check subordinates of 1_4 entry + 3. Check subordinates of 1_3 entry + 4. Check subordinates of 1_2 entry + 5. Check subordinates of 1_1 entry + :expectedresults: + 1. provisioning done + 2. found subordinates should match expected ones + 3. found subordinates should match expected ones + 4. found subordinates should match expected ones + 5. found subordinates should match expected ones + """ + + # Check subordinates of user_14 + # |__ 1_4 + # |__ 400 + # |__ 401 + # |__ 402 + # |__ 403 + # |__ 404 + uid = "test_user_14" + topo.standalone.log.info("Subordinate of uid=%s" % uid) + expected = [] + for i in range(400, 405): + uid_expected = "test_user_%s" % i + expected.append(uid_expected) + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + + check_subordinates(topo, uid, expected) + + # Check subordinates of user_13 + # |__ 1_3 + # | |__ 300 + # | |__ 301 + # | |__ 302 + # | |__ 303 + # | |__ 304 + uid = "test_user_13" + topo.standalone.log.info("Subordinate of uid=%s" % uid) + expected = [] + for i in range(300, 305): + uid_expected = "test_user_%s" % i + expected.append(uid_expected) + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + + check_subordinates(topo, uid, expected) + + # Check subordinates of user_12 + #| |__ 1_2 + #| | |__ 200 + #| | |__ 201 + #| | |__ 202 + #| | |__ 203 + #| | |__ 204 + + uid = "test_user_12" + topo.standalone.log.info("Subordinate of uid=%s" % uid) + expected = [] + for i in range(200, 205): + uid_expected = "test_user_%s" % i + expected.append(uid_expected) + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + + check_subordinates(topo, uid, expected) + + # Check subordinates of user_11 + #| |__ 1_1 + #| | |__ 100 + #| | |__ 101 + #| | |__ 102 + #| | |__ 103 + #| | |__ 104 + uid = "test_user_11" + topo.standalone.log.info("Subordinate of uid=%s" % uid) + expected = [] + for i in range(100, 105): + uid_expected = "test_user_%s" % i + expected.append(uid_expected) + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + + check_subordinates(topo, uid, expected) + +def test_manager_lvl_2(topo, provision_inchain): + """Test that it succeeds to retrieve the subordinate + of level 2 manager + + :id: d0c98211-3b90-4764-913d-f55ea5479029 + :setup: Standalone instance + :steps: + 1. fixture provision a hierachical tree + 2. Check subordinates of 2_1 entry + 3. Check subordinates of 2_2 entry + :expectedresults: + 1. provisioning done + 2. found subordinates should match expected ones + 3. found subordinates should match expected ones + """ + + # Check subordinates of user_22 + #| + #|__ 2_2 + # |__ 1_3 + # ... + # |__ 1_4 + # ... + uid = "test_user_22" + topo.standalone.log.info("Subordinate of uid=%s" % uid) + expected = [] + + # it contains user_14 and below + # |__ 1_4 + # |__ 400 + # |__ 401 + # |__ 402 + # |__ 403 + # |__ 404 + uid_expected = "test_user_14" + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + expected.append(uid_expected) + for i in range(400, 405): + uid_expected = "test_user_%s" % i + expected.append(uid_expected) + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + + # it contains user_13 and below + #| + #|__ 2_2 + # |__ 1_3 + # | |__ 300 + # | |__ 301 + # | |__ 302 + # | |__ 303 + # | |__ 304 + # | + uid_expected = "test_user_13" + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + expected.append(uid_expected) + for i in range(300, 305): + uid_expected = "test_user_%s" % i + expected.append(uid_expected) + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + + check_subordinates(topo, uid, expected) + + # Check subordinates of user_21 + #|__ 2_1 + #| |__ 1_1 + #| | + #| ... + #| | + #| |__ 1_2 + #| ... + uid = "test_user_21" + topo.standalone.log.info("Subordinate of uid=%s" % uid) + expected = [] + + # it contains user_12 and below + #|__ 2_1 + #| ... + #| |__ 1_2 + #| | |__ 200 + #| | |__ 201 + #| | |__ 202 + #| | |__ 203 + #| | |__ 204 + + uid_expected = "test_user_12" + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + expected.append(uid_expected) + for i in range(200, 205): + uid_expected = "test_user_%s" % i + expected.append(uid_expected) + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + + # it contains user_11 and below + #|__ 2_1 + #| |__ 1_1 + #| | |__ 100 + #| | |__ 101 + #| | |__ 102 + #| | |__ 103 + #| | |__ 104 + #| | + #| ... + uid_expected = "test_user_11" + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + expected.append(uid_expected) + for i in range(100, 105): + uid_expected = "test_user_%s" % i + expected.append(uid_expected) + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + + check_subordinates(topo, uid, expected) + +def test_manager_lvl_3(topo, provision_inchain): + """Test that it succeeds to retrieve the subordinate + of level 3 manager + + :id: d3708a39-7901-4c88-b4af-272aed2aa846 + :setup: Standalone instance + :steps: + 1. fixture provision a hierachical tree + 2. Check subordinates of 3_1 entry + :expectedresults: + 1. provisioning done + 2. found subordinates should match expected ones + """ + + # Check subordinates of user_31 + # 3_1 + #|__ 2_1 + #| |__ 1_1 + #| | |__ 100 + #| | |__ 101 + #| | |__ 102 + #| | |__ 103 + #| | |__ 104 + #| | + #| |__ 1_2 + #| | |__ 200 + #| | |__ 201 + #| | |__ 202 + #| | |__ 203 + #| | |__ 204 + #| + #|__ 2_2 + # |__ 1_3 + # | |__ 300 + # | |__ 301 + # | |__ 302 + # | |__ 303 + # | |__ 304 + # | + # |__ 1_4 + # |__ 400 + # |__ 401 + # |__ 402 + # |__ 403 + # |__ 404 + uid = "test_user_31" + topo.standalone.log.info("Subordinate of uid=%s" % uid) + expected = [] + + # it contains user_22 and below + uid_expected = "test_user_22" + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + expected.append(uid_expected) + + # it contains user_14 and below + uid_expected = "test_user_14" + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + expected.append(uid_expected) + for i in range(400, 405): + uid_expected = "test_user_%s" % i + expected.append(uid_expected) + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + + # it contains user_13 and below + uid_expected = "test_user_13" + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + expected.append(uid_expected) + for i in range(300, 305): + uid_expected = "test_user_%s" % i + expected.append(uid_expected) + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + + + # it contains user_21 and below + uid_expected = "test_user_21" + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + expected.append(uid_expected) + + # it contains user_12 and below + uid_expected = "test_user_12" + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + expected.append(uid_expected) + for i in range(200, 205): + uid_expected = "test_user_%s" % i + expected.append(uid_expected) + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + + # it contains user_11 and below + uid_expected = "test_user_11" + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + expected.append(uid_expected) + for i in range(100, 105): + uid_expected = "test_user_%s" % i + expected.append(uid_expected) + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + + check_subordinates(topo, uid, expected) + +def test_recompute_del(topo, provision_inchain): + """Test that if we delete a subordinate + the subordinate list is correctly updated + + :id: 6865876d-64b5-41a2-ae6e-4453aae5caab + :setup: Standalone instance + :steps: + 1. fixture provision a hierachical tree + 2. Check subordinates of 1_1 entry + 3. Delete user_100 + 4. Check subordinates of 1_1 entry + :expectedresults: + 1. provisioning done + 2. found subordinates should match expected ones + """ + + # Check subordinates of user_11 + #| |__ 1_1 + #| | |__ 100 + #| | |__ 101 + #| | |__ 102 + #| | |__ 103 + #| | |__ 104 + + uid = "test_user_11" + topo.standalone.log.info("Subordinate of uid=%s" % uid) + expected = [] + for i in range(100, 105): + uid_expected = "test_user_%s" % i + expected.append(uid_expected) + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + + check_subordinates(topo, uid, expected) + + del_dn = "uid=test_user_100,ou=People,%s" % (DEFAULT_SUFFIX) + user = UserAccount(topo.standalone, del_dn) + topo.standalone.log.info("Delete: %s" % del_dn) + user.delete() + + # Check subordinates of user_11 + #| |__ 1_1 + #| | |__ 101 + #| | |__ 102 + #| | |__ 103 + #| | |__ 104 + topo.standalone.log.info("Subordinate of uid=%s" % uid) + expected = [] + for i in range(101, 105): + uid_expected = "test_user_%s" % i + expected.append(uid_expected) + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + + check_subordinates(topo, uid, expected) + +def test_recompute_add(topo, provision_inchain, request): + """Test that if we add a subordinate + the subordinate list is correctly updated + + :id: 60d10233-37c2-400b-ac6e-d29b68706216 + :setup: Standalone instance + :steps: + 1. fixture provision a hierachical tree + 2. Check subordinates of 1_1 entry + 3. add user_105 + 4. Check subordinates of 1_1 entry + :expectedresults: + 1. provisioning done + 2. found subordinates should match expected ones + """ + + # Check subordinates of user_11 + #| |__ 1_1 + #| | |__ 100 + #| | |__ 101 + #| | |__ 102 + #| | |__ 103 + #| | |__ 104 + uid = "test_user_11" + topo.standalone.log.info("Subordinate of uid=%s" % uid) + expected = [] + for i in range(100, 105): + uid_expected = "test_user_%s" % i + expected.append(uid_expected) + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + + check_subordinates(topo, uid, expected) + + # add a new subordinate of user_11 + users = UserAccounts(topo.standalone, DEFAULT_SUFFIX) + user_added = users.create_test_user(uid=105) + topo.standalone.log.info("Add: %s" % user_added.dn) + user_added.set("manager", "uid=%s,ou=People,%s" % (uid, DEFAULT_SUFFIX)) + + # Check subordinates of user_11 + #| |__ 1_1 + #| | |__ 100 + #| | |__ 101 + #| | |__ 102 + #| | |__ 103 + #| | |__ 104 + #| | |__ 105 + topo.standalone.log.info("Subordinate of uid=%s" % uid) + expected = [] + for i in range(100, 106): + uid_expected = "test_user_%s" % i + expected.append(uid_expected) + topo.standalone.log.info("Subordinate expected: %s" % uid_expected) + + check_subordinates(topo, uid, expected) + + def fin(): + user_added.delete() + + request.addfinalizer(fin) + + +def test_anonymous_inchain(topo, provision_inchain): + """Test that anonymous connection can not + retrieve subordinates + + :id: d6c41cc1-7c36-4a3f-bcdf-f479c12310e2 + :setup: Standalone instance + :steps: + 1. fixture provision a hierachical tree + 2. bound anonymous + 3. Check subordinates of 1_2 entry is empty although hierarchy + :expectedresults: + 1. provisioning done + 2. succeed + 3. succeeds but 0 subordinates + """ + + # create an anonymous connection + topo.standalone.log.info("Bind as anonymous user") + conn = Anonymous(topo.standalone).bind() + + # Check that there are no subordinates of test_user_12 + uid = "test_user_12" + manager = "uid=%s,ou=People,%s" % (uid, DEFAULT_SUFFIX) + topo.standalone.log.info("Subordinate of manager %s on anonymous connection" % manager) + + subordinates = conn.search_s(DEFAULT_SUFFIX, SCOPE_SUBTREE, "(manager:%s:=%s)" % (INCHAIN_OID, manager)) + assert len(subordinates) == 0 + + # Check the ACI right failure + assert topo.standalone.ds_error_log.match('.*inchain - Requestor is not allowed to use InChain Matching rule$') + +def test_authenticated_inchain(topo, provision_inchain, request): + """Test that bound connection can not + retrieve subordinates (only DM is allowed by default) + + :id: 17ebee0d-86e2-4f0d-95fe-8a4cf566a493 + :setup: Standalone instance + :steps: + 1. fixture provision a hierachical tree + 2. create a test user + 3. create a bound connection + 4. Check subordinates of 1_2 entry is empty although hierarchy + :expectedresults: + 1. provisioning done + 2. succeed + 3. succeed + 4. succeeds but 0 subordinates + """ + + # create a user + RDN = "test_bound_user" + test_user = UserAccount(topo.standalone, "uid=%s,ou=People,%s" % (RDN, DEFAULT_SUFFIX)) + test_user.create(properties={ + 'uid': RDN, + 'cn': RDN, + 'sn': RDN, + 'userPassword': "password", + 'uidNumber' : '1000', + 'gidNumber' : '2000', + 'homeDirectory' : '/home/inchain', + }) + + # create a bound connection + conn = test_user.bind("password") + + # Check that there are no subordinates of test_user_12 + uid = "test_user_12" + manager = "uid=%s,ou=People,%s" % (uid, DEFAULT_SUFFIX) + topo.standalone.log.info("Subordinate of manager %s on bound connection" % manager) + + subordinates = conn.search_s(DEFAULT_SUFFIX, SCOPE_SUBTREE, "(manager:%s:=%s)" % (INCHAIN_OID, manager)) + assert len(subordinates) == 0 + + # Check the ACI right failure + assert topo.standalone.ds_error_log.match('.*inchain - Requestor is not allowed to use InChain Matching rule$') + + def fin(): + test_user.delete() + + request.addfinalizer(fin) + + +def _create_user(topology_st, ext): + user_dn = "uid=%s,ou=People,%s" % (ext, DEFAULT_SUFFIX) + topology_st.standalone.add_s(Entry((user_dn, { + 'objectclass': 'top extensibleObject'.split(), + 'uid': ext + }))) + topology_st.standalone.log.info("Create user %s" % user_dn) + return ensure_bytes(user_dn) + +def _create_group(topology_st, ext): + group_dn = "ou=%s,ou=People,%s" % (ext, DEFAULT_SUFFIX) + topology_st.standalone.add_s(Entry((group_dn, { + 'objectclass': 'top groupOfNames extensibleObject'.split(), + 'ou': ext, + 'cn': ext + }))) + topology_st.standalone.log.info("Create group %s" % group_dn) + return ensure_bytes(group_dn) + +def test_reuse_memberof(topo, request): + """Check that slapi_memberof successfully + compute the membership either using 'memberof' attribute + or either recomputing it. + + :id: e52bd21a-3ff6-493f-9ec5-8cf4e76696a0 + :setup: Standalone instance + :steps: + 1. Enable the plugin + 2. Create a user belonging in cascade to 3 groups + 3. Check that slapi_member re-computes membership + 4. Check that slapi_member retrieve membership from memberof + :expectedresults: + 1. Success + 2. Success + 3. Success + 4. Success + """ + + # enable the plugin + topo.standalone.log.info("Enable MemberOf plugin") + topo.standalone.plugins.enable(name=PLUGIN_MEMBER_OF) + topo.standalone.restart() + + # Create a user belonging to 3 goups + # in cascade + user1 = _create_user(topo, 'user1') + + group1 = _create_group(topo, 'group1') + mods = [(ldap.MOD_ADD, 'member', user1)] + topo.standalone.modify_s(ensure_str(group1), mods) + + group2 = _create_group(topo, 'group2') + mods = [(ldap.MOD_ADD, 'member', group1)] + topo.standalone.modify_s(ensure_str(group2), mods) + + group3 = _create_group(topo, 'group3') + mods = [(ldap.MOD_ADD, 'member', group2)] + topo.standalone.modify_s(ensure_str(group3), mods) + + # Call slapi_member that does *not* reuse the memberof + # because of 'memberOfEntryScope' not being set + topo.standalone.log.info("Groups that %s is memberof" % ensure_str(user1)) + + topo.standalone.config.set('nsslapd-errorlog-level', '65536') # plugin logging + memberof = topo.standalone.search_s(DEFAULT_SUFFIX, SCOPE_SUBTREE, "(member:%s:=%s)" % (INCHAIN_OID, ensure_str(user1))) + topo.standalone.config.set('nsslapd-errorlog-level', '0') + for sub in memberof: + topo.standalone.log.info("memberof found : %s" % sub.dn) + assert sub.dn in [ensure_str(group1), ensure_str(group2), ensure_str(group3)] + assert topo.standalone.ds_error_log.match('.*sm_compare_memberof_config: fails because requested include scope is not empty.*') + assert not topo.standalone.ds_error_log.match('.*slapi_memberof - sm_compare_memberof_config: succeeds. requested options match config.*') + + # Call slapi_member that does reuse the memberof + # because of 'memberOfEntryScope' being set + memberof = MemberOfPlugin(topo.standalone) + memberof.replace('memberOfEntryScope', DEFAULT_SUFFIX) + topo.standalone.restart() + topo.standalone.config.set('nsslapd-errorlog-level', '65536') # plugin logging + memberof = topo.standalone.search_s(DEFAULT_SUFFIX, SCOPE_SUBTREE, "(member:%s:=%s)" % (INCHAIN_OID, ensure_str(user1))) + topo.standalone.config.set('nsslapd-errorlog-level', '0') + for sub in memberof: + topo.standalone.log.info("memberof found : %s" % sub.dn) + assert sub.dn in [ensure_str(group1), ensure_str(group2), ensure_str(group3)] + assert topo.standalone.ds_error_log.match('.*slapi_memberof - sm_compare_memberof_config: succeeds. requested options match config.*') + + def fin(): + topo.standalone.delete_s(ensure_str(user1)) + topo.standalone.delete_s(ensure_str(group1)) + topo.standalone.delete_s(ensure_str(group2)) + topo.standalone.delete_s(ensure_str(group3)) + + request.addfinalizer(fin) + +def test_invalid_assertion(topo): + """Check that with invalid assertion + there is no returned entries + + :id: 0a204b81-e7c0-41a0-97cc-7d9425a603c2 + :setup: Standalone instance + :steps: + 1. Search with invalid assertion '..:=foo' + 2. Search with not existing entry '..:=<dummy_entry>' + :expectedresults: + 1. Success + 2. Success + """ + topo.standalone.log.info("Search with an invalid assertion") + memberof = topo.standalone.search_s(DEFAULT_SUFFIX, SCOPE_SUBTREE, "(member:%s:=foo)" % (INCHAIN_OID)) + assert len(memberof) == 0 + + topo.standalone.log.info("Search with an none exisiting entry") + + user = "uid=not_existing_entry,ou=People,%s" % (DEFAULT_SUFFIX) + memberof = topo.standalone.search_s(DEFAULT_SUFFIX, SCOPE_SUBTREE, "(member:%s:=%s)" % (INCHAIN_OID, user)) + assert len(memberof) == 0 + +if __name__ == "__main__": + CURRENT_FILE = os.path.realpath(__file__) + pytest.main("-s -v %s" % CURRENT_FILE) diff --git a/ldap/ldif/template-dse-minimal.ldif.in b/ldap/ldif/template-dse-minimal.ldif.in index 9f7c9929d..d2b02f8be 100644 --- a/ldap/ldif/template-dse-minimal.ldif.in +++ b/ldap/ldif/template-dse-minimal.ldif.in @@ -34,6 +34,14 @@ objectclass: top objectclass: nsContainer cn: features +dn: oid=1.2.840.113556.1.4.1941,cn=features,cn=config +objectClass: top +objectClass: directoryServerFeature +oid: 1.2.840.113556.1.4.1941 +cn: InChain Matching Rule +aci: (targetattr != "aci")(version 3.0; acl "InChain Matching Rule"; deny( all ) + userdn = "ldap:///anyone";) + dn: oid=1.3.6.1.4.1.42.2.27.9.5.8,cn=features,cn=config objectClass: top objectClass: directoryServerFeature @@ -439,6 +447,16 @@ nsslapd-plugininitfunc: int_init nsslapd-plugintype: syntax nsslapd-pluginenabled: on +dn: cn=In Chain,cn=plugins,cn=config +objectclass: top +objectclass: nsSlapdPlugin +objectclass: extensibleObject +cn: In Chain +nsslapd-pluginpath: libsyntax-plugin +nsslapd-plugininitfunc: inchain_init +nsslapd-plugintype: syntax +nsslapd-pluginenabled: on + dn: cn=Distinguished Name Syntax,cn=plugins,cn=config objectclass: top objectclass: nsSlapdPlugin diff --git a/ldap/ldif/template-dse.ldif.in b/ldap/ldif/template-dse.ldif.in index 3361a73fc..b1736ccc2 100644 --- a/ldap/ldif/template-dse.ldif.in +++ b/ldap/ldif/template-dse.ldif.in @@ -50,6 +50,14 @@ objectclass: top objectclass: nsContainer cn: features +dn: oid=1.2.840.113556.1.4.1941,cn=features,cn=config +objectClass: top +objectClass: directoryServerFeature +oid: 1.2.840.113556.1.4.1941 +cn: InChain Matching Rule +aci: (targetattr != "aci")(version 3.0; acl "InChain Matching Rule"; deny( all ) + userdn = "ldap:///anyone";) + dn: oid=1.3.6.1.4.1.42.2.27.9.5.8,cn=features,cn=config objectClass: top objectClass: directoryServerFeature @@ -498,6 +506,16 @@ nsslapd-plugininitfunc: int_init nsslapd-plugintype: syntax nsslapd-pluginenabled: on +dn: cn=In Chain,cn=plugins,cn=config +objectclass: top +objectclass: nsSlapdPlugin +objectclass: extensibleObject +cn: In Chain +nsslapd-pluginpath: libsyntax-plugin +nsslapd-plugininitfunc: inchain_init +nsslapd-plugintype: syntax +nsslapd-pluginenabled: on + dn: cn=Distinguished Name Syntax,cn=plugins,cn=config objectclass: top objectclass: nsSlapdPlugin diff --git a/ldap/servers/plugins/acl/aclanom.c b/ldap/servers/plugins/acl/aclanom.c index 252197856..47fc5d918 100644 --- a/ldap/servers/plugins/acl/aclanom.c +++ b/ldap/servers/plugins/acl/aclanom.c @@ -176,7 +176,9 @@ aclanom_gen_anomProfile(acl_lock_flag_t lock_flag) /* see if this is a monitor acl */ if ((strcasecmp(dn, "cn=monitor") == 0) || /* cn=monitor,cn=ldbm: No such object */ - (strcasecmp(dn, "cn=monitor,cn=ldbm") == 0)) { + (strcasecmp(dn, "cn=monitor,cn=ldbm") == 0) || + /* a 'deny' aci on supported feature should not delete anonymous profile everywhere */ + (strcasestr(dn, "cn=features,cn=config"))) { aci = acllist_get_next_aci(NULL, aci, &cookie); continue; } else { diff --git a/ldap/servers/plugins/syntaxes/inchain.c b/ldap/servers/plugins/syntaxes/inchain.c new file mode 100644 index 000000000..52d0c4994 --- /dev/null +++ b/ldap/servers/plugins/syntaxes/inchain.c @@ -0,0 +1,416 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright (C) 2023 Red Hat, Inc. + * All rights reserved. + * + * License: GPL (version 3 or any later version). + * See LICENSE for details. + * END COPYRIGHT BLOCK **/ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +/* inchain.c - in_chain syntax routines + see https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/1e889adc-b503-4423-8985-c28d5c7d4887 + */ + +#include <stdio.h> +#include <string.h> +#include <sys/types.h> +#include "syntax.h" +#include "slapi-plugin.h" + +int inchain_filter_ava(Slapi_PBlock *pb, struct berval *bvfilter, Slapi_Value **bvals, int ftype, Slapi_Value **retVal); +int inchain_filter_sub(Slapi_PBlock *pb, char *initial, char **any, char * final, Slapi_Value **bvals); +int inchain_values2keys(Slapi_PBlock *pb, Slapi_Value **val, Slapi_Value ***ivals, int ftype); +int inchain_assertion2keys_ava(Slapi_PBlock *pb, Slapi_Value *val, Slapi_Value ***ivals, int ftype); +int inchain_assertion2keys_sub(Slapi_PBlock *pb, char *initial, char **any, char * final, Slapi_Value ***ivals); +int inchain_validate(struct berval *val); +void inchain_normalize( + Slapi_PBlock *pb, + char *s, + int trim_spaces, + char **alt); + +/* the first name is the official one from RFC 4517 */ +static char *names[] = {"inchain", "inchain", LDAP_MATCHING_RULE_IN_CHAIN_OID, 0}; + +static Slapi_PluginDesc pdesc = {"inchain-matching-rule", VENDOR, DS_PACKAGE_VERSION, + "inchain matching rule plugin"}; + +static const char *inchainMatch_names[] = {"inchainMatch", "1.2.840.113556.1.4.1941", NULL}; + +static struct mr_plugin_def mr_plugin_table[] = { + { + { + "1.2.840.113556.1.4.1941", + NULL, + "inchainMatch", + "The distinguishedNameMatch rule compares an assertion value of the DN " + "syntax to an attribute value of a syntax (e.g., the DN syntax) whose " + "corresponding ASN.1 type is DistinguishedName. " + "The rule evaluates to TRUE if and only if the attribute value and the " + "assertion value have the same number of relative distinguished names " + "and corresponding relative distinguished names (by position) are the " + "same. A relative distinguished name (RDN) of the assertion value is " + "the same as an RDN of the attribute value if and only if they have " + "the same number of attribute value assertions and each attribute " + "value assertion (AVA) of the first RDN is the same as the AVA of the " + "second RDN with the same attribute type. The order of the AVAs is " + "not significant. Also note that a particular attribute type may " + "appear in at most one AVA in an RDN. Two AVAs with the same " + "attribute type are the same if their values are equal according to " + "the equality matching rule of the attribute type. If one or more of " + "the AVA comparisons evaluate to Undefined and the remaining AVA " + "comparisons return TRUE then the distinguishedNameMatch rule " + "evaluates to Undefined.", + NULL, + 0, + NULL /* dn only for now */ + }, /* matching rule desc */ + { + "inchainMatch-mr", + VENDOR, + DS_PACKAGE_VERSION, + "inchain matching rule plugin"}, /* plugin desc */ + inchainMatch_names, /* matching rule name/oid/aliases */ + NULL, + NULL, + inchain_filter_ava, + NULL, + inchain_values2keys, + inchain_assertion2keys_ava, + NULL, + NULL, + NULL /* mr_nomalise */ + }, +}; + +static size_t mr_plugin_table_size = sizeof(mr_plugin_table) / sizeof(mr_plugin_table[0]); + +static int +matching_rule_plugin_init(Slapi_PBlock *pb) +{ + return syntax_matching_rule_plugin_init(pb, mr_plugin_table, mr_plugin_table_size); +} + +static int +register_matching_rule_plugins(void) +{ + return syntax_register_matching_rule_plugins(mr_plugin_table, mr_plugin_table_size, matching_rule_plugin_init); +} + +static int +inchain_feature_allowed(Slapi_PBlock *pb) +{ + int isroot = 0; + int ldapcode = LDAP_SUCCESS; + + slapi_pblock_get(pb, SLAPI_REQUESTOR_ISROOT, &isroot); + if (!isroot) { + char *dn; + Slapi_Entry *feature = NULL; + + /* Fetch the feature entry and see if the requestor is allowed access. */ + dn = slapi_ch_smprintf("dn: oid=%s,cn=features,cn=config", LDAP_MATCHING_RULE_IN_CHAIN_OID); + if ((feature = slapi_str2entry(dn, 0)) != NULL) { + char *dummy_attr = "1.1"; + Slapi_Backend *be = NULL; + + be = slapi_mapping_tree_find_backend_for_sdn(slapi_entry_get_sdn(feature)); + if (NULL == be) { + ldapcode = LDAP_INSUFFICIENT_ACCESS; + } else { + slapi_pblock_set(pb, SLAPI_BACKEND, be); + ldapcode = slapi_access_allowed(pb, feature, dummy_attr, NULL, SLAPI_ACL_READ); + } + } + + /* If the feature entry does not exist, deny use of the control. Only + * the root DN will be allowed to use the control in this case. */ + if ((feature == NULL) || (ldapcode != LDAP_SUCCESS)) { + ldapcode = LDAP_INSUFFICIENT_ACCESS; + } + slapi_ch_free((void **)&dn); + slapi_entry_free(feature); + } + return (ldapcode); +} + +int +inchain_init(Slapi_PBlock *pb) +{ + int rc; + + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "=> inchain_init\n"); + + rc = slapi_pblock_set(pb, SLAPI_PLUGIN_VERSION, + (void *)SLAPI_PLUGIN_VERSION_01); + rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, + (void *)&pdesc); + rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_SYNTAX_FILTER_AVA, + (void *)inchain_filter_ava); + rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_SYNTAX_FILTER_SUB, + (void *)inchain_filter_sub); + rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_SYNTAX_VALUES2KEYS, + (void *)inchain_values2keys); + rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_SYNTAX_ASSERTION2KEYS_AVA, + (void *)inchain_assertion2keys_ava); + rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_SYNTAX_ASSERTION2KEYS_SUB, + (void *)inchain_assertion2keys_sub); + rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_SYNTAX_NAMES, + (void *)names); + rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_SYNTAX_OID, + (void *)LDAP_MATCHING_RULE_IN_CHAIN_OID); + rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_SYNTAX_VALIDATE, + (void *)inchain_validate); + rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_SYNTAX_NORMALIZE, + (void *)inchain_normalize); + + rc |= register_matching_rule_plugins(); + slapi_log_err(SLAPI_LOG_PLUGIN, SYNTAX_PLUGIN_SUBSYSTEM, "<= inchain_init %d\n", rc); + return (rc); +} + +int +inchain_filter_ava(Slapi_PBlock *pb, struct berval *bvfilter, Slapi_Value **bvals, int ftype, Slapi_Value **retVal) +{ + /* always true because candidate entries are valid */ + /* in theory we should check the filter but with inchain MR + * inchain_values2keys select candidates where membership attribute/value + * are not systematically present in the candidate entry (recursive call) + * this is the reason why this usual check does not apply + */ +#if 0 + int syntax = SYNTAX_CIS | SYNTAX_DN; + return (string_filter_ava(bvfilter, bvals, syntax, ftype, retVal)); +#else + return(0); +#endif +} + +int +inchain_filter_sub(Slapi_PBlock *pb, char *initial, char **any, char * final, Slapi_Value **bvals) +{ + return(1); +} + + +static PRIntn memberof_hash_compare_keys(const void *v1, const void *v2) +{ + PRIntn rc; + if (0 == strcasecmp((const char *) v1, (const char *) v2)) { + rc = 1; + } else { + rc = 0; + } + return rc; +} + +static PRIntn memberof_hash_compare_values(const void *v1, const void *v2) +{ + PRIntn rc; + if ((char *) v1 == (char *) v2) { + rc = 1; + } else { + rc = 0; + } + return rc; +} + +/* + * Hashing function using Bernstein's method + */ +static PLHashNumber memberof_hash_fn(const void *key) +{ + PLHashNumber hash = 5381; + unsigned char *x = (unsigned char *)key; + int c; + + while ((c = *x++)){ + hash = ((hash << 5) + hash) ^ c; + } + return hash; +} + +/* allocates the plugin hashtable + * This hash table is used by operation and is protected from + * concurrent operations with the memberof_lock (if not usetxn, memberof_lock + * is not implemented and the hash table will be not used. + * + * The hash table contains all the DN of the entries for which the memberof + * attribute has been computed/updated during the current operation + * + * hash table should be empty at the beginning and end of the plugin callback + */ +PLHashTable *hashtable_new(int usetxn) +{ + if (!usetxn) { + return NULL; + } + + return PL_NewHashTable(1000, + memberof_hash_fn, + memberof_hash_compare_keys, + memberof_hash_compare_values, NULL, NULL); +} +int +inchain_values2keys(Slapi_PBlock *pb, Slapi_Value **vals, Slapi_Value ***ivals, int ftype) +{ + Slapi_MemberOfResult groupvals = {0}; + Slapi_ValueSet *groupdn_vals; + Slapi_Value **result; + int nbvalues; + Slapi_Value *v; + Slapi_MemberOfConfig config = {0}; + Slapi_DN *member_sdn; + Slapi_DN *base_sdn = NULL; + size_t idx = 0; + char *mrTYPE; +#if 0 + char *filter_str; +#endif + char error_msg[1024] = {0}; + int rc; + + slapi_pblock_get(pb, SLAPI_PLUGIN_MR_TYPE, &mrTYPE); + slapi_pblock_get(pb, SLAPI_SEARCH_TARGET_SDN, &base_sdn); + + if (! slapi_attr_is_dn_syntax_type(mrTYPE)) { + slapi_log_err(SLAPI_LOG_ERR, "inchain", "Requires distinguishedName syntax. AttributeDescription %s is not distinguishedName\n"); + result = (Slapi_Value **)slapi_ch_calloc(1, sizeof(Slapi_Value *)); + *ivals = result; + return(0); + } + + /* check if the user is allowed to perform inChain matching */ + if (inchain_feature_allowed(pb) != LDAP_SUCCESS) { + slapi_log_err(SLAPI_LOG_ERR, "inchain", "Requestor is not allowed to use InChain Matching rule\n"); + result = (Slapi_Value **)slapi_ch_calloc(1, sizeof(Slapi_Value *)); + *ivals = result; + return(0); + } + + /* it is used only in case of MEMBEROF_REUSE_ONLY of MEMBEROF_REUSE_IF_POSSIBLE + * to reuse potential results from memberof plugin + * So its value is only "memberof" + */ + config.memberof_attr = "memberof"; + config.groupattrs = (char **) slapi_ch_calloc(sizeof(char*), 2); + config.groupattrs[0] = mrTYPE; + config.groupattrs[1] = NULL; + config.subtree_search = PR_FALSE; + config.allBackends = 0; + config.entryScopes = (Slapi_DN **)slapi_ch_calloc(sizeof(Slapi_DN *), 2); + /* only looking in the base search scope */ + config.entryScopes[0] = slapi_sdn_dup((const Slapi_DN *) base_sdn); + + /* no exclusion for inchain */ + config.entryScopeExcludeSubtrees = NULL; + +#if 0 + filter_str = slapi_ch_smprintf("(%s=*)", "manager"); + config.group_filter = slapi_str2filter(filter_str); + + config.group_slapiattrs = (Slapi_Attr **)slapi_ch_calloc(sizeof(Slapi_Attr *), 3); + config.group_slapiattrs[0] = slapi_attr_new(); + config.group_slapiattrs[1] = slapi_attr_new(); + slapi_attr_init(config.group_slapiattrs[0], "manager"); + slapi_attr_init(config.group_slapiattrs[1], "nsuniqueid"); +#endif + config.recurse = PR_TRUE; + config.maxgroups = 0; + config.flag = MEMBEROF_REUSE_IF_POSSIBLE; + config.error_msg = error_msg; + config.errot_msg_lenght = sizeof(error_msg); + + member_sdn = slapi_sdn_new_dn_byval((const char*) vals[0]->bv.bv_val); + rc = slapi_memberof(&config, member_sdn, &groupvals); + if (rc) { + slapi_log_err(SLAPI_LOG_ERR, "inchain", " slapi_memberof fails %d (msg=%s)\n", rc, error_msg); + } +#if 0 + slapi_filter_free(config.group_filter, 1); + slapi_attr_free(&config.group_slapiattrs[0]); + slapi_attr_free(&config.group_slapiattrs[1]); +#endif + groupdn_vals = groupvals.nsuniqueid_vals; + idx = slapi_valueset_first_value(groupdn_vals, &v); + for (; groupdn_vals && v; idx = slapi_valueset_next_value(groupdn_vals, idx, &v)) { + char value[1000]; + strncpy(value, v->bv.bv_val, v->bv.bv_len); + value[v->bv.bv_len] = '\0'; + slapi_log_err(SLAPI_LOG_FILTER, "inchain", " groupvals = %s\n", value); + + } + +#if 1 + + nbvalues = slapi_valueset_count(groupdn_vals); + result = (Slapi_Value **)slapi_ch_calloc(nbvalues + 1, sizeof(Slapi_Value *)); + for(idx = 0; idx < slapi_valueset_count(groupdn_vals); idx++) { + char value[1000]; + + result[idx] = slapi_value_dup(groupdn_vals->va[idx]); + strncpy(value, result[idx]->bv.bv_val, result[idx]->bv.bv_len); + value[result[idx]->bv.bv_len] = '\0'; + slapi_log_err(SLAPI_LOG_FILTER, "inchain", "copy key %s \n", value); + } + if (groupvals.dn_vals) { + slapi_valueset_free(groupvals.dn_vals); + groupvals.dn_vals = NULL; + } + if (groupvals.nsuniqueid_vals) { + slapi_valueset_free(groupvals.nsuniqueid_vals); + groupvals.nsuniqueid_vals = NULL; + } + *ivals = result; + return(0); +#else + return (string_values2keys(pb, vals, ivals, SYNTAX_CIS | SYNTAX_DN, + ftype)); +#endif +} + +int +inchain_assertion2keys_ava(Slapi_PBlock *pb, Slapi_Value *val, Slapi_Value ***ivals, int ftype) +{ + slapi_log_err(SLAPI_LOG_ERR, "inchain", "inchain_assertion2keys_ava \n"); + return (string_assertion2keys_ava(pb, val, ivals, + SYNTAX_CIS | SYNTAX_DN, ftype)); +} + +int +inchain_assertion2keys_sub(Slapi_PBlock *pb, char *initial, char **any, char * final, Slapi_Value ***ivals) +{ + slapi_log_err(SLAPI_LOG_ERR, "inchain", "inchain_assertion2keys_sub \n"); + return (string_assertion2keys_sub(pb, initial, any, final, ivals, + SYNTAX_CIS | SYNTAX_DN)); +} + +int +inchain_validate(struct berval *val) +{ + int rc = 0; /* Assume value is valid */ + + /* A 0 length value is valid for the DN syntax. */ + if (val == NULL) { + rc = 1; + } else if (val->bv_len > 0) { + rc = distinguishedname_validate(val->bv_val, &(val->bv_val[val->bv_len - 1])); + } + + return rc; +} + +void +inchain_normalize( + Slapi_PBlock *pb __attribute__((unused)), + char *s, + int trim_spaces, + char **alt) +{ + slapi_log_err(SLAPI_LOG_ERR, "inchain", "inchain_normalize %s \n", s); + value_normalize_ext(s, SYNTAX_CIS | SYNTAX_DN, trim_spaces, alt); + return; +} diff --git a/ldap/servers/slapd/back-ldbm/filterindex.c b/ldap/servers/slapd/back-ldbm/filterindex.c index 3bcd71584..d49805379 100644 --- a/ldap/servers/slapd/back-ldbm/filterindex.c +++ b/ldap/servers/slapd/back-ldbm/filterindex.c @@ -451,6 +451,7 @@ extensible_candidates( Slapi_PBlock *pb = slapi_pblock_new(); int mrOP = 0; Slapi_Operation *op = NULL; + Connection *conn = NULL; back_txn txn = {NULL}; slapi_log_err(SLAPI_LOG_TRACE, "extensible_candidates", "=> \n"); slapi_pblock_get(glob_pb, SLAPI_TXN, &txn.back_txn_txn); @@ -470,8 +471,11 @@ extensible_candidates( /* set the pb->pb_op to glob_pb->pb_op to catch the abandon req. * in case the operation is interrupted. */ slapi_pblock_get(glob_pb, SLAPI_OPERATION, &op); + slapi_pblock_get(glob_pb, SLAPI_CONNECTION, &conn); /* coverity[var_deref_model] */ slapi_pblock_set(pb, SLAPI_OPERATION, op); + slapi_pblock_set(pb, SLAPI_CONNECTION, conn); + slapi_pblock_set(pb, SLAPI_REQUESTOR_ISROOT, &op->o_isroot); slapi_pblock_get(pb, SLAPI_PLUGIN_MR_INDEX_FN, &mrINDEX); slapi_pblock_get(pb, SLAPI_PLUGIN_OBJECT, &mrOBJECT); @@ -516,16 +520,36 @@ extensible_candidates( } else if (keys == NULL || keys[0] == NULL) { /* no keys */ idl_free(&idl); - idl = idl_allids(be); + if (strcmp(mrOID, LDAP_MATCHING_RULE_IN_CHAIN_OID) == 0) { + /* we need to return no candidate else, inchain_filter_ava + * matching all candidates, the search returns invalid results + */ + idl = idl_alloc(0); + } else { + idl = idl_allids(be); + } } else { IDList *idl2 = NULL; struct berval **key; +#define KEY_STR_LGHT 35 /* stollen from nsuniqueid.c UIDSTR_SIZE 35 */ + char key_str[KEY_STR_LGHT + 1]; /* only used for debug logging */ for (key = keys; *key != NULL; ++key) { int unindexed = 0; IDList *idl3 = (mrOP == SLAPI_OP_EQUAL) ? index_read_ext_allids(pb, be, mrTYPE, mrOID, *key, &txn, err, &unindexed, allidslimit) : index_range_read_ext(pb, be, mrTYPE, mrOID, mrOP, *key, NULL, 0, &txn, err, allidslimit); + if (slapi_is_loglevel_set(SLAPI_LOG_FILTER)) { + int lenght_str = key[0]->bv_len; + + if (key[0]->bv_len > KEY_STR_LGHT) { + lenght_str = KEY_STR_LGHT; + } + + strncpy(key_str, key[0]->bv_val, lenght_str); + key_str[lenght_str] = '\0'; + slapi_log_err(SLAPI_LOG_FILTER, "extensible_candidates", "=> idl (%s) = (%d)\n", key_str, idl3->b_ids[0]); + } if (unindexed) { int pr_idx = -1; slapi_pblock_set_flag_operation_notes(pb, SLAPI_OP_NOTE_UNINDEXED); @@ -542,7 +566,12 @@ extensible_candidates( /* first iteration */ idl2 = idl3; } else { - IDList *tmp = idl_intersection(be, idl2, idl3); + IDList *tmp; + if (strcmp(mrOID, LDAP_MATCHING_RULE_IN_CHAIN_OID) == 0) { + tmp = idl_union(be, idl2, idl3); + } else { + tmp = idl_intersection(be, idl2, idl3); + } idl_free(&idl2); idl_free(&idl3); idl2 = tmp; @@ -575,8 +604,11 @@ extensible_candidates( } return_idl: op = NULL; + conn = NULL; + /* coverity[var_deref_model] */ slapi_pblock_set(pb, SLAPI_OPERATION, op); + slapi_pblock_set(pb, SLAPI_CONNECTION, conn); slapi_pblock_destroy(pb); slapi_log_err(SLAPI_LOG_TRACE, "extensible_candidates", "<= %lu\n", (u_long)IDL_NIDS(idl)); diff --git a/ldap/servers/slapd/back-ldbm/index.c b/ldap/servers/slapd/back-ldbm/index.c index 5b34a1e87..86bc825fe 100644 --- a/ldap/servers/slapd/back-ldbm/index.c +++ b/ldap/servers/slapd/back-ldbm/index.c @@ -924,6 +924,10 @@ index_read_ext_allids( *err = 0; + if (strcmp(indextype, LDAP_MATCHING_RULE_IN_CHAIN_OID) == 0) { + type = "nsuniqueid"; + indextype = indextype_EQUALITY; + } if (unindexed != NULL) *unindexed = 0; prefix = index_index2prefix(indextype); diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h index 40f5cebb0..aea052983 100644 --- a/ldap/servers/slapd/slap.h +++ b/ldap/servers/slapd/slap.h @@ -751,6 +751,7 @@ typedef int (*SyntaxEnumFunc)(char **names, Slapi_PluginDesc *plugindesc, void * #define INTEGERORDERINGMATCH_OID "2.5.13.15" /* integerOrderingMatch */ #define INTFIRSTCOMPMATCH_OID "2.5.13.29" /* integerFirstComponentMatch */ #define OIDFIRSTCOMPMATCH_OID "2.5.13.30" /* objectIdentifierFirstComponentMatch */ +#define LDAP_MATCHING_RULE_IN_CHAIN_OID "1.2.840.113556.1.4.1941" /* Names for some commonly used matching rules */ #define DNMATCH_NAME "distinguishedNameMatch" @@ -759,6 +760,7 @@ typedef int (*SyntaxEnumFunc)(char **names, Slapi_PluginDesc *plugindesc, void * #define INTEGERORDERINGMATCH_NAME "integerOrderingMatch" #define INTFIRSTCOMPMATCH_NAME "integerFirstComponentMatch" #define OIDFIRSTCOMPMATCH_NAME "objectIdentifierFirstComponentMatch" +#define LDAP_MATCHING_RULE_IN_CHAIN_NAME "ancestryDNMatch" #define ATTR_STANDARD_STRING "Standard Attribute" #define ATTR_USERDEF_STRING "User Defined Attribute" diff --git a/ldap/servers/slapd/slapi-memberof.c b/ldap/servers/slapd/slapi-memberof.c index 6f39965bb..f71fd8854 100644 --- a/ldap/servers/slapd/slapi-memberof.c +++ b/ldap/servers/slapd/slapi-memberof.c @@ -784,12 +784,12 @@ sm_compare_memberof_config(const char *memberof_attr, char **groupattrs, PRBool int32_t cnt1, cnt2; if ((memberof_config == NULL) || (memberof_config->enabled == PR_FALSE)) { - slapi_log_err(SLAPI_LOG_ERR, "slapi_memberof", "sm_compare_memberof_config: config not initialized or disabled\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_memberof", "sm_compare_memberof_config: config not initialized or disabled\n"); return PR_FALSE; } if (enabled_only) { - slapi_log_err(SLAPI_LOG_ERR, "slapi_memberof", "sm_compare_memberof_config: check the plugin is enabled that is %s\n", + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_memberof", "sm_compare_memberof_config: check the plugin is enabled that is %s\n", memberof_config->enabled ? "SUCCEEDS" : "FAILS"); if (memberof_config->enabled) { return PR_TRUE; @@ -801,7 +801,7 @@ sm_compare_memberof_config(const char *memberof_attr, char **groupattrs, PRBool /* Check direct flags */ if ((all_backends != memberof_config->all_backends) || (skip_nested != memberof_config->skip_nested)) { /* If those flags do not match the current set of 'memberof' values is invalid */ - slapi_log_err(SLAPI_LOG_ERR, "slapi_memberof", "sm_compare_memberof_config: fails (allbackend %d vs %d, skip_nested %d vs %d)\n", + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_memberof", "sm_compare_memberof_config: fails (allbackend %d vs %d, skip_nested %d vs %d)\n", all_backends, memberof_config->all_backends, skip_nested, memberof_config->skip_nested); return PR_FALSE; } @@ -811,7 +811,7 @@ sm_compare_memberof_config(const char *memberof_attr, char **groupattrs, PRBool */ if ((memberof_attr == NULL) || (memberof_config->memberof_attr == NULL) || (strcasecmp(memberof_attr, memberof_config->memberof_attr))) { /* just be conservative, we should speak about the same attribute */ - slapi_log_err(SLAPI_LOG_ERR, "slapi_memberof", + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_memberof", "sm_compare_memberof_config: fails memberof attribute differs (require '%s' vs config '%s')\n", memberof_attr ? memberof_attr : "NULL", memberof_config->memberof_attr ? memberof_config->memberof_attr : NULL); @@ -823,12 +823,12 @@ sm_compare_memberof_config(const char *memberof_attr, char **groupattrs, PRBool */ if (groupattrs == NULL) { /* This is a mandatory parameter */ - slapi_log_err(SLAPI_LOG_ERR, "slapi_memberof", "sm_compare_memberof_config: fails because requested group attributes is empty\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_memberof", "sm_compare_memberof_config: fails because requested group attributes is empty\n"); return PR_FALSE; } for (cnt1 = 0; groupattrs[cnt1]; cnt1++) { if (charray_inlist(memberof_config->groupattrs, groupattrs[cnt1]) == 0) { - slapi_log_err(SLAPI_LOG_ERR, "slapi_memberof", + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_memberof", "sm_compare_memberof_config: fails because requested group attribute '%s' is not configured\n", groupattrs[cnt1]); return PR_FALSE; @@ -837,26 +837,26 @@ sm_compare_memberof_config(const char *memberof_attr, char **groupattrs, PRBool for (cnt2 = 0; memberof_config->groupattrs && memberof_config->groupattrs[cnt2]; cnt2++); if (cnt1 != cnt2) { /* make sure groupattrs is not a subset of memberof_config->groupattrs */ - slapi_log_err(SLAPI_LOG_ERR, "slapi_memberof", "sm_compare_memberof_config: fails because number of requested group attributes differs from config\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_memberof", "sm_compare_memberof_config: fails because number of requested group attributes differs from config\n"); return PR_FALSE; } /* check Include scope that is optional */ if (include_scope == NULL) { if (memberof_config->include_scope) { - slapi_log_err(SLAPI_LOG_ERR, "slapi_memberof", "sm_compare_memberof_config: fails because requested include scope is empty that differs config\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_memberof", "sm_compare_memberof_config: fails because requested include scope is empty that differs config\n"); return PR_FALSE; } } else { if (memberof_config->include_scope == NULL) { - slapi_log_err(SLAPI_LOG_ERR, "slapi_memberof", "sm_compare_memberof_config: fails because requested include scope is not empty that differs config\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_memberof", "sm_compare_memberof_config: fails because requested include scope is not empty that differs config\n"); return PR_FALSE; } } /* here include scopes are both NULL or both not NULL */ for (cnt1 = 0; include_scope && include_scope[cnt1]; cnt1++) { if (charray_inlist(memberof_config->include_scope, (char *) slapi_sdn_get_ndn(include_scope[cnt1])) == 0) { - slapi_log_err(SLAPI_LOG_ERR, "slapi_memberof", "sm_compare_memberof_config: fails because requested include scope (%s) is not in config\n", + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_memberof", "sm_compare_memberof_config: fails because requested include scope (%s) is not in config\n", slapi_sdn_get_ndn(include_scope[cnt1])); return PR_FALSE; } @@ -864,26 +864,26 @@ sm_compare_memberof_config(const char *memberof_attr, char **groupattrs, PRBool for (cnt2 = 0; memberof_config->include_scope && memberof_config->include_scope[cnt2]; cnt2++); if (cnt1 != cnt2) { /* make sure include_scope is not a subset of memberof_config->include_scope */ - slapi_log_err(SLAPI_LOG_ERR, "slapi_memberof", "sm_compare_memberof_config: fails because number of requested included scopes differs from config\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_memberof", "sm_compare_memberof_config: fails because number of requested included scopes differs from config\n"); return PR_FALSE; } /* check Exclude scope that is optional */ if (exclude_scope == NULL) { if (memberof_config->exclude_scope) { - slapi_log_err(SLAPI_LOG_ERR, "slapi_memberof", "sm_compare_memberof_config: fails because requested exclude scope is empty that differs config\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_memberof", "sm_compare_memberof_config: fails because requested exclude scope is empty that differs config\n"); return PR_FALSE; } } else { if (memberof_config->exclude_scope == NULL) { - slapi_log_err(SLAPI_LOG_ERR, "slapi_memberof", "sm_compare_memberof_config: fails because requested exclude scope is not empty that differs config\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_memberof", "sm_compare_memberof_config: fails because requested exclude scope is not empty that differs config\n"); return PR_FALSE; } } /* here exclude scopes are both NULL or both not NULL */ for (cnt1 = 0; exclude_scope && exclude_scope[cnt1]; cnt1++) { if (charray_inlist(memberof_config->exclude_scope, (char *) slapi_sdn_get_ndn(exclude_scope[cnt1])) == 0) { - slapi_log_err(SLAPI_LOG_ERR, "slapi_memberof", "sm_compare_memberof_config: fails because requested exclude scope (%s) is not in config\n", + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_memberof", "sm_compare_memberof_config: fails because requested exclude scope (%s) is not in config\n", slapi_sdn_get_ndn(exclude_scope[cnt1])); return PR_FALSE; } @@ -891,10 +891,10 @@ sm_compare_memberof_config(const char *memberof_attr, char **groupattrs, PRBool for (cnt2 = 0; memberof_config->exclude_scope && memberof_config->exclude_scope[cnt2]; cnt2++); if (cnt1 != cnt2) { /* make sure exclude_scope is not a subset of memberof_config->exclude_scope */ - slapi_log_err(SLAPI_LOG_ERR, "slapi_memberof", "sm_compare_memberof_config: fails because number of requested exclude scopes differs from config\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_memberof", "sm_compare_memberof_config: fails because number of requested exclude scopes differs from config\n"); return PR_FALSE; } - slapi_log_err(SLAPI_LOG_ERR, "slapi_memberof", "sm_compare_memberof_config: succeeds. requested options match config\n"); + slapi_log_err(SLAPI_LOG_PLUGIN, "slapi_memberof", "sm_compare_memberof_config: succeeds. requested options match config\n"); return PR_TRUE; }
0
1b5a578b4dd95a4188d7e5be984f13484b993ca2
389ds/389-ds-base
Issue 47662 - CLI args get removed Bug Description. Regression from previous fix. The process to check unknown CLI options blows away the built-in arg list "$@" Fix Description: Make a copy of $@, and use it as needed. https://pagure.io/389-ds-base/issue/47662 Reviewed by: nhosoi(Thanks!)
commit 1b5a578b4dd95a4188d7e5be984f13484b993ca2 Author: Mark Reynolds <[email protected]> Date: Mon Apr 10 14:55:55 2017 -0400 Issue 47662 - CLI args get removed Bug Description. Regression from previous fix. The process to check unknown CLI options blows away the built-in arg list "$@" Fix Description: Make a copy of $@, and use it as needed. https://pagure.io/389-ds-base/issue/47662 Reviewed by: nhosoi(Thanks!) diff --git a/ldap/admin/src/scripts/db2ldif.in b/ldap/admin/src/scripts/db2ldif.in index 85854b352..08f30e46d 100755 --- a/ldap/admin/src/scripts/db2ldif.in +++ b/ldap/admin/src/scripts/db2ldif.in @@ -130,6 +130,7 @@ do esac done +ARGS=$@ shift $(($OPTIND - 1)) if [ $1 ] then @@ -156,7 +157,7 @@ fi servid=`normalize_server_id $initfile` . $initfile -ldif_file=`make_ldiffile $@` +ldif_file=`make_ldiffile $ARGS` rn=$? echo "Exported ldif file: $ldif_file" diff --git a/ldap/admin/src/scripts/ldif2db.in b/ldap/admin/src/scripts/ldif2db.in index f9683039d..20c7d46d5 100755 --- a/ldap/admin/src/scripts/ldif2db.in +++ b/ldap/admin/src/scripts/ldif2db.in @@ -87,6 +87,7 @@ then exit 1 fi +ARGS=$@ shift $(($OPTIND - 1)) if [ $1 ] then @@ -106,7 +107,7 @@ fi . $initfile -handleopts $@ +handleopts $ARGS quiet=$? if [ $quiet -eq 0 ]; then echo importing data ...
0
1aeaf342ff5050cfda23e05ae66b180a56a70e0e
389ds/389-ds-base
Ticket #48026 - Support for uniqueness plugin to enforce uniqueness on a set of attributes. Coverity defect 13088 - Wrong sized argument Introduced by commit 430410d75446cdf58e6f020e1463b590abd870ab Description: allocated the size of pointer instead of the size of character times attribute length. The unit was fixed. https://fedorahosted.org/389/ticket/48026 Reviewed and tested by William B <[email protected]>. Thank you, William!!
commit 1aeaf342ff5050cfda23e05ae66b180a56a70e0e Author: Noriko Hosoi <[email protected]> Date: Tue Feb 24 11:00:30 2015 -0800 Ticket #48026 - Support for uniqueness plugin to enforce uniqueness on a set of attributes. Coverity defect 13088 - Wrong sized argument Introduced by commit 430410d75446cdf58e6f020e1463b590abd870ab Description: allocated the size of pointer instead of the size of character times attribute length. The unit was fixed. https://fedorahosted.org/389/ticket/48026 Reviewed and tested by William B <[email protected]>. Thank you, William!! diff --git a/ldap/servers/plugins/uiduniq/uid.c b/ldap/servers/plugins/uiduniq/uid.c index 282f6186c..b9c4e7200 100644 --- a/ldap/servers/plugins/uiduniq/uid.c +++ b/ldap/servers/plugins/uiduniq/uid.c @@ -367,7 +367,7 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry) for (i = 0; tmp_config->attrs && (tmp_config->attrs)[i]; i++) { attrLen += strlen((tmp_config->attrs)[i]) + 1; } - tmp_config->attr_friendly = (char *) slapi_ch_calloc(attrLen, sizeof(char *)); + tmp_config->attr_friendly = (char *) slapi_ch_calloc(attrLen, sizeof(char)); fp = tmp_config->attr_friendly; for (i = 0; tmp_config->attrs && (tmp_config->attrs)[i]; i++) { strcpy(fp, (tmp_config->attrs)[i] );
0
775a58cd44e08a4a558e0a4c92a1ce25edd05181
389ds/389-ds-base
Ticket 49185 - Fix memleak in compute init Bug Description: bak2db would jump to goto: cleanup, which bypasses the compute cleanup. Fix Description: Move the compute terminate step. https://pagure.io/389-ds-base/issue/49185 Author: wibrown Review by: mreynolds (Thanks!)
commit 775a58cd44e08a4a558e0a4c92a1ce25edd05181 Author: William Brown <[email protected]> Date: Wed Mar 22 17:06:16 2017 +1000 Ticket 49185 - Fix memleak in compute init Bug Description: bak2db would jump to goto: cleanup, which bypasses the compute cleanup. Fix Description: Move the compute terminate step. https://pagure.io/389-ds-base/issue/49185 Author: wibrown Review by: mreynolds (Thanks!) diff --git a/ldap/servers/slapd/main.c b/ldap/servers/slapd/main.c index 2f12b2fdd..698946c5f 100644 --- a/ldap/servers/slapd/main.c +++ b/ldap/servers/slapd/main.c @@ -1153,10 +1153,10 @@ main( int argc, char **argv) } slapi_log_err(SLAPI_LOG_INFO, "main", "slapd stopped.\n"); reslimit_cleanup(); - compute_terminate(); vattr_cleanup(); sasl_map_done(); cleanup: + compute_terminate(); SSL_ShutdownServerSessionIDCache(); SSL_ClearSessionCache(); ndn_cache_destroy();
0
e78dfe0f2faccd7f63ee5fad857b7518258ff751
389ds/389-ds-base
Ticket 49271 - Fix pbkdf2 and openssl missing issue Bug Description: NSS 3.28 and lower don't support pbkdf2. If we are on this version, don't run the tests. We never released this feature for older rhel, so it only affects the test. Fix Description: ifdef out the tests if NSS is too old. https://pagure.io/389-ds-base/issue/49271 Author: wibrown Review by: mreynolds (Thanks!)
commit e78dfe0f2faccd7f63ee5fad857b7518258ff751 Author: William Brown <[email protected]> Date: Mon May 29 12:12:39 2017 +1000 Ticket 49271 - Fix pbkdf2 and openssl missing issue Bug Description: NSS 3.28 and lower don't support pbkdf2. If we are on this version, don't run the tests. We never released this feature for older rhel, so it only affects the test. Fix Description: ifdef out the tests if NSS is too old. https://pagure.io/389-ds-base/issue/49271 Author: wibrown Review by: mreynolds (Thanks!) diff --git a/test/plugins/pwdstorage/pbkdf2.c b/test/plugins/pwdstorage/pbkdf2.c index 0193fbb84..f2cc1b4b1 100644 --- a/test/plugins/pwdstorage/pbkdf2.c +++ b/test/plugins/pwdstorage/pbkdf2.c @@ -27,6 +27,7 @@ test_plugin_pwdstorage_nss_stop(void **state __attribute__((unused))) { void test_plugin_pwdstorage_pbkdf2_auth(void **state __attribute__((unused))) { +#if (NSS_VMAJOR * 100 + NSS_VMINOR) > 328 /* Check that given various known passwords and hashes they validate (or don't) */ /* 'password' */ @@ -49,10 +50,12 @@ test_plugin_pwdstorage_pbkdf2_auth(void **state __attribute__((unused))) { assert_false(pbkdf2_sha256_pw_cmp("password", password_a_rounds) == 0); assert_false(pbkdf2_sha256_pw_cmp("password", password_a_salt) == 0); assert_false(pbkdf2_sha256_pw_cmp("password_b", password_a) == 0); +#endif } void test_plugin_pwdstorage_pbkdf2_rounds(void **state __attribute__((unused))){ +#if (NSS_VMAJOR * 100 + NSS_VMINOR) > 328 /* Check the benchmark, and make sure we get a valid timestamp */ assert_true(pbkdf2_sha256_benchmark_iterations() > 0); /* @@ -69,5 +72,6 @@ test_plugin_pwdstorage_pbkdf2_rounds(void **state __attribute__((unused))){ assert_true(pbkdf2_sha256_calculate_iterations(200000000) == 10000); assert_true(pbkdf2_sha256_calculate_iterations(100000000) == 20000); assert_true(pbkdf2_sha256_calculate_iterations(50000000) == 40000); +#endif }
0
407d7d9de7e9c4db1e4c1f5a1a98890f2474c477
389ds/389-ds-base
Ticket 49097 - fix the pblock to be a hierachial structure Bug Description: The pblock was a giant kitchen sink: 712 bytes, and analysis showed that normally 80% or more was NULL. We practically take RAM and set fire to it wastefully. Fix Description: because the pblock is accessed via get/set, we can rearrange the internals to a hierachy (tree) of sub-structures that are dynamically allocated as required. Each sub structure is a grouping of commonly used fields, which aids cache coherrency, reduces our memory allocation footprint, and also improves our performance as we are allocating and freeing less. https://pagure.io/389-ds-base/issue/49097 Author: wibrown Review by: mreynolds (Thanks!)
commit 407d7d9de7e9c4db1e4c1f5a1a98890f2474c477 Author: William Brown <[email protected]> Date: Fri Apr 28 09:15:09 2017 +1000 Ticket 49097 - fix the pblock to be a hierachial structure Bug Description: The pblock was a giant kitchen sink: 712 bytes, and analysis showed that normally 80% or more was NULL. We practically take RAM and set fire to it wastefully. Fix Description: because the pblock is accessed via get/set, we can rearrange the internals to a hierachy (tree) of sub-structures that are dynamically allocated as required. Each sub structure is a grouping of commonly used fields, which aids cache coherrency, reduces our memory allocation footprint, and also improves our performance as we are allocating and freeing less. https://pagure.io/389-ds-base/issue/49097 Author: wibrown Review by: mreynolds (Thanks!) diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c index 4f03c902d..11f085c29 100644 --- a/ldap/servers/slapd/pblock.c +++ b/ldap/servers/slapd/pblock.c @@ -23,6 +23,15 @@ #define NUMBER_SLAPI_ATTRS 320 #define ANALYTICS_MAGIC 0x7645 +#define SLAPI_OP_STACK_ELEM 2001 +#define SLAPI_VATTR_CONTEXT 2002 +#define SLAPI_LDIF_DUMP_REPLICA 2003 +#define SLAPI_PWDPOLICY 2004 +#define SLAPI_PW_ENTRY 2005 + +/* Used for checking assertions about pblocks in some cases. */ +#define SLAPI_HINT 9999 + static PRLock *pblock_analytics_lock = NULL; static PLHashNumber @@ -193,9 +202,20 @@ pblock_done( Slapi_PBlock *pb ) operation_free(&pb->pb_op,pb->pb_conn); pb->pb_op = NULL; } - delete_passwdPolicy(&pb->pwdpolicy); - slapi_ch_free((void**)&(pb->pb_vattr_context)); - slapi_ch_free((void**)&(pb->pb_result_text)); + slapi_ch_free((void**)&(pb->pb_dse)); + slapi_ch_free((void**)&(pb->pb_task)); + slapi_ch_free((void**)&(pb->pb_mr)); + slapi_ch_free((void**)&(pb->pb_deprecated)); + slapi_ch_free((void**)&(pb->pb_misc)); + if (pb->pb_intop != NULL) { + delete_passwdPolicy(&pb->pb_intop->pwdpolicy); + slapi_ch_free((void**)&(pb->pb_intop->pb_result_text)); + } + slapi_ch_free((void**)&(pb->pb_intop)); + if (pb->pb_intplugin != NULL) { + slapi_ch_free((void**)&(pb->pb_intplugin->pb_vattr_context)); + } + slapi_ch_free((void**)&(pb->pb_intplugin)); } void @@ -208,12 +228,101 @@ slapi_pblock_destroy( Slapi_PBlock* pb ) } } +/* functions to alloc internals if needed */ +static inline void __attribute__((always_inline)) +_pblock_assert_pb_dse(Slapi_PBlock *pblock) { + if (pblock->pb_dse == NULL) { + pblock->pb_dse = slapi_ch_calloc(1, sizeof(slapi_pblock_dse)); + } +} + +static inline void __attribute__((always_inline)) +_pblock_assert_pb_task(Slapi_PBlock *pblock) { + if (pblock->pb_task == NULL) { + pblock->pb_task = slapi_ch_calloc(1, sizeof(slapi_pblock_task)); + } +} + +static inline void __attribute__((always_inline)) +_pblock_assert_pb_mr(Slapi_PBlock *pblock) { + if (pblock->pb_mr == NULL) { + pblock->pb_mr = slapi_ch_calloc(1, sizeof(slapi_pblock_matching_rule)); + } +} + +static inline void __attribute__((always_inline)) +_pblock_assert_pb_misc(Slapi_PBlock *pblock) { + if (pblock->pb_misc == NULL) { + pblock->pb_misc = slapi_ch_calloc(1, sizeof(slapi_pblock_misc)); + } +} + +static inline void __attribute__((always_inline)) +_pblock_assert_pb_intop(Slapi_PBlock *pblock) { + if (pblock->pb_intop == NULL) { + pblock->pb_intop = slapi_ch_calloc(1, sizeof(slapi_pblock_intop)); + } +} + +static inline void __attribute__((always_inline)) +_pblock_assert_pb_intplugin(Slapi_PBlock *pblock) { + if (pblock->pb_intplugin == NULL) { + pblock->pb_intplugin = slapi_ch_calloc(1, sizeof(slapi_pblock_intplugin)); + } +} + +static inline void __attribute__((always_inline)) +_pblock_assert_pb_deprecated(Slapi_PBlock *pblock) { + if (pblock->pb_deprecated == NULL) { + pblock->pb_deprecated = slapi_ch_calloc(1, sizeof(slapi_pblock_deprecated)); + } +} + Slapi_PBlock * slapi_pblock_clone(Slapi_PBlock *pb) { + /* + * This is used only in psearch, with an access pattern of + * ['13:3', '191:28', '47:18', '2001:1', '115:3', '503:3', '196:10', '52:18', '1930:3', '133:189', '112:13', '57:1', '214:91', '70:93', '193:14', '49:10', '403:6', '117:2', '1001:1', '130:161', '109:2', '198:36', '510:27', '1945:3', '114:16', '4:11', '216:91', '712:11', '195:19', '51:26', '140:10', '2005:18', '9:2', '132:334', '111:1', '1160:1', '410:54', '48:1', '2002:156', '116:3', '1000:22', '53:27', '9999:1', '113:13', '3:132', '590:3', '215:91', '194:20', '118:1', '131:30', '860:2', '110:14', ] + */ Slapi_PBlock *new_pb = slapi_pblock_new(); + new_pb->pb_backend = pb->pb_backend; + new_pb->pb_conn = pb->pb_conn; + new_pb->pb_op = pb->pb_op; + new_pb->pb_plugin = pb->pb_plugin; /* Perform a shallow copy. */ - *new_pb = *pb; + if (pb->pb_dse != NULL) { + _pblock_assert_pb_dse(new_pb); + *(new_pb->pb_dse) = *(pb->pb_dse); + } + if (pb->pb_task != NULL) { + _pblock_assert_pb_task(new_pb); + *(new_pb->pb_task) = *(pb->pb_task); + } + if (pb->pb_mr != NULL) { + _pblock_assert_pb_mr(new_pb); + *(new_pb->pb_mr) = *(pb->pb_mr); + } + if (pb->pb_misc != NULL) { + _pblock_assert_pb_misc(new_pb); + *(new_pb->pb_misc) = *(pb->pb_misc); + } + if (pb->pb_intop != NULL) { + _pblock_assert_pb_intop(new_pb); + *(new_pb->pb_intop) = *(pb->pb_intop); + } + if (pb->pb_intplugin != NULL) { + _pblock_assert_pb_intplugin(new_pb); + *(new_pb->pb_intplugin) = *(pb->pb_intplugin); + } + if (pb->pb_deprecated != NULL) { + _pblock_assert_pb_deprecated(new_pb); + *(new_pb->pb_deprecated) = *(pb->pb_deprecated); + } +#ifdef PBLOCK_ANALYTICS + new_pb->analytics = NULL; + pblock_analytics_init(new_pb); +#endif return new_pb; } @@ -247,11 +356,17 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) be = pblock->pb_backend; switch ( arg ) { +#ifdef PBLOCK_ANALYTICS + case SLAPI_HINT: + break; +#endif case SLAPI_BACKEND: (*(Slapi_Backend **)value) = be; break; case SLAPI_BACKEND_COUNT: - (*(int *)value) = pblock->pb_backend_count; + if (pblock->pb_misc != NULL) { + (*(int *)value) = pblock->pb_misc->pb_backend_count; + } break; case SLAPI_BE_TYPE: if ( NULL == be ) { @@ -494,7 +609,9 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) (*(time_t *)value) = pblock->pb_op->o_time; break; case SLAPI_REQUESTOR_ISROOT: - (*(int *)value) = pblock->pb_requestor_isroot; + if (pblock->pb_intop != NULL) { + (*(int *)value) = pblock->pb_intop->pb_requestor_isroot; + } break; case SLAPI_SKIP_MODIFIED_ATTRS: if(pblock->pb_op==NULL) @@ -553,7 +670,9 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) /* pblock memory management */ case SLAPI_DESTROY_CONTENT: - (*(int *)value) = pblock->pb_destroy_content; + if (pblock->pb_deprecated != NULL) { + (*(int *)value) = pblock->pb_deprecated->pb_destroy_content; + } break; /* stuff related to the current plugin */ @@ -579,22 +698,32 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) (*(int *)value) = pblock->pb_plugin->plg_precedence; break; case SLAPI_PLUGIN_OPRETURN: - (*(int *)value) = pblock->pb_opreturn; + if (pblock->pb_intop != NULL) { + (*(int *)value) = pblock->pb_intop->pb_opreturn; + } break; case SLAPI_PLUGIN_OBJECT: - (*(void **)value) = pblock->pb_object; + if (pblock->pb_intplugin != NULL) { + (*(void **)value) = pblock->pb_intplugin->pb_object; + } break; case SLAPI_PLUGIN_DESTROY_FN: - (*(IFP*)value) = pblock->pb_destroy_fn; + if (pblock->pb_intplugin != NULL) { + (*(IFP*)value) = pblock->pb_intplugin->pb_destroy_fn; + } break; case SLAPI_PLUGIN_DESCRIPTION: (*(Slapi_PluginDesc *)value) = pblock->pb_plugin->plg_desc; break; case SLAPI_PLUGIN_IDENTITY: - (*(void**)value) = pblock->pb_plugin_identity; + if (pblock->pb_intplugin != NULL) { + (*(void**)value) = pblock->pb_intplugin->pb_plugin_identity; + } break; case SLAPI_PLUGIN_CONFIG_AREA: - (*(char **)value) = pblock->pb_plugin_config_area; + if (pblock->pb_intplugin != NULL) { + (*(char **)value) = pblock->pb_intplugin->pb_plugin_config_area; + } break; case SLAPI_PLUGIN_CONFIG_DN: if (pblock->pb_plugin != NULL) { @@ -602,13 +731,19 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) } break; case SLAPI_PLUGIN_INTOP_RESULT: - (*(int *)value) = pblock->pb_internal_op_result; + if (pblock->pb_intop != NULL) { + (*(int *)value) = pblock->pb_intop->pb_internal_op_result; + } break; case SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES: - (*(Slapi_Entry ***)value) = pblock->pb_plugin_internal_search_op_entries; + if (pblock->pb_intop != NULL) { + (*(Slapi_Entry ***)value) = pblock->pb_intop->pb_plugin_internal_search_op_entries; + } break; case SLAPI_PLUGIN_INTOP_SEARCH_REFERRALS: - (*(char ***)value) = pblock->pb_plugin_internal_search_op_referrals; + if (pblock->pb_intop != NULL) { + (*(char ***)value) = pblock->pb_intop->pb_plugin_internal_search_op_referrals; + } break; /* database plugin functions */ @@ -1048,10 +1183,14 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) (*(IFP *)value) = pblock->pb_plugin->plg_postextop; break; case SLAPI_ENTRY_PRE_OP: - (*(Slapi_Entry **)value) = pblock->pb_pre_op_entry; + if (pblock->pb_intop != NULL) { + (*(Slapi_Entry **)value) = pblock->pb_intop->pb_pre_op_entry; + } break; case SLAPI_ENTRY_POST_OP: - (*(Slapi_Entry **)value) = pblock->pb_post_op_entry; + if (pblock->pb_intop != NULL) { + (*(Slapi_Entry **)value) = pblock->pb_intop->pb_post_op_entry; + } break; /* backend preoperation plugin */ @@ -1307,11 +1446,15 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) } break; case SLAPI_CONTROLS_ARG: /* used to pass control argument before operation is created */ - (*(LDAPControl ***)value) = pblock->pb_ctrls_arg; + if (pblock->pb_intop != NULL) { + (*(LDAPControl ***)value) = pblock->pb_intop->pb_ctrls_arg; + } break; /* notes to be added to the access log RESULT line for this op. */ case SLAPI_OPERATION_NOTES: - (*(unsigned int *)value) = pblock->pb_operation_notes; + if (pblock->pb_intop != NULL) { + (*(unsigned int *)value) = pblock->pb_intop->pb_operation_notes; + } break; /* syntax plugin functions */ @@ -1370,7 +1513,9 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) (*(IFP *)value) = pblock->pb_plugin->plg_syntax_compare; break; case SLAPI_SYNTAX_SUBSTRLENS: /* aka SLAPI_MR_SUBSTRLENS */ - (*(int **)value) = pblock->pb_substrlens; + if (pblock->pb_intplugin != NULL) { + (*(int **)value) = pblock->pb_intplugin->pb_substrlens; + } break; case SLAPI_PLUGIN_SYNTAX_VALIDATE: if ( pblock->pb_plugin->plg_type != SLAPI_PLUGIN_SYNTAX ) { @@ -1387,10 +1532,14 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) /* controls we know about */ case SLAPI_MANAGEDSAIT: - (*(int *)value) = pblock->pb_managedsait; + if (pblock->pb_intop != NULL) { + (*(int *)value) = pblock->pb_intop->pb_managedsait; + } break; case SLAPI_PWPOLICY: - (*(int *)value) = pblock->pb_pwpolicy_ctrl; + if (pblock->pb_intop != NULL) { + (*(int *)value) = pblock->pb_intop->pb_pwpolicy_ctrl; + } break; /* add arguments */ @@ -1401,13 +1550,19 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) } break; case SLAPI_ADD_EXISTING_DN_ENTRY: - (*(Slapi_Entry **)value) = pblock->pb_existing_dn_entry; + if (pblock->pb_intop != NULL) { + (*(Slapi_Entry **)value) = pblock->pb_intop->pb_existing_dn_entry; + } break; case SLAPI_ADD_EXISTING_UNIQUEID_ENTRY: - (*(Slapi_Entry **)value) = pblock->pb_existing_uniqueid_entry; + if (pblock->pb_intop != NULL) { + (*(Slapi_Entry **)value) = pblock->pb_intop->pb_existing_uniqueid_entry; + } break; case SLAPI_ADD_PARENT_ENTRY: - (*(Slapi_Entry **)value) = pblock->pb_parent_entry; + if (pblock->pb_intop != NULL) { + (*(Slapi_Entry **)value) = pblock->pb_intop->pb_parent_entry; + } break; case SLAPI_ADD_PARENT_UNIQUEID: if(pblock->pb_op!=NULL) @@ -1518,13 +1673,19 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) } break; case SLAPI_MODRDN_PARENT_ENTRY: - (*(Slapi_Entry **)value) = pblock->pb_parent_entry; + if (pblock->pb_intop != NULL) { + (*(Slapi_Entry **)value) = pblock->pb_intop->pb_parent_entry; + } break; case SLAPI_MODRDN_NEWPARENT_ENTRY: - (*(Slapi_Entry **)value) = pblock->pb_newparent_entry; + if (pblock->pb_intop != NULL) { + (*(Slapi_Entry **)value) = pblock->pb_intop->pb_newparent_entry; + } break; case SLAPI_MODRDN_TARGET_ENTRY: - (*(Slapi_Entry **)value) = pblock->pb_target_entry; + if (pblock->pb_intop != NULL) { + (*(Slapi_Entry **)value) = pblock->pb_intop->pb_target_entry; + } break; case SLAPI_MODRDN_NEWSUPERIOR_ADDRESS: if(pblock->pb_op!=NULL) @@ -1645,45 +1806,71 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) (*(IFP *)value) = pblock->pb_plugin->plg_mr_indexer_create; break; case SLAPI_PLUGIN_MR_FILTER_MATCH_FN: - (*(mrFilterMatchFn *)value) = pblock->pb_mr_filter_match_fn; + if (pblock->pb_mr != NULL) { + (*(mrFilterMatchFn *)value) = pblock->pb_mr->filter_match_fn; + } break; case SLAPI_PLUGIN_MR_FILTER_INDEX_FN: - (*(IFP *)value) = pblock->pb_mr_filter_index_fn; + if (pblock->pb_mr != NULL) { + (*(IFP *)value) = pblock->pb_mr->filter_index_fn; + } break; case SLAPI_PLUGIN_MR_FILTER_RESET_FN: - (*(IFP *)value) = pblock->pb_mr_filter_reset_fn; + if (pblock->pb_mr != NULL) { + (*(IFP *)value) = pblock->pb_mr->filter_reset_fn; + } break; case SLAPI_PLUGIN_MR_INDEX_FN: - (*(IFP *)value) = pblock->pb_mr_index_fn; + if (pblock->pb_mr != NULL) { + (*(IFP *)value) = pblock->pb_mr->index_fn; + } break; case SLAPI_PLUGIN_MR_INDEX_SV_FN: - (*(IFP *)value) = pblock->pb_mr_index_sv_fn; + if (pblock->pb_mr != NULL) { + (*(IFP *)value) = pblock->pb_mr->index_sv_fn; + } break; /* matching rule plugin arguments */ case SLAPI_PLUGIN_MR_OID: - (*(char **) value) = pblock->pb_mr_oid; + if (pblock->pb_mr != NULL) { + (*(char **) value) = pblock->pb_mr->oid; + } break; case SLAPI_PLUGIN_MR_TYPE: - (*(char **) value) = pblock->pb_mr_type; + if (pblock->pb_mr != NULL) { + (*(char **) value) = pblock->pb_mr->type; + } break; case SLAPI_PLUGIN_MR_VALUE: - (*(struct berval **) value) = pblock->pb_mr_value; + if (pblock->pb_mr != NULL) { + (*(struct berval **) value) = pblock->pb_mr->value; + } break; case SLAPI_PLUGIN_MR_VALUES: - (*(struct berval ***) value) = pblock->pb_mr_values; + if (pblock->pb_mr != NULL) { + (*(struct berval ***) value) = pblock->pb_mr->values; + } break; case SLAPI_PLUGIN_MR_KEYS: - (*(struct berval ***) value) = pblock->pb_mr_keys; + if (pblock->pb_mr != NULL) { + (*(struct berval ***) value) = pblock->pb_mr->keys; + } break; case SLAPI_PLUGIN_MR_FILTER_REUSABLE: - (*(unsigned int *) value) = pblock->pb_mr_filter_reusable; + if (pblock->pb_mr != NULL) { + (*(unsigned int *) value) = pblock->pb_mr->filter_reusable; + } break; case SLAPI_PLUGIN_MR_QUERY_OPERATOR: - (*(int *) value) = pblock->pb_mr_query_operator; + if (pblock->pb_mr != NULL) { + (*(int *) value) = pblock->pb_mr->query_operator; + } break; case SLAPI_PLUGIN_MR_USAGE: - (*(unsigned int *) value) = pblock->pb_mr_usage; + if (pblock->pb_mr != NULL) { + (*(unsigned int *) value) = pblock->pb_mr->usage; + } break; /* new style matching rule syntax plugin functions */ @@ -1744,90 +1931,140 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) /* seq arguments */ case SLAPI_SEQ_TYPE: - (*(int *)value) = pblock->pb_seq_type; + if (pblock->pb_task != NULL) { + (*(int *)value) = pblock->pb_task->seq_type; + } break; case SLAPI_SEQ_ATTRNAME: - (*(char **)value) = pblock->pb_seq_attrname; + if (pblock->pb_task != NULL) { + (*(char **)value) = pblock->pb_task->seq_attrname; + } break; case SLAPI_SEQ_VAL: - (*(char **)value) = pblock->pb_seq_val; + if (pblock->pb_task != NULL) { + (*(char **)value) = pblock->pb_task->seq_val; + } break; /* ldif2db arguments */ case SLAPI_LDIF2DB_FILE: - (*(char ***)value) = pblock->pb_ldif_files; + if (pblock->pb_task != NULL) { + (*(char ***)value) = pblock->pb_task->ldif_files; + } break; case SLAPI_LDIF2DB_REMOVEDUPVALS: - (*(int *)value) = pblock->pb_removedupvals; + if (pblock->pb_task != NULL) { + (*(int *)value) = pblock->pb_task->removedupvals; + } break; case SLAPI_DB2INDEX_ATTRS: - (*(char ***)value) = pblock->pb_db2index_attrs; + if (pblock->pb_task != NULL) { + (*(char ***)value) = pblock->pb_task->db2index_attrs; + } break; case SLAPI_LDIF2DB_NOATTRINDEXES: - (*(int *)value) = pblock->pb_ldif2db_noattrindexes; + if (pblock->pb_task != NULL) { + (*(int *)value) = pblock->pb_task->ldif2db_noattrindexes; + } break; case SLAPI_LDIF2DB_INCLUDE: - (*(char ***)value) = pblock->pb_ldif_include; + if (pblock->pb_task != NULL) { + (*(char ***)value) = pblock->pb_task->ldif_include; + } break; case SLAPI_LDIF2DB_EXCLUDE: - (*(char ***)value) = pblock->pb_ldif_exclude; + if (pblock->pb_task != NULL) { + (*(char ***)value) = pblock->pb_task->ldif_exclude; + } break; case SLAPI_LDIF2DB_GENERATE_UNIQUEID: - (*(int *)value) = pblock->pb_ldif_generate_uniqueid; + if (pblock->pb_task != NULL) { + (*(int *)value) = pblock->pb_task->ldif_generate_uniqueid; + } break; case SLAPI_LDIF2DB_ENCRYPT: case SLAPI_DB2LDIF_DECRYPT: - (*(int *)value) = pblock->pb_ldif_encrypt; + if (pblock->pb_task != NULL) { + (*(int *)value) = pblock->pb_task->ldif_encrypt; + } break; case SLAPI_LDIF2DB_NAMESPACEID: - (*(char **)value) = pblock->pb_ldif_namespaceid; + if (pblock->pb_task != NULL) { + (*(char **)value) = pblock->pb_task->ldif_namespaceid; + } break; /* db2ldif arguments */ case SLAPI_DB2LDIF_PRINTKEY: - (*(int *)value) = pblock->pb_ldif_printkey; + if (pblock->pb_task != NULL) { + (*(int *)value) = pblock->pb_task->ldif_printkey; + } break; case SLAPI_DB2LDIF_DUMP_UNIQUEID: - (*(int *)value) = pblock->pb_ldif_dump_uniqueid; + if (pblock->pb_task != NULL) { + (*(int *)value) = pblock->pb_task->ldif_dump_uniqueid; + } break; case SLAPI_DB2LDIF_FILE: - (*(char **)value) = pblock->pb_ldif_file; + if (pblock->pb_task != NULL) { + (*(char **)value) = pblock->pb_task->ldif_file; + } break; /* db2ldif/ldif2db/db2bak/bak2db arguments */ case SLAPI_BACKEND_INSTANCE_NAME: - (*(char **)value) = pblock->pb_instance_name; + if (pblock->pb_task != NULL) { + (*(char **)value) = pblock->pb_task->instance_name; + } break; - case SLAPI_BACKEND_TASK: - (*(Slapi_Task **)value) = pblock->pb_task; - break; + case SLAPI_BACKEND_TASK: + if (pblock->pb_task != NULL) { + (*(Slapi_Task **)value) = pblock->pb_task->task; + } + break; case SLAPI_TASK_FLAGS: - (*(int *)value) = pblock->pb_task_flags; + if (pblock->pb_task != NULL) { + (*(int *)value) = pblock->pb_task->task_flags; + } break; case SLAPI_DB2LDIF_SERVER_RUNNING: - (*(int *)value) = pblock->pb_server_running; + if (pblock->pb_task != NULL) { + (*(int *)value) = pblock->pb_task->server_running; + } break; - case SLAPI_BULK_IMPORT_ENTRY: - (*(Slapi_Entry **)value) = pblock->pb_import_entry; - break; - case SLAPI_BULK_IMPORT_STATE: - (*(int *)value) = pblock->pb_import_state; - break; + case SLAPI_BULK_IMPORT_ENTRY: + if (pblock->pb_task != NULL) { + (*(Slapi_Entry **)value) = pblock->pb_task->import_entry; + } + break; + case SLAPI_BULK_IMPORT_STATE: + if (pblock->pb_task != NULL) { + (*(int *)value) = pblock->pb_task->import_state; + } + break; + /* dbverify */ + case SLAPI_DBVERIFY_DBDIR: + if (pblock->pb_task != NULL) { + (*(char **)value) = pblock->pb_task->dbverify_dbdir; + } + break; + /* transaction arguments */ case SLAPI_PARENT_TXN: - (*(void **)value) = pblock->pb_parent_txn; + if (pblock->pb_intop != NULL) { + (*(void **)value) = pblock->pb_intop->pb_parent_txn; + } break; case SLAPI_TXN: - (*(void **)value) = pblock->pb_txn; + if (pblock->pb_intop != NULL) { + (*(void **)value) = pblock->pb_intop->pb_txn; + } break; case SLAPI_TXN_RUV_MODS_FN: - (*(IFP*)value) = pblock->pb_txn_ruv_mods_fn; - break; - - /* dbverify */ - case SLAPI_DBVERIFY_DBDIR: - (*(char **)value) = pblock->pb_dbverify_dbdir; + if (pblock->pb_intop != NULL) { + (*(IFP*)value) = pblock->pb_intop->pb_txn_ruv_mods_fn; + } break; /* Search results set */ @@ -1885,12 +2122,16 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) * ((char **) value) = pblock->pb_op->o_results.result_text; break; case SLAPI_PB_RESULT_TEXT: - * ((char **) value) = pblock->pb_result_text; + if (pblock->pb_intop != NULL) { + * ((char **) value) = pblock->pb_intop->pb_result_text; + } break; /* Size of the database, in kb */ case SLAPI_DBSIZE: - (*(unsigned int *)value) = pblock->pb_dbsize; + if (pblock->pb_misc != NULL) { + (*(unsigned int *)value) = pblock->pb_misc->pb_dbsize; + } break; /* ACL Plugin */ @@ -1977,15 +2218,21 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) break; /* Command line arguments */ case SLAPI_ARGC: - (*(int *)value) = pblock->pb_slapd_argc; + if (pblock->pb_misc != NULL) { + (*(int *)value) = pblock->pb_misc->pb_slapd_argc; + } break; case SLAPI_ARGV: - (*(char ***)value) = pblock->pb_slapd_argv; + if (pblock->pb_misc != NULL) { + (*(char ***)value) = pblock->pb_misc->pb_slapd_argv; + } break; /* Config file directory */ case SLAPI_CONFIG_DIRECTORY: - (*(char **)value) = pblock->pb_slapd_configdir; + if (pblock->pb_intplugin != NULL) { + (*(char **)value) = pblock->pb_intplugin->pb_slapd_configdir; + } break; /* password storage scheme (kexcoff */ @@ -1993,11 +2240,15 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) (*(char **)value) = pblock->pb_plugin->plg_pwdstorageschemename; break; case SLAPI_PLUGIN_PWD_STORAGE_SCHEME_USER_PWD: - (*(char **)value) = pblock->pb_pwd_storage_scheme_user_passwd; + if (pblock->pb_deprecated != NULL) { + (*(char **)value) = pblock->pb_deprecated->pb_pwd_storage_scheme_user_passwd; + } break; case SLAPI_PLUGIN_PWD_STORAGE_SCHEME_DB_PWD: - (*(char **)value) = pblock->pb_pwd_storage_scheme_db_passwd; + if (pblock->pb_deprecated != NULL) { + (*(char **)value) = pblock->pb_deprecated->pb_pwd_storage_scheme_db_passwd; + } break; case SLAPI_PLUGIN_PWD_STORAGE_SCHEME_ENC_FN: @@ -2022,72 +2273,96 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) break; case SLAPI_PLUGIN_ENABLED: - *((int *)value) = pblock->pb_plugin_enabled; + if (pblock->pb_intplugin != NULL) { + *((int *)value) = pblock->pb_intplugin->pb_plugin_enabled; + } break; /* DSE add parameters */ case SLAPI_DSE_DONT_WRITE_WHEN_ADDING: - (*(int *)value) = pblock->pb_dse_dont_add_write; - break; + if (pblock->pb_dse != NULL) { + (*(int *)value) = pblock->pb_dse->dont_add_write; + } + break; /* DSE add parameters */ case SLAPI_DSE_MERGE_WHEN_ADDING: - (*(int *)value) = pblock->pb_dse_add_merge; + if (pblock->pb_dse != NULL) { + (*(int *)value) = pblock->pb_dse->add_merge; + } break; /* DSE add parameters */ case SLAPI_DSE_DONT_CHECK_DUPS: - (*(int *)value) = pblock->pb_dse_dont_check_dups; + if (pblock->pb_dse != NULL) { + (*(int *)value) = pblock->pb_dse->dont_check_dups; + } break; /* DSE modify parameters */ case SLAPI_DSE_REAPPLY_MODS: - (*(int *)value) = pblock->pb_dse_reapply_mods; + if (pblock->pb_dse != NULL) { + (*(int *)value) = pblock->pb_dse->reapply_mods; + } break; /* DSE read parameters */ case SLAPI_DSE_IS_PRIMARY_FILE: - (*(int *)value) = pblock->pb_dse_is_primary_file; + if (pblock->pb_dse != NULL) { + (*(int *)value) = pblock->pb_dse->is_primary_file; + } break; /* used internally by schema code (schema.c) */ case SLAPI_SCHEMA_FLAGS: - (*(int *)value) = pblock->pb_schema_flags; + if (pblock->pb_dse != NULL) { + (*(int *)value) = pblock->pb_dse->schema_flags; + } break; case SLAPI_URP_NAMING_COLLISION_DN: - (*(char **)value) = pblock->pb_urp_naming_collision_dn; + if (pblock->pb_intop != NULL) { + (*(char **)value) = pblock->pb_intop->pb_urp_naming_collision_dn; + } break; case SLAPI_URP_TOMBSTONE_UNIQUEID: - (*(char **)value) = pblock->pb_urp_tombstone_uniqueid; + if (pblock->pb_intop != NULL) { + (*(char **)value) = pblock->pb_intop->pb_urp_tombstone_uniqueid; + } break; case SLAPI_SEARCH_CTRLS: - (*(LDAPControl ***)value) = pblock->pb_search_ctrls; + if (pblock->pb_intop != NULL) { + (*(LDAPControl ***)value) = pblock->pb_intop->pb_search_ctrls; + } break; case SLAPI_PLUGIN_SYNTAX_FILTER_NORMALIZED: - (*(int *)value) = pblock->pb_syntax_filter_normalized; + if (pblock->pb_intplugin != NULL) { + (*(int *)value) = pblock->pb_intplugin->pb_syntax_filter_normalized; + } break; case SLAPI_PLUGIN_SYNTAX_FILTER_DATA: - (*(void **)value) = pblock->pb_syntax_filter_data; + if (pblock->pb_intplugin != NULL) { + (*(void **)value) = pblock->pb_intplugin->pb_syntax_filter_data; + } break; case SLAPI_PAGED_RESULTS_INDEX: - if (op_is_pagedresults(pblock->pb_op)) { + if (op_is_pagedresults(pblock->pb_op) && pblock->pb_intop != NULL) { /* search req is simple paged results */ - (*(int *)value) = pblock->pb_paged_results_index; + (*(int *)value) = pblock->pb_intop->pb_paged_results_index; } else { (*(int *)value) = -1; } break; case SLAPI_PAGED_RESULTS_COOKIE: - if (op_is_pagedresults(pblock->pb_op)) { + if (op_is_pagedresults(pblock->pb_op) && pblock->pb_intop != NULL) { /* search req is simple paged results */ - (*(int *)value) = pblock->pb_paged_results_cookie; + (*(int *)value) = pblock->pb_intop->pb_paged_results_cookie; } else { (*(int *)value) = 0; } @@ -2095,29 +2370,20 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) /* ACI Target Check */ case SLAPI_ACI_TARGET_CHECK: - (*(int *)value) = pblock->pb_aci_target_check; + if (pblock->pb_misc != NULL) { + (*(int *)value) = pblock->pb_misc->pb_aci_target_check; + } break; default: slapi_log_err(SLAPI_LOG_ERR, "slapi_pblock_get", "Unknown parameter block argument %d\n", arg); -#ifdef PBLOCK_ANALYTICS - Slapi_PBlock *boom = NULL; - void *x = (void *)boom->pb_plugin; -#endif + PR_ASSERT(0); return( -1 ); } return( 0 ); } -/* - * This ifdef is needed to resolve a gcc 6 issue which throws a false positive - * here. See also: https://bugzilla.redhat.com/show_bug.cgi?id=1386445 - * - * It's a good idea to run this in EL7 to check the overflows etc, but with - * GCC 6 and lsan to find memory leaks .... - */ - int slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) { @@ -2129,6 +2395,10 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) PR_ASSERT( NULL != pblock ); switch ( arg ) { +#ifdef PBLOCK_ANALYTICS + case SLAPI_HINT: + break; +#endif case SLAPI_BACKEND: pblock->pb_backend = (Slapi_Backend *) value; if (pblock->pb_backend && (NULL == pblock->pb_plugin)) { @@ -2138,7 +2408,8 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) } break; case SLAPI_BACKEND_COUNT: - pblock->pb_backend_count = *((int *) value); + _pblock_assert_pb_misc(pblock); + pblock->pb_misc->pb_backend_count = *((int *) value); break; case SLAPI_CONNECTION: pblock->pb_conn = (Connection *) value; @@ -2152,7 +2423,8 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) } break; case SLAPI_REQUESTOR_ISROOT: - pblock->pb_requestor_isroot = *((int *) value); + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_requestor_isroot = *((int *) value); break; case SLAPI_IS_REPLICATED_OPERATION: PR_ASSERT(0); @@ -2218,7 +2490,8 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) /* pblock memory management */ case SLAPI_DESTROY_CONTENT: - pblock->pb_destroy_content = *((int *) value); + _pblock_assert_pb_deprecated(pblock); + pblock->pb_deprecated->pb_destroy_content = *((int *) value); break; /* stuff related to the current plugin */ @@ -2244,31 +2517,39 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) pblock->pb_plugin->plg_precedence = *((int *) value); break; case SLAPI_PLUGIN_OPRETURN: - pblock->pb_opreturn = *((int *) value); + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_opreturn = *((int *) value); break; case SLAPI_PLUGIN_OBJECT: - pblock->pb_object = (void *) value; + _pblock_assert_pb_intplugin(pblock); + pblock->pb_intplugin->pb_object = (void *) value; break; case SLAPI_PLUGIN_IDENTITY: - pblock->pb_plugin_identity = (void*)value; + _pblock_assert_pb_intplugin(pblock); + pblock->pb_intplugin->pb_plugin_identity = (void*)value; break; case SLAPI_PLUGIN_CONFIG_AREA: - pblock->pb_plugin_config_area = (char *) value; + _pblock_assert_pb_intplugin(pblock); + pblock->pb_intplugin->pb_plugin_config_area = (char *) value; break; case SLAPI_PLUGIN_DESTROY_FN: - pblock->pb_destroy_fn = (IFP) value; + _pblock_assert_pb_intplugin(pblock); + pblock->pb_intplugin->pb_destroy_fn = (IFP) value; break; case SLAPI_PLUGIN_DESCRIPTION: pblock->pb_plugin->plg_desc = *((Slapi_PluginDesc *)value); break; case SLAPI_PLUGIN_INTOP_RESULT: - pblock->pb_internal_op_result = *((int *) value); + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_internal_op_result = *((int *) value); break; case SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES: - pblock->pb_plugin_internal_search_op_entries = (Slapi_Entry **) value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_plugin_internal_search_op_entries = (Slapi_Entry **) value; break; case SLAPI_PLUGIN_INTOP_SEARCH_REFERRALS: - pblock->pb_plugin_internal_search_op_referrals = (char **) value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_plugin_internal_search_op_referrals = (char **) value; break; case SLAPI_REQUESTOR_DN: if(pblock->pb_op == NULL){ @@ -2969,7 +3250,8 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) pblock->pb_plugin->plg_syntax_compare = (IFP) value; break; case SLAPI_SYNTAX_SUBSTRLENS: /* aka SLAPI_MR_SUBSTRLENS */ - pblock->pb_substrlens = (int *) value; + _pblock_assert_pb_intplugin(pblock); + pblock->pb_intplugin->pb_substrlens = (int *) value; break; case SLAPI_PLUGIN_SYNTAX_VALIDATE: if ( pblock->pb_plugin->plg_type != SLAPI_PLUGIN_SYNTAX ) { @@ -2984,10 +3266,12 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) pblock->pb_plugin->plg_syntax_normalize = (VFPV) value; break; case SLAPI_ENTRY_PRE_OP: - pblock->pb_pre_op_entry = (Slapi_Entry *) value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_pre_op_entry = (Slapi_Entry *) value; break; case SLAPI_ENTRY_POST_OP: - pblock->pb_post_op_entry = (Slapi_Entry *) value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_post_op_entry = (Slapi_Entry *) value; break; /* target address for all operations */ @@ -3045,7 +3329,8 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) } break; case SLAPI_CONTROLS_ARG: /* used to pass control argument before operation is created */ - pblock->pb_ctrls_arg = (LDAPControl **) value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_ctrls_arg = (LDAPControl **) value; break; case SLAPI_ADD_RESCONTROL: if(pblock->pb_op!=NULL) @@ -3056,10 +3341,11 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) /* notes to be added to the access log RESULT line for this op. */ case SLAPI_OPERATION_NOTES: + _pblock_assert_pb_intop(pblock); if ( value == NULL ) { - pblock->pb_operation_notes = 0; /* cleared */ + pblock->pb_intop->pb_operation_notes = 0; /* cleared */ } else { - pblock->pb_operation_notes |= *((unsigned int *)value ); + pblock->pb_intop->pb_operation_notes |= *((unsigned int *)value ); } break; case SLAPI_SKIP_MODIFIED_ATTRS: @@ -3073,10 +3359,12 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) break; /* controls we know about */ case SLAPI_MANAGEDSAIT: - pblock->pb_managedsait = *((int *) value); + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_managedsait = *((int *) value); break; case SLAPI_PWPOLICY: - pblock->pb_pwpolicy_ctrl = *((int *) value); + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_pwpolicy_ctrl = *((int *) value); break; /* add arguments */ @@ -3087,13 +3375,16 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) } break; case SLAPI_ADD_EXISTING_DN_ENTRY: - pblock->pb_existing_dn_entry = (Slapi_Entry *) value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_existing_dn_entry = (Slapi_Entry *) value; break; case SLAPI_ADD_EXISTING_UNIQUEID_ENTRY: - pblock->pb_existing_uniqueid_entry = (Slapi_Entry *) value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_existing_uniqueid_entry = (Slapi_Entry *) value; break; case SLAPI_ADD_PARENT_ENTRY: - pblock->pb_parent_entry = (Slapi_Entry *) value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_parent_entry = (Slapi_Entry *) value; break; case SLAPI_ADD_PARENT_UNIQUEID: if(pblock->pb_op!=NULL) @@ -3202,13 +3493,16 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) } break; case SLAPI_MODRDN_PARENT_ENTRY: - pblock->pb_parent_entry = (Slapi_Entry *) value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_parent_entry = (Slapi_Entry *) value; break; case SLAPI_MODRDN_NEWPARENT_ENTRY: - pblock->pb_newparent_entry = (Slapi_Entry *) value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_newparent_entry = (Slapi_Entry *) value; break; case SLAPI_MODRDN_TARGET_ENTRY: - pblock->pb_target_entry = (Slapi_Entry *) value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_target_entry = (Slapi_Entry *) value; break; case SLAPI_MODRDN_NEWSUPERIOR_ADDRESS: PR_ASSERT (PR_FALSE); /* can't do this */ @@ -3344,45 +3638,58 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) pblock->pb_plugin->plg_mr_indexer_create = (IFP) value; break; case SLAPI_PLUGIN_MR_FILTER_MATCH_FN: - pblock->pb_mr_filter_match_fn = (mrFilterMatchFn) value; + _pblock_assert_pb_mr(pblock); + pblock->pb_mr->filter_match_fn = (mrFilterMatchFn) value; break; case SLAPI_PLUGIN_MR_FILTER_INDEX_FN: - pblock->pb_mr_filter_index_fn = (IFP) value; + _pblock_assert_pb_mr(pblock); + pblock->pb_mr->filter_index_fn = (IFP) value; break; case SLAPI_PLUGIN_MR_FILTER_RESET_FN: - pblock->pb_mr_filter_reset_fn = (IFP) value; + _pblock_assert_pb_mr(pblock); + pblock->pb_mr->filter_reset_fn = (IFP) value; break; case SLAPI_PLUGIN_MR_INDEX_FN: - pblock->pb_mr_index_fn = (IFP) value; + _pblock_assert_pb_mr(pblock); + pblock->pb_mr->index_fn = (IFP) value; break; case SLAPI_PLUGIN_MR_INDEX_SV_FN: - pblock->pb_mr_index_sv_fn = (IFP) value; + _pblock_assert_pb_mr(pblock); + pblock->pb_mr->index_sv_fn = (IFP) value; break; /* matching rule plugin arguments */ case SLAPI_PLUGIN_MR_OID: - pblock->pb_mr_oid = (char *) value; + _pblock_assert_pb_mr(pblock); + pblock->pb_mr->oid = (char *) value; break; case SLAPI_PLUGIN_MR_TYPE: - pblock->pb_mr_type = (char *) value; + _pblock_assert_pb_mr(pblock); + pblock->pb_mr->type = (char *) value; break; case SLAPI_PLUGIN_MR_VALUE: - pblock->pb_mr_value = (struct berval *) value; + _pblock_assert_pb_mr(pblock); + pblock->pb_mr->value = (struct berval *) value; break; case SLAPI_PLUGIN_MR_VALUES: - pblock->pb_mr_values = (struct berval **) value; + _pblock_assert_pb_mr(pblock); + pblock->pb_mr->values = (struct berval **) value; break; case SLAPI_PLUGIN_MR_KEYS: - pblock->pb_mr_keys = (struct berval **) value; + _pblock_assert_pb_mr(pblock); + pblock->pb_mr->keys = (struct berval **) value; break; case SLAPI_PLUGIN_MR_FILTER_REUSABLE: - pblock->pb_mr_filter_reusable = *(unsigned int *) value; + _pblock_assert_pb_mr(pblock); + pblock->pb_mr->filter_reusable = *(unsigned int *) value; break; case SLAPI_PLUGIN_MR_QUERY_OPERATOR: - pblock->pb_mr_query_operator = *(int *) value; + _pblock_assert_pb_mr(pblock); + pblock->pb_mr->query_operator = *(int *) value; break; case SLAPI_PLUGIN_MR_USAGE: - pblock->pb_mr_usage = *(unsigned int *) value; + _pblock_assert_pb_mr(pblock); + pblock->pb_mr->usage = *(unsigned int *) value; break; /* new style matching rule syntax plugin functions */ @@ -3443,81 +3750,116 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) /* seq arguments */ case SLAPI_SEQ_TYPE: - pblock->pb_seq_type = *((int *)value); + _pblock_assert_pb_task(pblock); + pblock->pb_task->seq_type = *((int *)value); break; case SLAPI_SEQ_ATTRNAME: - pblock->pb_seq_attrname = (char *) value; + _pblock_assert_pb_task(pblock); + pblock->pb_task->seq_attrname = (char *) value; break; case SLAPI_SEQ_VAL: - pblock->pb_seq_val = (char *) value; + _pblock_assert_pb_task(pblock); + pblock->pb_task->seq_val = (char *) value; break; /* ldif2db arguments */ case SLAPI_LDIF2DB_FILE: - pblock->pb_ldif_files = (char **) value; + _pblock_assert_pb_task(pblock); + pblock->pb_task->ldif_files = (char **) value; break; case SLAPI_LDIF2DB_REMOVEDUPVALS: - pblock->pb_removedupvals = *((int *)value); + _pblock_assert_pb_task(pblock); + pblock->pb_task->removedupvals = *((int *)value); break; case SLAPI_DB2INDEX_ATTRS: - pblock->pb_db2index_attrs = (char **) value; + _pblock_assert_pb_task(pblock); + pblock->pb_task->db2index_attrs = (char **) value; break; case SLAPI_LDIF2DB_NOATTRINDEXES: - pblock->pb_ldif2db_noattrindexes = *((int *)value); + _pblock_assert_pb_task(pblock); + pblock->pb_task->ldif2db_noattrindexes = *((int *)value); break; case SLAPI_LDIF2DB_INCLUDE: - pblock->pb_ldif_include = (char **)value; + _pblock_assert_pb_task(pblock); + pblock->pb_task->ldif_include = (char **)value; break; case SLAPI_LDIF2DB_EXCLUDE: - pblock->pb_ldif_exclude = (char **)value; + _pblock_assert_pb_task(pblock); + pblock->pb_task->ldif_exclude = (char **)value; break; case SLAPI_LDIF2DB_GENERATE_UNIQUEID: - pblock->pb_ldif_generate_uniqueid = *((int *)value); + _pblock_assert_pb_task(pblock); + pblock->pb_task->ldif_generate_uniqueid = *((int *)value); break; case SLAPI_LDIF2DB_NAMESPACEID: - pblock->pb_ldif_namespaceid = (char *)value; + _pblock_assert_pb_task(pblock); + pblock->pb_task->ldif_namespaceid = (char *)value; break; /* db2ldif arguments */ case SLAPI_DB2LDIF_PRINTKEY: - pblock->pb_ldif_printkey = *((int *)value); + _pblock_assert_pb_task(pblock); + pblock->pb_task->ldif_printkey = *((int *)value); break; case SLAPI_DB2LDIF_DUMP_UNIQUEID: - pblock->pb_ldif_dump_uniqueid = *((int *)value); + _pblock_assert_pb_task(pblock); + pblock->pb_task->ldif_dump_uniqueid = *((int *)value); break; case SLAPI_DB2LDIF_FILE: - pblock->pb_ldif_file = (char *)value; + _pblock_assert_pb_task(pblock); + pblock->pb_task->ldif_file = (char *)value; break; /* db2ldif/ldif2db/db2bak/bak2db arguments */ case SLAPI_BACKEND_INSTANCE_NAME: - pblock->pb_instance_name = (char *) value; + _pblock_assert_pb_task(pblock); + pblock->pb_task->instance_name = (char *) value; break; - case SLAPI_BACKEND_TASK: - pblock->pb_task = (Slapi_Task *)value; - break; + case SLAPI_BACKEND_TASK: + _pblock_assert_pb_task(pblock); + pblock->pb_task->task = (Slapi_Task *)value; + break; case SLAPI_TASK_FLAGS: - pblock->pb_task_flags = *((int *)value); + _pblock_assert_pb_task(pblock); + pblock->pb_task->task_flags = *((int *)value); break; case SLAPI_DB2LDIF_SERVER_RUNNING: - pblock->pb_server_running = *((int *)value); + _pblock_assert_pb_task(pblock); + pblock->pb_task->server_running = *((int *)value); break; - case SLAPI_BULK_IMPORT_ENTRY: - pblock->pb_import_entry = (Slapi_Entry *)value; - break; - case SLAPI_BULK_IMPORT_STATE: - pblock->pb_import_state = *((int *)value); - break; + case SLAPI_BULK_IMPORT_ENTRY: + _pblock_assert_pb_task(pblock); + pblock->pb_task->import_entry = (Slapi_Entry *)value; + break; + case SLAPI_BULK_IMPORT_STATE: + _pblock_assert_pb_task(pblock); + pblock->pb_task->import_state = *((int *)value); + break; + + case SLAPI_LDIF2DB_ENCRYPT: + case SLAPI_DB2LDIF_DECRYPT: + _pblock_assert_pb_task(pblock); + pblock->pb_task->ldif_encrypt = *((int *)value); + break; + /* dbverify */ + case SLAPI_DBVERIFY_DBDIR: + _pblock_assert_pb_task(pblock); + pblock->pb_task->dbverify_dbdir = (char *) value; + break; + /* transaction arguments */ case SLAPI_PARENT_TXN: - pblock->pb_parent_txn = (void *)value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_parent_txn = (void *)value; break; case SLAPI_TXN: - pblock->pb_txn = (void *)value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_txn = (void *)value; break; case SLAPI_TXN_RUV_MODS_FN: - pblock->pb_txn_ruv_mods_fn = (IFP) value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_txn_ruv_mods_fn = (IFP) value; break; /* Search results set */ @@ -3575,13 +3917,15 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) pblock->pb_op->o_results.result_text = (char *) value; break; case SLAPI_PB_RESULT_TEXT: - slapi_ch_free((void**)&(pblock->pb_result_text)); - pblock->pb_result_text = slapi_ch_strdup ((char *) value); + _pblock_assert_pb_intop(pblock); + slapi_ch_free((void**)&(pblock->pb_intop->pb_result_text)); + pblock->pb_intop->pb_result_text = slapi_ch_strdup ((char *) value); break; /* Size of the database, in kb */ case SLAPI_DBSIZE: - pblock->pb_dbsize = *((unsigned int *)value); + _pblock_assert_pb_misc(pblock); + pblock->pb_misc->pb_dbsize = *((unsigned int *)value); break; /* ACL Plugin */ @@ -3609,17 +3953,20 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) } pblock->pb_conn->c_domain = *((struct berval ***) value ); break; - /* Command line arguments */ - case SLAPI_ARGC: - pblock->pb_slapd_argc= *((int *)value); - break; - case SLAPI_ARGV: - pblock->pb_slapd_argv = *((char***)value); - break; + /* Command line arguments */ + case SLAPI_ARGC: + _pblock_assert_pb_misc(pblock); + pblock->pb_misc->pb_slapd_argc= *((int *)value); + break; + case SLAPI_ARGV: + _pblock_assert_pb_misc(pblock); + pblock->pb_misc->pb_slapd_argv = *((char***)value); + break; /* Config file directory */ case SLAPI_CONFIG_DIRECTORY: - pblock->pb_slapd_configdir = (char *)value; + _pblock_assert_pb_intplugin(pblock); + pblock->pb_intplugin->pb_slapd_configdir = (char *)value; break; /* password storage scheme (kexcoff) */ @@ -3631,11 +3978,13 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) pblock->pb_plugin->plg_pwdstorageschemename = slapi_ch_strdup((char *)value); break; case SLAPI_PLUGIN_PWD_STORAGE_SCHEME_USER_PWD: - pblock->pb_pwd_storage_scheme_user_passwd = (char *)value; + _pblock_assert_pb_deprecated(pblock); + pblock->pb_deprecated->pb_pwd_storage_scheme_user_passwd = (char *)value; break; case SLAPI_PLUGIN_PWD_STORAGE_SCHEME_DB_PWD: - pblock->pb_pwd_storage_scheme_db_passwd = (char *)value; + _pblock_assert_pb_deprecated(pblock); + pblock->pb_deprecated->pb_pwd_storage_scheme_db_passwd = (char *)value; break; case SLAPI_PLUGIN_PWD_STORAGE_SCHEME_ENC_FN: @@ -3665,89 +4014,90 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) break; case SLAPI_PLUGIN_ENABLED: - pblock->pb_plugin_enabled = *((int *)value); + _pblock_assert_pb_intplugin(pblock); + pblock->pb_intplugin->pb_plugin_enabled = *((int *)value); break; /* DSE add parameters */ case SLAPI_DSE_DONT_WRITE_WHEN_ADDING: - pblock->pb_dse_dont_add_write = *((int *)value); + _pblock_assert_pb_dse(pblock); + pblock->pb_dse->dont_add_write = *((int *)value); break; /* DSE add parameters */ case SLAPI_DSE_MERGE_WHEN_ADDING: - pblock->pb_dse_add_merge = *((int *)value); + _pblock_assert_pb_dse(pblock); + pblock->pb_dse->add_merge = *((int *)value); break; /* DSE add parameters */ case SLAPI_DSE_DONT_CHECK_DUPS: - pblock->pb_dse_dont_check_dups = *((int *)value); + _pblock_assert_pb_dse(pblock); + pblock->pb_dse->dont_check_dups = *((int *)value); break; /* DSE modify parameters */ case SLAPI_DSE_REAPPLY_MODS: - pblock->pb_dse_reapply_mods = *((int *)value); + _pblock_assert_pb_dse(pblock); + pblock->pb_dse->reapply_mods = *((int *)value); break; /* DSE read parameters */ case SLAPI_DSE_IS_PRIMARY_FILE: - pblock->pb_dse_is_primary_file = *((int *)value); + _pblock_assert_pb_dse(pblock); + pblock->pb_dse->is_primary_file = *((int *)value); break; /* used internally by schema code (schema.c) */ case SLAPI_SCHEMA_FLAGS: - pblock->pb_schema_flags = *((int *)value); + _pblock_assert_pb_dse(pblock); + pblock->pb_dse->schema_flags = *((int *)value); break; case SLAPI_URP_NAMING_COLLISION_DN: - pblock->pb_urp_naming_collision_dn = (char *)value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_urp_naming_collision_dn = (char *)value; break; case SLAPI_URP_TOMBSTONE_UNIQUEID: - pblock->pb_urp_tombstone_uniqueid = (char *)value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_urp_tombstone_uniqueid = (char *)value; break; - case SLAPI_LDIF2DB_ENCRYPT: - case SLAPI_DB2LDIF_DECRYPT: - pblock->pb_ldif_encrypt = *((int *)value); - break; - case SLAPI_SEARCH_CTRLS: - pblock->pb_search_ctrls = (LDAPControl **) value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_search_ctrls = (LDAPControl **) value; break; case SLAPI_PLUGIN_SYNTAX_FILTER_NORMALIZED: - pblock->pb_syntax_filter_normalized = *((int *)value); + _pblock_assert_pb_intplugin(pblock); + pblock->pb_intplugin->pb_syntax_filter_normalized = *((int *)value); break; case SLAPI_PLUGIN_SYNTAX_FILTER_DATA: - pblock->pb_syntax_filter_data = (void *)value; + _pblock_assert_pb_intplugin(pblock); + pblock->pb_intplugin->pb_syntax_filter_data = (void *)value; break; case SLAPI_PAGED_RESULTS_INDEX: - pblock->pb_paged_results_index = *(int *)value; + _pblock_assert_pb_intop(pblock); + pblock->pb_intop->pb_paged_results_index = *(int *)value; break; case SLAPI_PAGED_RESULTS_COOKIE: - pblock->pb_paged_results_cookie = *(int *)value; + pblock->pb_intop->pb_paged_results_cookie = *(int *)value; break; /* ACI Target Check */ case SLAPI_ACI_TARGET_CHECK: - pblock->pb_aci_target_check = *((int *) value); - break; - - /* dbverify */ - case SLAPI_DBVERIFY_DBDIR: - pblock->pb_dbverify_dbdir = (char *) value; + _pblock_assert_pb_misc(pblock); + pblock->pb_misc->pb_aci_target_check = *((int *) value); break; default: slapi_log_err(SLAPI_LOG_ERR, "slapi_pblock_set", "Unknown parameter block argument %d\n", arg); -#ifdef PBLOCK_ANALYTICS - Slapi_PBlock *boom = NULL; - void *x = (void *)boom->pb_plugin; -#endif + PR_ASSERT(0); return( -1 ); } @@ -3823,52 +4173,102 @@ bind_credentials_clear( Connection *conn, PRBool lock_conn, struct slapi_entry * slapi_pblock_get_pw_entry(Slapi_PBlock *pb) { - return pb->pb_pw_entry; +#ifdef PBLOCK_ANALYTICS + pblock_analytics_record(pb, SLAPI_PW_ENTRY); +#endif + if (pb->pb_intop != NULL) { + return pb->pb_intop->pb_pw_entry; + } + return NULL; } void slapi_pblock_set_pw_entry(Slapi_PBlock *pb, struct slapi_entry *entry) { - pb->pb_pw_entry = entry; +#ifdef PBLOCK_ANALYTICS + pblock_analytics_record(pb, SLAPI_PW_ENTRY); +#endif + _pblock_assert_pb_intop(pb); + pb->pb_intop->pb_pw_entry = entry; } passwdPolicy * slapi_pblock_get_pwdpolicy(Slapi_PBlock *pb) { - return pb->pwdpolicy; +#ifdef PBLOCK_ANALYTICS + pblock_analytics_record(pb, SLAPI_PWDPOLICY); +#endif + if (pb->pb_intop != NULL) { + return pb->pb_intop->pwdpolicy; + } + return NULL; } void slapi_pblock_set_pwdpolicy(Slapi_PBlock *pb, passwdPolicy *pwdpolicy) { - pb->pwdpolicy = pwdpolicy; +#ifdef PBLOCK_ANALYTICS + pblock_analytics_record(pb, SLAPI_PWDPOLICY); +#endif + _pblock_assert_pb_intop(pb); + pb->pb_intop->pwdpolicy = pwdpolicy; } int32_t slapi_pblock_get_ldif_dump_replica(Slapi_PBlock *pb) { - return pb->pb_ldif_dump_replica; +#ifdef PBLOCK_ANALYTICS + pblock_analytics_record(pb, SLAPI_LDIF_DUMP_REPLICA); +#endif + if (pb->pb_task != NULL) { + return pb->pb_task->ldif_dump_replica; + } + return 0; } void slapi_pblock_set_ldif_dump_replica(Slapi_PBlock *pb, int32_t dump_replica) { - pb->pb_ldif_dump_replica = dump_replica; +#ifdef PBLOCK_ANALYTICS + pblock_analytics_record(pb, SLAPI_LDIF_DUMP_REPLICA); +#endif + _pblock_assert_pb_task(pb); + pb->pb_task->ldif_dump_replica = dump_replica; } void * slapi_pblock_get_vattr_context(Slapi_PBlock *pb) { - return pb->pb_vattr_context; +#ifdef PBLOCK_ANALYTICS + pblock_analytics_record(pb, SLAPI_VATTR_CONTEXT); +#endif + if (pb->pb_intplugin != NULL) { + return pb->pb_intplugin->pb_vattr_context; + } + return NULL; } void slapi_pblock_set_vattr_context(Slapi_PBlock *pb, void *vattr_ctx) { - pb->pb_vattr_context = vattr_ctx; +#ifdef PBLOCK_ANALYTICS + pblock_analytics_record(pb, SLAPI_VATTR_CONTEXT); +#endif + _pblock_assert_pb_intplugin(pb); + pb->pb_intplugin->pb_vattr_context = vattr_ctx; } void * slapi_pblock_get_op_stack_elem(Slapi_PBlock *pb) { - return pb->op_stack_elem; +#ifdef PBLOCK_ANALYTICS + pblock_analytics_record(pb, SLAPI_OP_STACK_ELEM); +#endif + if (pb->pb_intop != NULL) { + return pb->pb_intop->op_stack_elem; + } + return NULL; } void slapi_pblock_set_op_stack_elem(Slapi_PBlock *pb, void *stack_elem) { - pb->op_stack_elem = stack_elem; +#ifdef PBLOCK_ANALYTICS + pblock_analytics_record(pb, SLAPI_OP_STACK_ELEM); +#endif + _pblock_assert_pb_intop(pb); + pb->pb_intop->op_stack_elem = stack_elem; } /* diff --git a/ldap/servers/slapd/pblock_v3.h b/ldap/servers/slapd/pblock_v3.h index df6d347f4..2ed2f5d4c 100644 --- a/ldap/servers/slapd/pblock_v3.h +++ b/ldap/servers/slapd/pblock_v3.h @@ -16,22 +16,106 @@ #include "slap.h" -typedef struct slapi_pblock { - /* common */ - Slapi_Backend *pb_backend; - Connection *pb_conn; - Operation *pb_op; - struct slapdplugin *pb_plugin; /* plugin being called */ - int pb_opreturn; +#ifdef DEBUG + /* #define PBLOCK_ANALYTICS 1 */ +#else +#undef PBLOCK_ANALYTICS +#endif + +typedef struct _slapi_pblock_dse { + int dont_add_write; /* if true, the dse is not written when an entry is added */ + int add_merge; /* if true, if a duplicate entry is found when adding, the + new values are merged into the old entry */ + int dont_check_dups; /* if false, use the "enhanced" version of str2entry to catch + more errors when adding dse entries; this can only be done + after the schema and syntax and matching rule plugins are + running */ + int is_primary_file; /* for read callbacks: non-zero for primary file */ + int reapply_mods; /* if true, dse_modify will reapply mods after modify callback */ + int schema_flags; /* schema flags */ + /* . check/load info (schema reload task) */ + /* . refresh user defined schema */ + +} slapi_pblock_dse; + +typedef struct _slapi_pblock_task { + char *instance_name; + Slapi_Task *task; + char *seq_attrname; + char *seq_val; + char *dbverify_dbdir; + char *ldif_file; + char **db2index_attrs; + + /* + * wire import (fast replica init) arguments + */ + struct slapi_entry *import_entry; + /* ldif2db: array of files to import all at once */ + char **ldif_files; + char **ldif_include; + char **ldif_exclude; + char *ldif_namespaceid; /* used for name based uniqueid generation */ + int ldif_dump_replica; + int ldif_dump_uniqueid; /* dump uniqueid during db2ldif */ + int ldif_generate_uniqueid; /* generate uniqueid during db2ldif */ + int ldif_encrypt; /* used to enable encrypt/decrypt on import and export */ + int seq_type; + int removedupvals; + int ldif2db_noattrindexes; + int ldif_printkey; + int task_flags; + int import_state; + + int server_running; /* indicate that server is running */ +} slapi_pblock_task; + +typedef struct _slapi_pblock_matching_rule { + /* matching rule arguments */ + mrFilterMatchFn filter_match_fn; + IFP filter_index_fn; + IFP filter_reset_fn; + IFP index_fn; /* values and keys are struct berval ** */ + IFP index_sv_fn; /* values and keys are Slapi_Value ** */ + char* oid; + char* type; + struct berval* value; + struct berval** values; + struct berval** keys; + unsigned int filter_reusable; + int query_operator; + unsigned int usage; +} slapi_pblock_matching_rule; + +typedef struct _slapi_pblock_intplugin { void* pb_object; /* points to data private to plugin */ + void *pb_plugin_identity; /* identifies plugin for internal operation */ + char *pb_plugin_config_area; /* optional config area */ + void *pb_vattr_context; /* hold the vattr_context for roles/cos */ + + void *pb_syntax_filter_data; /* extra data to pass to a syntax plugin function */ + int *pb_substrlens; /* user specified minimum substr search key lengths: + * nsSubStrBegin, nsSubStrMiddle, nsSubStrEnd + */ + char *pb_slapd_configdir; /* the config directory passed to slapd on the command line */ IFP pb_destroy_fn; - int pb_requestor_isroot; - /* config file */ - char *pb_config_fname; - int pb_config_lineno; - int pb_config_argc; - char **pb_config_argv; - int plugin_tracking; + int pb_plugin_enabled; /* nsslapd-pluginEnabled: on|off */ + /* used in plugin init; pb_plugin is not ready, then */ + int pb_syntax_filter_normalized; /* the syntax filter types/values are already normalized */ + +} slapi_pblock_intplugin; + +/* Contains parts for internal operations that are NOT in the pb_op */ +typedef struct _slapi_pblock_intop { + void *op_stack_elem; + + void *pb_parent_txn; /* parent transaction ID */ + void *pb_txn; /* transaction ID */ + IFP pb_txn_ruv_mods_fn; /* Function to fetch RUV mods for txn */ + passwdPolicy *pwdpolicy; + LDAPControl **pb_ctrls_arg; /* allows to pass controls as arguments before + operation object is created */ + struct slapi_entry *pb_pw_entry; /* stash dup'ed entry that shadow info is added/replaced */ /* [pre|post]add arguments */ struct slapi_entry *pb_target_entry; /* JCM - Duplicated */ @@ -43,141 +127,85 @@ typedef struct slapi_pblock { /* state of entry before and after add/delete/modify/moddn/modrdn */ struct slapi_entry *pb_pre_op_entry; struct slapi_entry *pb_post_op_entry; - /* seq access arguments */ - int pb_seq_type; - char *pb_seq_attrname; - char *pb_seq_val; - /* dbverify argument */ - char *pb_dbverify_dbdir; - /* ldif2db arguments */ - char *pb_ldif_file; - int pb_removedupvals; - char **pb_db2index_attrs; - int pb_ldif2db_noattrindexes; - /* db2ldif arguments */ - int pb_ldif_printkey; - /* ldif2db/db2ldif/db2bak/bak2db args */ - char *pb_instance_name; - Slapi_Task *pb_task; - int pb_task_flags; - /* matching rule arguments */ - mrFilterMatchFn pb_mr_filter_match_fn; - IFP pb_mr_filter_index_fn; - IFP pb_mr_filter_reset_fn; - IFP pb_mr_index_fn; /* values and keys are struct berval ** */ - char* pb_mr_oid; - char* pb_mr_type; - struct berval* pb_mr_value; - struct berval** pb_mr_values; - struct berval** pb_mr_keys; - unsigned int pb_mr_filter_reusable; - int pb_mr_query_operator; - unsigned int pb_mr_usage; - - /* arguments for password storage scheme (kexcoff) */ - char *pb_pwd_storage_scheme_user_passwd; - char *pb_pwd_storage_scheme_db_passwd; + /* pointer to array of results returned on search */ + Slapi_Entry **pb_plugin_internal_search_op_entries; + char **pb_plugin_internal_search_op_referrals; + LDAPControl **pb_search_ctrls; /* for search operations, allows plugins to provide + controls to pass for each entry or referral returned */ + /* NEW in 5.0 for getting back the backend result in frontend */ + char * pb_result_text; /* result text when available */ + char * pb_urp_naming_collision_dn; /* replication naming conflict removal */ + char * pb_urp_tombstone_uniqueid; /* replication change tombstone */ + int pb_opreturn; /* controls we know about */ int pb_managedsait; - /* additional fields for plugin_internal_ldap_ops */ /* result code of internal ldap_operation */ int pb_internal_op_result; - /* pointer to array of results returned on search */ - Slapi_Entry **pb_plugin_internal_search_op_entries; - char **pb_plugin_internal_search_op_referrals; - void *pb_plugin_identity; /* identifies plugin for internal operation */ - char *pb_plugin_config_area; /* optional config area */ - void *pb_parent_txn; /* parent transaction ID */ - void *pb_txn; /* transaction ID */ - IFP pb_txn_ruv_mods_fn; /* Function to fetch RUV mods for txn */ - - /* Size of the database on disk, in kilobytes */ - unsigned int pb_dbsize; - - /* THINGS BELOW THIS LINE EXIST ONLY IN SLAPI v2 (slapd 4.0+) */ - - /* ldif2db: array of files to import all at once */ - char **pb_ldif_files; - - char **pb_ldif_include; - char **pb_ldif_exclude; - int pb_ldif_dump_replica; - int pb_ldif_dump_uniqueid; /* dump uniqueid during db2ldif */ - int pb_ldif_generate_uniqueid; /* generate uniqueid during db2ldif */ - char* pb_ldif_namespaceid; /* used for name based uniqueid generation */ - int pb_ldif_encrypt; /* used to enable encrypt/decrypt on import and export */ + int pb_requestor_isroot; + int pb_nentries; /* number of entries to be returned */ /* * notes to log with RESULT line in the access log * these are actually stored as a bitmap; see slapi-plugin.h for * defined notes. */ unsigned int pb_operation_notes; + /* For password policy control */ + int pb_pwpolicy_ctrl; + + int pb_paged_results_index; /* stash SLAPI_PAGED_RESULTS_INDEX */ + int pb_paged_results_cookie; /* stash SLAPI_PAGED_RESULTS_COOKIE */ +} slapi_pblock_intop; + +/* Stuff that is rarely used, but still present */ +typedef struct _slapi_pblock_misc { + char** pb_slapd_argv; + /* Size of the database on disk, in kilobytes */ + unsigned int pb_dbsize; + int pb_backend_count; /* instance count involved in the op */ /* * slapd command line arguments */ int pb_slapd_argc; - char** pb_slapd_argv; - char *pb_slapd_configdir; /* the config directory passed to slapd on the command line */ - LDAPControl **pb_ctrls_arg; /* allows to pass controls as arguments before - operation object is created */ - int pb_dse_dont_add_write; /* if true, the dse is not written when an entry is added */ - int pb_dse_add_merge; /* if true, if a duplicate entry is found when adding, the - new values are merged into the old entry */ - int pb_dse_dont_check_dups; /* if false, use the "enhanced" version of str2entry to catch - more errors when adding dse entries; this can only be done - after the schema and syntax and matching rule plugins are - running */ - int pb_dse_is_primary_file; /* for read callbacks: non-zero for primary file */ - int pb_schema_flags; /* schema flags */ - /* . check/load info (schema reload task) */ - /* . refresh user defined schema */ + /* For ACI Target Check */ + int pb_aci_target_check; /* this flag prevents duplicate checking of ACI's target existence */ +} slapi_pblock_misc; - /* NEW in 5.0 for getting back the backend result in frontend */ +/* This struct is full of stuff we rarely, or never use. */ +typedef struct _slapi_pblock_deprecated { int pb_result_code; /* operation result code */ - char * pb_result_text; /* result text when available */ + int plugin_tracking; + int pb_config_argc; + char **pb_config_argv; char * pb_result_matched; /* macthed dn when NO SUCH OBJECT error */ - int pb_nentries; /* number of entries to be returned */ - struct berval **urls; /* urls of referrals to be returned */ - - /* - * wire import (fast replica init) arguments - */ - struct slapi_entry *pb_import_entry; - int pb_import_state; - int pb_destroy_content; /* flag to indicate that pblock content should be destroyed when pblock is destroyed */ - int pb_dse_reapply_mods; /* if true, dse_modify will reapply mods after modify callback */ - char * pb_urp_naming_collision_dn; /* replication naming conflict removal */ - char * pb_urp_tombstone_uniqueid; /* replication change tombstone */ - int pb_server_running; /* indicate that server is running */ - int pb_backend_count; /* instance count involved in the op */ - - /* For password policy control */ - int pb_pwpolicy_ctrl; - void *pb_vattr_context; /* hold the vattr_context for roles/cos */ + struct berval **urls; /* urls of referrals to be returned */ + /* arguments for password storage scheme (kexcoff) */ + char *pb_pwd_storage_scheme_user_passwd; + char *pb_pwd_storage_scheme_db_passwd; + /* config file */ + char *pb_config_fname; + int pb_config_lineno; +} slapi_pblock_deprecated; - int *pb_substrlens; /* user specified minimum substr search key lengths: - * nsSubStrBegin, nsSubStrMiddle, nsSubStrEnd - */ - int pb_plugin_enabled; /* nsslapd-pluginEnabled: on|off */ - /* used in plugin init; pb_plugin is not ready, then */ - LDAPControl **pb_search_ctrls; /* for search operations, allows plugins to provide - controls to pass for each entry or referral returned */ - IFP pb_mr_index_sv_fn; /* values and keys are Slapi_Value ** */ - int pb_syntax_filter_normalized; /* the syntax filter types/values are already normalized */ - void *pb_syntax_filter_data; /* extra data to pass to a syntax plugin function */ - int pb_paged_results_index; /* stash SLAPI_PAGED_RESULTS_INDEX */ - int pb_paged_results_cookie; /* stash SLAPI_PAGED_RESULTS_COOKIE */ - passwdPolicy *pwdpolicy; - void *op_stack_elem; +typedef struct slapi_pblock { + /* common */ + Slapi_Backend *pb_backend; + Connection *pb_conn; + Operation *pb_op; + struct slapdplugin *pb_plugin; /* plugin being called */ - /* For ACI Target Check */ - int pb_aci_target_check; /* this flag prevents duplicate checking of ACI's target existence */ + /* Private tree of fields for our operations, grouped by usage patterns */ + struct _slapi_pblock_dse *pb_dse; + struct _slapi_pblock_task *pb_task; + struct _slapi_pblock_matching_rule *pb_mr; + struct _slapi_pblock_misc *pb_misc; + struct _slapi_pblock_intop *pb_intop; + struct _slapi_pblock_intplugin *pb_intplugin; + struct _slapi_pblock_deprecated *pb_deprecated; - struct slapi_entry *pb_pw_entry; /* stash dup'ed entry that shadow info is added/replaced */ #ifdef PBLOCK_ANALYTICS uint32_t analytics_init; PLHashTable *analytics; diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h index 5469b5104..2f84d27ae 100644 --- a/ldap/servers/slapd/slap.h +++ b/ldap/servers/slapd/slap.h @@ -129,12 +129,6 @@ typedef struct symbol_t { #include <systemd/sd-daemon.h> #endif -#ifdef DEBUG - // #define PBLOCK_ANALYTICS 1 -#else -#undef PBLOCK_ANALYTICS -#endif - #if defined(OS_solaris) # include <thread.h> # define GET_THREAD_ID() thr_self() diff --git a/ldap/servers/slapd/uuid.c b/ldap/servers/slapd/uuid.c index effd864fa..333321cc1 100644 --- a/ldap/servers/slapd/uuid.c +++ b/ldap/servers/slapd/uuid.c @@ -658,7 +658,7 @@ static int add_state_entry(void) else { slapi_pblock_get( pb, SLAPI_PLUGIN_INTOP_RESULT, &rt); - slapi_ch_free((void **) &pb); + slapi_pblock_destroy(pb); } if (rt != LDAP_SUCCESS) diff --git a/test/pblock_analyse.py b/test/pblock_analyse.py index 4effedcc3..f5f8126cb 100644 --- a/test/pblock_analyse.py +++ b/test/pblock_analyse.py @@ -60,38 +60,78 @@ def determine_pblock_groups(flat_results): if subset is False: ss_flat_results.append(pbs_a) - #for pbs in sorted(ss_flat_results, key=len): - # print(pbs) + for pbs in sorted(ss_flat_results, key=len): + print('pbs -> %s' % sorted(pbs)) + print('== unique filtered pblocks %s ==' % len(ss_flat_results)) + + # We build some sets of attrs we expect in certain things + e_plugin_set = set(['13']) + e_search_set = set(['195', '113']) + e_modrdn_set = set(['100', '103', '101']) + e_backend_plugin_set = set(['213', '202', '214']) + e_op_set = set(['1001', '47']) + e_task_set = set(['178', '181', '182', '192']) + e_dse_set = set(['282', '283', '281', '289']) # Now, we can group these by plugin callback, and searches. # Check for plugin_enabled + task_set = set() + backend_plugin_set = set() plugin_set = set() search_set = set() - other_set = set() + modrdn_set = set() + urp_set = set() + op_set = set() + dse_set = set() + for pbs in ss_flat_results: - # 815 is plugin_enabled - if '815' in pbs: - plugin_set.update(pbs) - elif '216' in pbs: # This is db_result_fn + # 3 is plugin, and 130 backend. + if e_search_set & pbs: search_set.update(pbs) + elif e_modrdn_set & pbs: + modrdn_set.update(pbs) + elif e_op_set & pbs: + op_set.update(pbs) + elif e_task_set & pbs: + task_set.update(pbs) + elif e_backend_plugin_set & pbs: + backend_plugin_set.update(pbs) + elif e_plugin_set & pbs: + plugin_set.update(pbs) + elif e_dse_set & pbs: + dse_set.update(pbs) else: - other_set.update(pbs) + print('unclassified pb %s' % sorted(pbs)) + + # Now, make each set unique to itself. - overlap_set = plugin_set & search_set + excess_set = access_values - (task_set | backend_plugin_set | plugin_set | search_set | op_set | dse_set | modrdn_set ) - print('plugin_set: %s' % plugin_set) - print('search_set: %s' % search_set) - print('other_set: %s' % other_set) - print('overlap : %s' % (plugin_set & search_set)) - print ('== frequency of overlap from %s unique pblocks ==' % (len(flat_results))) + + print('plugin_set: %s' % sorted(plugin_set)) + print('') + print('backend_plugin_set: %s' % sorted(backend_plugin_set)) + print('') + print('search_set: %s' % sorted(search_set)) + print('') + print('modrdn_set: %s' % sorted(modrdn_set)) + print('') + print('urp_set: %s' % sorted(urp_set)) + print('') + print('task_set: %s' % sorted(task_set)) + print('') + print('op_set: %s' % sorted(op_set)) + print('') + print('dse_set: %s' % sorted(dse_set)) + print('') + print('excess_set: %s' % sorted(excess_set)) + print('') + + print ('== frequency of overlap from %s unique pblocks ==' % (len(ss_flat_results))) for r in sorted(results, key=results.get, reverse=True): if r in overlap_set: print('pop: av %s count %s' % (r, results[r])) - print ('== frequency of other from %s unique pblocks ==' % (len(flat_results))) - for r in sorted(results, key=results.get, reverse=True): - if r in other_set: - print('pop: av %s count %s' % (r, results[r])) def analyse():
0
415d8553eddfe9b19fd9b8d8be9b934bf75a5765
389ds/389-ds-base
Ticket #48757 - License tag does not match actual license of code Fix Description: License tag in the spec file was updated to match the actual license of code.
commit 415d8553eddfe9b19fd9b8d8be9b934bf75a5765 Author: Noriko Hosoi <[email protected]> Date: Tue Mar 8 14:52:37 2016 -0800 Ticket #48757 - License tag does not match actual license of code Fix Description: License tag in the spec file was updated to match the actual license of code. diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in index 974e073f6..e4665e833 100644 --- a/rpm/389-ds-base.spec.in +++ b/rpm/389-ds-base.spec.in @@ -39,7 +39,7 @@ Summary: 389 Directory Server (base) Name: 389-ds-base Version: __VERSION__ Release: __RELEASE__%{?dist} -License: GPLv2 with exceptions +License: GPLv3+ URL: http://port389.org/ Group: System Environment/Daemons BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
0
732b57f12ed407bf7c1acb661bf48504b42b28ea
389ds/389-ds-base
610281 - fix coverity Defect Type: Control flow issues https://bugzilla.redhat.com/show_bug.cgi?id=610281 11815 DEADCODE Triaged Unassigned Bug Minor Fix Required distinguishedname_validate() ds/ldap/servers/plugins/syntaxes/validate.c Comment: A variable val_copy is declared and initialized, but not used. We remove these lines: 364 char *val_copy = NULL; 403 if (val_copy) { Execution cannot reach this statement "slapi_ch_free_string(&val_c...". 404 slapi_ch_free_string(&val_copy); 405 }
commit 732b57f12ed407bf7c1acb661bf48504b42b28ea Author: Noriko Hosoi <[email protected]> Date: Fri Jul 2 17:23:07 2010 -0700 610281 - fix coverity Defect Type: Control flow issues https://bugzilla.redhat.com/show_bug.cgi?id=610281 11815 DEADCODE Triaged Unassigned Bug Minor Fix Required distinguishedname_validate() ds/ldap/servers/plugins/syntaxes/validate.c Comment: A variable val_copy is declared and initialized, but not used. We remove these lines: 364 char *val_copy = NULL; 403 if (val_copy) { Execution cannot reach this statement "slapi_ch_free_string(&val_c...". 404 slapi_ch_free_string(&val_copy); 405 } diff --git a/ldap/servers/plugins/syntaxes/validate.c b/ldap/servers/plugins/syntaxes/validate.c index 989137b5f..cfdb17f0f 100644 --- a/ldap/servers/plugins/syntaxes/validate.c +++ b/ldap/servers/plugins/syntaxes/validate.c @@ -361,7 +361,6 @@ int distinguishedname_validate( ) { int rc = 0; /* Assume value is valid */ - char *val_copy = NULL; const char *p = begin; const char *last = NULL; @@ -400,9 +399,6 @@ int distinguishedname_validate( } exit: - if (val_copy) { - slapi_ch_free_string(&val_copy); - } return rc; }
0
9fa46b83773faaf7f7f6adff35eabb7d26d21c55
389ds/389-ds-base
Issue 3522 - Remove DES to AES conversion code Description: remove the reversible password storage scheem upgrade code. This was only needed for people moving from 1.2.10, which has not been supported for years. Fixes: https://github.com/389ds/389-ds-base/issues/3522 Reviewed by: firstyear & spichugi(Thanks!!)
commit 9fa46b83773faaf7f7f6adff35eabb7d26d21c55 Author: Mark Reynolds <[email protected]> Date: Wed Dec 9 09:56:13 2020 -0500 Issue 3522 - Remove DES to AES conversion code Description: remove the reversible password storage scheem upgrade code. This was only needed for people moving from 1.2.10, which has not been supported for years. Fixes: https://github.com/389ds/389-ds-base/issues/3522 Reviewed by: firstyear & spichugi(Thanks!!) diff --git a/dirsrvtests/tests/tickets/ticket47462_test.py b/dirsrvtests/tests/tickets/ticket47462_test.py deleted file mode 100644 index 021fe096b..000000000 --- a/dirsrvtests/tests/tickets/ticket47462_test.py +++ /dev/null @@ -1,296 +0,0 @@ -# --- BEGIN COPYRIGHT BLOCK --- -# Copyright (C) 2016 Red Hat, Inc. -# All rights reserved. -# -# License: GPL (version 3 or any later version). -# See LICENSE for details. -# --- END COPYRIGHT BLOCK --- -# -import logging -import time - -import ldap -import pytest -from lib389 import Entry -from lib389._constants import * -from lib389.properties import * -from lib389.topologies import topology_m2 -from lib389.utils import * -from lib389.replica import BootstrapReplicationManager -from lib389.plugins import * - -pytestmark = [pytest.mark.tier2, - pytest.mark.skipif(ds_is_newer('1.4.0'), reason="Upgrade scripts are supported only on versions < 1.4.x")] - - -logging.getLogger(__name__).setLevel(logging.DEBUG) -log = logging.getLogger(__name__) - -DES_PLUGIN = 'cn=DES,cn=Password Storage Schemes,cn=plugins,cn=config' -AES_PLUGIN = 'cn=AES,cn=Password Storage Schemes,cn=plugins,cn=config' -MMR_PLUGIN = 'cn=Multimaster Replication Plugin,cn=plugins,cn=config' -AGMT_DN = '' -USER_DN = 'cn=test_user,' + DEFAULT_SUFFIX -USER1_DN = 'cn=test_user1,' + DEFAULT_SUFFIX -TEST_REPL_DN = 'cn=test repl,' + DEFAULT_SUFFIX -DES2AES_TASK_DN = 'cn=convert,cn=des2aes,cn=tasks,cn=config' - - -def test_ticket47462(topology_m2): - """ - Test that AES properly replaces DES during an update/restart, and that - replication also works correctly. - """ - - # - # First set config as if it's an older version. Set DES to use - # libdes-plugin, MMR to depend on DES, delete the existing AES plugin, - # and set a DES password for the replication agreement. - # - # Add an extra attribute to the DES plugin args - # - plugin_des = Plugin(topology_m2.ms["master1"], DES_PLUGIN) - plugin_des.set('nsslapd-pluginEnabled', 'on') - plugin_des.set('nsslapd-pluginarg2', 'description') - - plugin_mmr = Plugin(topology_m2.ms["master1"], MMR_PLUGIN) - plugin_mmr.remove('nsslapd-plugin-depends-on-named', 'AES') - # - # Delete the AES plugin - # - topology_m2.ms["master1"].delete_s(AES_PLUGIN) - # restart the server so we must use DES plugin - topology_m2.ms["master1"].restart(timeout=10) - - manager = BootstrapReplicationManager(topology_m2.ms["master2"]) - - manager.create(properties={ - 'cn': 'replication manager', - 'userPassword': 'password' - }) - - DN = topology_m2.ms["master2"].replica._get_mt_entry(DEFAULT_SUFFIX) - - topology_m2.ms["master2"].modify_s(DN, [(ldap.MOD_REPLACE, - 'nsDS5ReplicaBindDN', ensure_bytes(defaultProperties[REPLICATION_BIND_DN]))]) - # - # Create repl agreement from the newly promoted master to master1 - - properties = {RA_NAME: 'meTo_{}:{}'.format(topology_m2.ms["master2"].host, - str(topology_m2.ms["master2"].port)), - RA_BINDDN: defaultProperties[REPLICATION_BIND_DN], - RA_BINDPW: defaultProperties[REPLICATION_BIND_PW], - RA_METHOD: defaultProperties[REPLICATION_BIND_METHOD], - RA_TRANSPORT_PROT: defaultProperties[REPLICATION_TRANSPORT]} - topology_m2.ms["master1"].agreement.create(suffix=SUFFIX, - host=topology_m2.ms["master2"].host, - port=topology_m2.ms["master2"].port, - properties=properties) - # - # Check replication works with the new DES password - # - try: - topology_m2.ms["master1"].add_s(Entry((USER1_DN, - {'objectclass': "top person".split(), - 'sn': 'sn', - 'description': 'DES value to convert', - 'cn': 'test_user'}))) - loop = 0 - ent = None - while loop <= 10: - try: - ent = topology_m2.ms["master2"].getEntry(USER1_DN, ldap.SCOPE_BASE, - "(objectclass=*)") - break - except ldap.NO_SUCH_OBJECT: - time.sleep(1) - loop += 1 - if not ent: - log.fatal('Replication test failed fo user1!') - assert False - else: - log.info('Replication test passed') - except ldap.LDAPError as e: - log.fatal('Failed to add test user: ' + e.args[0]['desc']) - assert False - - # - # Add a backend (that has no entries) - # - try: - topology_m2.ms["master1"].backend.create("o=empty", {BACKEND_NAME: "empty"}) - except ldap.LDAPError as e: - log.fatal('Failed to create extra/empty backend: ' + e.args[0]['desc']) - assert False - - # - # Run the upgrade... - # - topology_m2.ms["master1"].stop() - topology_m2.ms["master2"].stop() - topology_m2.ms["master1"].upgrade('offline') - topology_m2.ms["master1"].restart() - topology_m2.ms["master2"].restart() - - # - # Check that the restart converted existing DES credentials - # - try: - entry = topology_m2.ms["master1"].search_s('cn=config', ldap.SCOPE_SUBTREE, - 'nsDS5ReplicaCredentials=*') - if entry: - val = entry[0].getValue('nsDS5ReplicaCredentials') - if val.startswith(b'{AES-'): - log.info('The DES credentials have been converted to AES') - else: - log.fatal('Failed to convert credentials from DES to AES!') - assert False - else: - log.fatal('Failed to find entries with nsDS5ReplicaCredentials') - assert False - except ldap.LDAPError as e: - log.fatal('Failed to search for replica credentials: ' + - e.args[0]['desc']) - assert False - - # - # Check that the AES plugin exists, and has all the attributes listed in - # DES plugin. The attributes might not be in the expected order so check - # all the attributes. - # - try: - entry = topology_m2.ms["master1"].search_s(AES_PLUGIN, ldap.SCOPE_BASE, - 'objectclass=*') - if not entry[0].hasValue('nsslapd-pluginarg0', 'description') and \ - not entry[0].hasValue('nsslapd-pluginarg1', 'description') and \ - not entry[0].hasValue('nsslapd-pluginarg2', 'description'): - log.fatal('The AES plugin did not have the DES attribute copied ' + - 'over correctly') - assert False - else: - log.info('The AES plugin was correctly setup') - except ldap.LDAPError as e: - log.fatal('Failed to find AES plugin: ' + e.args[0]['desc']) - assert False - - # - # Check that the MMR plugin was updated - # - try: - entry = topology_m2.ms["master1"].search_s(MMR_PLUGIN, ldap.SCOPE_BASE, - 'objectclass=*') - if not entry[0].hasValue('nsslapd-plugin-depends-on-named', 'AES'): - log.fatal('The MMR Plugin was not correctly updated') - assert False - else: - log.info('The MMR plugin was correctly updated') - except ldap.LDAPError as e: - log.fatal('Failed to find AES plugin: ' + e.args[0]['desc']) - assert False - - # - # Check that the DES plugin was correctly updated - # - try: - entry = topology_m2.ms["master1"].search_s(DES_PLUGIN, ldap.SCOPE_BASE, - 'objectclass=*') - if not entry[0].hasValue('nsslapd-pluginPath', 'libpbe-plugin'): - log.fatal('The DES Plugin was not correctly updated') - assert False - else: - log.info('The DES plugin was correctly updated') - except ldap.LDAPError as e: - log.fatal('Failed to find AES plugin: ' + e.args[0]['desc']) - assert False - - # - # Check replication one last time - # - try: - topology_m2.ms["master1"].add_s(Entry((USER_DN, - {'objectclass': "top person".split(), - 'sn': 'sn', - 'cn': 'test_user'}))) - loop = 0 - ent = None - while loop <= 10: - try: - ent = topology_m2.ms["master2"].getEntry(USER_DN, ldap.SCOPE_BASE, - "(objectclass=*)") - break - except ldap.NO_SUCH_OBJECT: - time.sleep(1) - loop += 1 - if not ent: - log.fatal('Replication test failed!') - assert False - else: - log.info('Replication test passed') - except ldap.LDAPError as e: - log.fatal('Failed to add test user: ' + e.args[0]['desc']) - assert False - - # Check the entry - log.info('Entry before running task...') - try: - entry = topology_m2.ms["master1"].search_s(USER1_DN, - ldap.SCOPE_BASE, - 'objectclass=*') - if entry: - print(str(entry)) - else: - log.fatal('Failed to find entries') - assert False - except ldap.LDAPError as e: - log.fatal('Failed to search for entries: ' + - e.args[0]['desc']) - assert False - - # - # Test the DES2AES Task on USER1_DN - # - try: - topology_m2.ms["master1"].add_s(Entry((DES2AES_TASK_DN, - {'objectclass': ['top', - 'extensibleObject'], - 'suffix': DEFAULT_SUFFIX, - 'cn': 'convert'}))) - except ldap.LDAPError as e: - log.fatal('Failed to add task entry: ' + e.args[0]['desc']) - assert False - - # Wait for task - task_entry = Entry(DES2AES_TASK_DN) - (done, exitCode) = topology_m2.ms["master1"].tasks.checkTask(task_entry, True) - if exitCode: - log.fatal("Error: des2aes task exited with %d" % (exitCode)) - assert False - - # Check the entry - try: - entry = topology_m2.ms["master1"].search_s(USER1_DN, - ldap.SCOPE_BASE, - 'objectclass=*') - if entry: - val = entry[0].getValue('description') - print(str(entry[0])) - if val.startswith(b'{AES-'): - log.info('Task: DES credentials have been converted to AES') - else: - log.fatal('Task: Failed to convert credentials from DES to ' + - 'AES! (%s)' % (val)) - assert False - else: - log.fatal('Failed to find entries') - assert False - except ldap.LDAPError as e: - log.fatal('Failed to search for entries: ' + - e.args[0]['desc']) - assert False - - -if __name__ == '__main__': - # Run isolated - # -s for DEBUG mode - CURRENT_FILE = os.path.realpath(__file__) - pytest.main("-s %s" % CURRENT_FILE) diff --git a/ldap/ldif/template-dse-minimal.ldif.in b/ldap/ldif/template-dse-minimal.ldif.in index 0084e7e0f..1a05f4a67 100644 --- a/ldap/ldif/template-dse-minimal.ldif.in +++ b/ldap/ldif/template-dse-minimal.ldif.in @@ -194,19 +194,6 @@ nsslapd-pluginarg1: nsds5ReplicaCredentials nsslapd-pluginid: aes-storage-scheme nsslapd-pluginprecedence: 1 -dn: cn=DES,cn=Password Storage Schemes,cn=plugins,cn=config -objectclass: top -objectclass: nsSlapdPlugin -objectclass: extensibleObject -cn: DES -nsslapd-pluginpath: libpbe-plugin -nsslapd-plugininitfunc: des_init -nsslapd-plugintype: reverpwdstoragescheme -nsslapd-pluginenabled: on -nsslapd-pluginarg0: nsmultiplexorcredentials -nsslapd-pluginarg1: nsds5ReplicaCredentials -nsslapd-pluginid: des-storage-scheme - dn: cn=Syntax Validation Task,cn=plugins,cn=config objectclass: top objectclass: nsSlapdPlugin diff --git a/ldap/ldif/template-dse.ldif.in b/ldap/ldif/template-dse.ldif.in index f283c1b36..b09fb3893 100644 --- a/ldap/ldif/template-dse.ldif.in +++ b/ldap/ldif/template-dse.ldif.in @@ -242,19 +242,6 @@ nsslapd-pluginarg2: nsds5ReplicaBootstrapCredentials nsslapd-pluginid: aes-storage-scheme nsslapd-pluginprecedence: 1 -dn: cn=DES,cn=Password Storage Schemes,cn=plugins,cn=config -objectclass: top -objectclass: nsSlapdPlugin -objectclass: extensibleObject -cn: DES -nsslapd-pluginpath: libpbe-plugin -nsslapd-plugininitfunc: des_init -nsslapd-plugintype: reverpwdstoragescheme -nsslapd-pluginenabled: on -nsslapd-pluginarg0: nsmultiplexorcredentials -nsslapd-pluginarg1: nsds5ReplicaCredentials -nsslapd-pluginid: des-storage-scheme - dn: cn=Syntax Validation Task,cn=plugins,cn=config objectclass: top objectclass: nsSlapdPlugin diff --git a/ldap/servers/plugins/rever/pbe.c b/ldap/servers/plugins/rever/pbe.c index b90ec350b..77a851db5 100644 --- a/ldap/servers/plugins/rever/pbe.c +++ b/ldap/servers/plugins/rever/pbe.c @@ -141,6 +141,13 @@ decode_path(char *inCipher, char **outPlain, char *path, int mech, char *algid) *outPlain = NULL; err = 1; + if (mech == DES_MECH) { + slapi_log_err(SLAPI_LOG_NOTICE, "decode_path", + "Decoding DES reversible password, DES is no longer a supported algorithm, " + "please use AES reversible password encryption.\n"); + + } + if (genKey(&context, path, mech, arena, algid) == SVRCORE_Success) { /* it seems that there is memory leak in that function: bug 400170 */ base = ATOB_AsciiToData(inCipher, (unsigned int *)&len); diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c index dce78eb14..0b43c538b 100644 --- a/ldap/servers/slapd/daemon.c +++ b/ldap/servers/slapd/daemon.c @@ -736,148 +736,6 @@ handle_listeners(Connection_Table *ct) return; } -/* - * Convert any pre-existing DES passwords to AES. - * - * Grab the "password" attributes and search all the backends for - * these attributes and convert them to AES if they are DES encoded. - */ -static void -convert_pbe_des_to_aes(void) -{ - Slapi_Entry **entries = NULL; - struct slapdplugin *plugin = NULL; - char **attrs = NULL; - char *val = NULL; - int converted_des_passwd = 0; - int result = -1; - int have_aes = 0; - int have_des = 0; - int i = 0, ii = 0; - - /* - * Check that AES plugin is enabled, and grab all the unique - * password attributes. - */ - for (plugin = get_plugin_list(PLUGIN_LIST_REVER_PWD_STORAGE_SCHEME); - plugin != NULL; - plugin = plugin->plg_next) { - char *arg = NULL; - - if (plugin->plg_started && strcasecmp(plugin->plg_name, "AES") == 0) { - /* We have the AES plugin, and its enabled */ - have_aes = 1; - } - if (plugin->plg_started && strcasecmp(plugin->plg_name, "DES") == 0) { - /* We have the DES plugin, and its enabled */ - have_des = 1; - } - /* Gather all the unique password attributes from all the PBE plugins */ - for (i = 0, arg = plugin->plg_argv[i]; - i < plugin->plg_argc; - arg = plugin->plg_argv[++i]) { - if (charray_inlist(attrs, arg)) { - continue; - } - charray_add(&attrs, slapi_ch_strdup(arg)); - } - } - - if (have_aes && have_des) { - /* - * Find any entries in cn=config that contain DES passwords and convert - * them to AES - */ - slapi_log_err(SLAPI_LOG_HOUSE, "convert_pbe_des_to_aes", - "Converting DES passwords to AES...\n"); - - for (i = 0; attrs && attrs[i]; i++) { - char *filter = PR_smprintf("%s=*", attrs[i]); - - Slapi_PBlock *pb = slapi_pblock_new(); - slapi_search_internal_set_pb(pb, "cn=config", - LDAP_SCOPE_SUBTREE, filter, NULL, 0, NULL, NULL, - (void *)plugin_get_default_component_id(), - SLAPI_OP_FLAG_IGNORE_UNINDEXED); - slapi_search_internal_pb(pb); - slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); - for (ii = 0; entries && entries[ii]; ii++) { - if ((val = (char *)slapi_entry_attr_get_ref(entries[ii], attrs[i]))) { - if (strlen(val) >= 5 && strncmp(val, "{DES}", 5) == 0) { - /* - * We have a DES encoded password, convert it to AES - */ - Slapi_Value *sval = NULL; - LDAPMod mod_replace; - LDAPMod *mods[2]; - char *replace_val[2]; - char *passwd = NULL; - int rc = 0; - - /* decode the DES password */ - if (pw_rever_decode(val, &passwd, attrs[i]) == -1) { - slapi_log_err(SLAPI_LOG_ERR, "convert_pbe_des_to_aes", - "Failed to decode existing DES password for (%s)\n", - slapi_entry_get_dn(entries[ii])); - rc = -1; - } - - /* encode the password */ - if (rc == 0) { - sval = slapi_value_new_string(passwd); - if (pw_rever_encode(&sval, attrs[i]) == -1) { - slapi_log_err(SLAPI_LOG_ERR, "convert_pbe_des_to_aes", - "failed to encode AES password for (%s)\n", - slapi_entry_get_dn(entries[ii])); - rc = -1; - } - } - - if (rc == 0) { - Slapi_PBlock *mod_pb = slapi_pblock_new(); - /* replace the attribute in the entry */ - replace_val[0] = (char *)slapi_value_get_string(sval); - replace_val[1] = NULL; - mod_replace.mod_op = LDAP_MOD_REPLACE; - mod_replace.mod_type = attrs[i]; - mod_replace.mod_values = replace_val; - mods[0] = &mod_replace; - mods[1] = 0; - - slapi_modify_internal_set_pb(mod_pb, slapi_entry_get_dn(entries[ii]), - mods, 0, 0, (void *)plugin_get_default_component_id(), 0); - slapi_modify_internal_pb(mod_pb); - - slapi_pblock_get(mod_pb, SLAPI_PLUGIN_INTOP_RESULT, &result); - slapi_pblock_destroy(mod_pb); - if (LDAP_SUCCESS != result) { - slapi_log_err(SLAPI_LOG_ERR, "convert_pbe_des_to_aes", - "Failed to convert password for (%s) error (%d)\n", - slapi_entry_get_dn(entries[ii]), result); - } else { - slapi_log_err(SLAPI_LOG_HOUSE, "convert_pbe_des_to_aes", - "Successfully converted password for (%s)\n", - slapi_entry_get_dn(entries[ii])); - converted_des_passwd = 1; - } - } - slapi_ch_free_string(&passwd); - slapi_value_free(&sval); - } - } - } - slapi_free_search_results_internal(pb); - slapi_pblock_destroy(pb); - slapi_ch_free_string(&filter); - } - if (!converted_des_passwd) { - slapi_log_err(SLAPI_LOG_HOUSE, "convert_pbe_des_to_aes", - "No DES passwords found to convert.\n"); - } - } - charray_free(attrs); -} - void slapd_sockets_ports_free(daemon_ports_t *ports_info) { @@ -1088,10 +946,6 @@ slapd_daemon(daemon_ports_t *ports) #endif /* ENABLE_LDAPI */ listener_idxs = (listener_info *)slapi_ch_calloc(listeners, sizeof(*listener_idxs)); - /* - * Convert old DES encoded passwords to AES - */ - convert_pbe_des_to_aes(); /* Now we write the pid file, indicating that the server is finally and listening for connections */ write_pid_file(); diff --git a/ldap/servers/slapd/task.c b/ldap/servers/slapd/task.c index 4957f51b9..010ea6a23 100644 --- a/ldap/servers/slapd/task.c +++ b/ldap/servers/slapd/task.c @@ -55,7 +55,6 @@ static uint64_t shutting_down = 0; #define TASK_TOMBSTONE_FIXUP_BACKEND "backend" #define TASK_TOMBSTONE_FIXUP_SUFFIX "suffix" #define TASK_TOMBSTONE_FIXUP_STRIPCSN "stripcsn" -#define TASK_DES2AES "des2aes task" #define LOG_BUFFER 256 @@ -85,8 +84,6 @@ static void task_generic_destructor(Slapi_Task *task); static Slapi_Entry *get_internal_entry(Slapi_PBlock *pb, char *dn); static void modify_internal_entry(char *dn, LDAPMod **mods); static void fixup_tombstone_task_destructor(Slapi_Task *task); -static void task_des2aes_thread(void *arg); -static void des2aes_task_destructor(Slapi_Task *task); /*********************************** @@ -2592,338 +2589,6 @@ fixup_tombstone_task_destructor(Slapi_Task *task) "fixup_tombstone_task_destructor <--\n"); } -/* - * des2aes Task - * - * Convert any DES passwords to AES - * - * dn: cn=convertPasswords, cn=des2aes,cn=tasks,cn=config - * objectclass: top - * objectclass: extensibleObject - * suffix: dc=example,dc=com (If empty all backends are checked) - * suffix: dc=other,dc=suffix - */ -struct task_des2aes_data -{ - char **suffixes; - Slapi_Task *task; -}; - -static int -task_des2aes(Slapi_PBlock *pb, - Slapi_Entry *e, - Slapi_Entry *eAfter __attribute__((unused)), - int *returncode, - char *returntext, - void *arg __attribute__((unused))) -{ - struct task_des2aes_data *task_data = NULL; - PRThread *thread = NULL; - Slapi_Task *task = NULL; - char **suffix = NULL; - char **bases = NULL; - int rc = SLAPI_DSE_CALLBACK_OK; - - /* Get the suffixes */ - if ((suffix = slapi_entry_attr_get_charray(e, "suffix"))) { - int i; - for (i = 0; suffix && suffix[i]; i++) { - /* Make sure "suffix" is NUL terminated string */ - char *dn = slapi_create_dn_string("%s", suffix[i]); - - if (dn) { - if (slapi_dn_syntax_check(pb, dn, 1)) { - /* invalid suffix name */ - PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, - "Invalid DN syntax (%s) specified for \"suffix\"\n", - suffix[i]); - *returncode = LDAP_INVALID_DN_SYNTAX; - slapi_ch_free_string(&dn); - rc = SLAPI_DSE_CALLBACK_ERROR; - goto error; - } else { - slapi_ch_array_add(&bases, dn); - } - } else { - PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, - "Invalid DN (%s) specified for \"suffix\"\n", suffix[i]); - *returncode = LDAP_INVALID_DN_SYNTAX; - rc = SLAPI_DSE_CALLBACK_ERROR; - goto error; - } - } - } - - /* Build the task data and fire off a thread to perform the conversion */ - task = slapi_new_task(slapi_entry_get_ndn(e)); - - /* register our destructor for cleaning up our private data */ - slapi_task_set_destructor_fn(task, des2aes_task_destructor); - task_data = (struct task_des2aes_data *)slapi_ch_calloc(1, sizeof(struct task_des2aes_data)); - task_data->suffixes = bases; - task_data->task = task; - - /* Start the conversion thread */ - thread = PR_CreateThread(PR_USER_THREAD, task_des2aes_thread, - (void *)task_data, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, - PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); - if (thread == NULL) { - PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, - "unable to create des2aes thread!\n"); - slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, - "Unable to create des2aes thread!\n"); - *returncode = LDAP_OPERATIONS_ERROR; - slapi_task_finish(task, *returncode); - rc = SLAPI_DSE_CALLBACK_ERROR; - } - -error: - if (rc == SLAPI_DSE_CALLBACK_ERROR) { - slapi_ch_array_free(bases); - slapi_ch_free((void **)&task_data); - } - slapi_ch_array_free(suffix); - return rc; -} - -static void -task_des2aes_thread(void *arg) -{ - struct task_des2aes_data *task_data = arg; - Slapi_PBlock *pb = NULL; - Slapi_Entry **entries = NULL; - Slapi_Task *task = task_data->task; - struct slapdplugin *plugin = NULL; - char **attrs = NULL; - char **backends = NULL; - char *val = NULL; - int converted_des_passwd = 0; - int result = -1; - int have_aes = 0; - int have_des = 0; - int i = 0, ii = 0, be_idx = 0; - int rc = 0; - - /* - * Check that AES plugin is enabled, and grab all the unique - * password attributes. - */ - for (plugin = get_plugin_list(PLUGIN_LIST_REVER_PWD_STORAGE_SCHEME); - plugin != NULL; - plugin = plugin->plg_next) { - char *plugin_arg = NULL; - - if (plugin->plg_started && strcasecmp(plugin->plg_name, "AES") == 0) { - /* We have the AES plugin, and its enabled */ - have_aes = 1; - } - if (plugin->plg_started && strcasecmp(plugin->plg_name, "DES") == 0) { - /* We have the DES plugin, and its enabled */ - have_des = 1; - } - /* Gather all the unique password attributes from all the PBE plugins */ - for (i = 0, plugin_arg = plugin->plg_argv[i]; - i < plugin->plg_argc; - plugin_arg = plugin->plg_argv[++i]) { - if (charray_inlist(attrs, plugin_arg)) { - continue; - } - charray_add(&attrs, slapi_ch_strdup(plugin_arg)); - } - } - - if (have_aes && have_des) { - if (task_data->suffixes == NULL) { - /* - * Build a list of all the backend dn's - */ - Slapi_Backend *be = NULL; - char *cookie = NULL; - - slapi_log_err(SLAPI_LOG_INFO, TASK_DES2AES, - "Checking for DES passwords to convert to AES...\n"); - slapi_task_log_notice(task, - "Checking for DES passwords to convert to AES...\n"); - - be = slapi_get_first_backend(&cookie); - while (be) { - char *suffix = (char *)slapi_sdn_get_ndn(be->be_suffix); - if (charray_inlist(backends, suffix) || strlen(suffix) == 0) { - be = slapi_get_next_backend(cookie); - continue; - } - charray_add(&backends, slapi_ch_strdup(suffix)); - be = slapi_get_next_backend(cookie); - } - slapi_ch_free((void **)&cookie); - } else { - backends = task_data->suffixes; - } - - /* - * Search for the password attributes - */ - for (i = 0; attrs && attrs[i]; i++) { - char *filter = PR_smprintf("%s=*", attrs[i]); - /* - * Loop over all the backends looking for the password attribute - */ - for (be_idx = 0; backends && backends[be_idx]; be_idx++) { - pb = slapi_pblock_new(); - slapi_search_internal_set_pb(pb, backends[be_idx], - LDAP_SCOPE_SUBTREE, filter, NULL, 0, NULL, NULL, - (void *)plugin_get_default_component_id(), - SLAPI_OP_FLAG_IGNORE_UNINDEXED); - slapi_search_internal_pb(pb); - slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &result); - if (LDAP_SUCCESS != result) { - slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, - "Failed to search for password attribute (%s) error (%d), skipping suffix (%s)\n", - attrs[i], result, backends[be_idx]); - slapi_task_log_notice(task, - "Failed to search for password attribute (%s) error (%d), skipping suffix (%s)\n", - attrs[i], result, backends[be_idx]); - slapi_free_search_results_internal(pb); - slapi_pblock_destroy(pb); - pb = NULL; - continue; - } - slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); - for (ii = 0; entries && entries[ii]; ii++) { - if ((val = (char *)slapi_entry_attr_get_ref(entries[ii], attrs[i]))) { - if (strlen(val) >= 5 && strncmp(val, "{DES}", 5) == 0) { - /* - * We have a DES encoded password, convert it AES - */ - Slapi_PBlock *mod_pb = NULL; - Slapi_Value *sval = NULL; - LDAPMod mod_replace; - LDAPMod *mods[2]; - char *replace_val[2]; - char *passwd = NULL; - - /* Decode the DES password */ - if (pw_rever_decode(val, &passwd, attrs[i]) == -1) { - slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, - "Failed to decode existing DES password for (%s)\n", - slapi_entry_get_dn(entries[ii])); - slapi_task_log_notice(task, - "Failed to decode existing DES password for (%s)\n", - slapi_entry_get_dn(entries[ii])); - rc = 1; - goto done; - } - - /* Encode the password */ - sval = slapi_value_new_string(passwd); - if (pw_rever_encode(&sval, attrs[i]) == -1) { - slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, - "Failed to encode AES password for (%s)\n", - slapi_entry_get_dn(entries[ii])); - slapi_task_log_notice(task, - "failed to encode AES password for (%s)\n", - slapi_entry_get_dn(entries[ii])); - slapi_ch_free_string(&passwd); - slapi_value_free(&sval); - rc = 1; - goto done; - } - - /* Replace the attribute in the entry */ - replace_val[0] = (char *)slapi_value_get_string(sval); - replace_val[1] = NULL; - mod_replace.mod_op = LDAP_MOD_REPLACE; - mod_replace.mod_type = attrs[i]; - mod_replace.mod_values = replace_val; - mods[0] = &mod_replace; - mods[1] = 0; - - mod_pb = slapi_pblock_new(); - slapi_modify_internal_set_pb(mod_pb, slapi_entry_get_dn(entries[ii]), - mods, 0, 0, (void *)plugin_get_default_component_id(), 0); - slapi_modify_internal_pb(mod_pb); - - slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &result); - if (LDAP_SUCCESS != result) { - slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, - "Failed to convert password for (%s) error (%d)\n", - slapi_entry_get_dn(entries[ii]), result); - slapi_task_log_notice(task, - "Failed to convert password for (%s) error (%d)\n", - slapi_entry_get_dn(entries[ii]), result); - rc = 1; - } else { - slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, - "Successfully converted password for (%s)\n", - slapi_entry_get_dn(entries[ii])); - slapi_task_log_notice(task, - "Successfully converted password for (%s)\n", - slapi_entry_get_dn(entries[ii])); - converted_des_passwd = 1; - } - slapi_ch_free_string(&passwd); - slapi_value_free(&sval); - slapi_pblock_destroy(mod_pb); - } - } - } - slapi_free_search_results_internal(pb); - slapi_pblock_destroy(pb); - pb = NULL; - } - slapi_ch_free_string(&filter); - } - if (!converted_des_passwd) { - slapi_log_err(SLAPI_LOG_INFO, TASK_DES2AES, - "No DES passwords found to convert.\n"); - slapi_task_log_notice(task, "No DES passwords found to convert.\n"); - } - } else { - /* No AES/DES */ - if (!have_des) { - slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, - "DES plugin not enabled\n"); - slapi_task_log_notice(task, "DES plugin not enabled\n"); - } - if (!have_aes) { - slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, - "AES plugin not enabled\n"); - slapi_task_log_notice(task, "AES plugin not enabled\n"); - } - slapi_log_err(SLAPI_LOG_ERR, TASK_DES2AES, - "Unable to convert passwords\n"); - slapi_task_log_notice(task, "Unable to convert passwords\n"); - rc = 1; - } - -done: - charray_free(attrs); - charray_free(backends); - slapi_free_search_results_internal(pb); - slapi_pblock_destroy(pb); - slapi_task_finish(task, rc); -} - -static void -des2aes_task_destructor(Slapi_Task *task) -{ - slapi_log_err(SLAPI_LOG_TRACE, TASK_DES2AES, - "des2aes_task_destructor -->\n"); - if (task) { - struct task_des2aes_data *task_data = (struct task_des2aes_data *)slapi_task_get_data(task); - while (slapi_task_get_refcount(task) > 0) { - /* Yield to wait for the task to finish. */ - DS_Sleep(PR_MillisecondsToInterval(100)); - } - if (task_data) { - slapi_ch_array_free(task_data->suffixes); - slapi_ch_free((void **)&task_data); - } - } - slapi_log_err(SLAPI_LOG_TRACE, TASK_DES2AES, - "des2aes_task_destructor <--\n"); -} - /* cleanup old tasks that may still be in the DSE from a previous session * (this can happen if the server crashes [no matter how unlikely we like * to think that is].) @@ -3005,7 +2670,6 @@ task_init(void) slapi_task_register_handler("upgradedb", task_upgradedb_add); slapi_task_register_handler("sysconfig reload", task_sysconfig_reload_add); slapi_task_register_handler("fixup tombstones", task_fixup_tombstones_add); - slapi_task_register_handler("des2aes", task_des2aes); } /* called when the server is shutting down -- abort all existing tasks */ diff --git a/ldap/servers/slapd/upgrade.c b/ldap/servers/slapd/upgrade.c index 93f5d2f28..ecdab5f98 100644 --- a/ldap/servers/slapd/upgrade.c +++ b/ldap/servers/slapd/upgrade.c @@ -130,6 +130,15 @@ upgrade_144_remove_http_client_presence(void) { return UPGRADE_SUCCESS; } +static upgrade_status +upgrade_201_remove_des_rever_pwd_scheme(void) { + struct slapi_pblock *delete_pb = slapi_pblock_new(); + slapi_delete_internal_set_pb(delete_pb, "cn=DES,cn=Password Storage Schemes,cn=plugins,cn=config", NULL, NULL, NULL, 0); + slapi_delete_internal_pb(delete_pb); + slapi_pblock_destroy(delete_pb); + return UPGRADE_SUCCESS; +} + upgrade_status upgrade_server(void) { #ifdef RUST_ENABLE @@ -146,6 +155,10 @@ upgrade_server(void) { return UPGRADE_FAILURE; } + if (upgrade_201_remove_des_rever_pwd_scheme() != UPGRADE_SUCCESS) { + return UPGRADE_FAILURE; + } + return UPGRADE_SUCCESS; }
0
3d212a547210e03deeab8e72456cefda117c1394
389ds/389-ds-base
Ticket #508 - part 2 - lock-free access to FrontendConfig structure https://fedorahosted.org/389/ticket/508 Reviewed by: mreynolds (Thanks!) Branch: master Fix Description: When computing the idletimeout, only check the config anon_limits_dn if the connection c_dn is NULL. Platforms tested: RHEL6 x86_64 Flag Day: no Doc impact: no
commit 3d212a547210e03deeab8e72456cefda117c1394 Author: Rich Megginson <[email protected]> Date: Fri Nov 30 11:58:27 2012 -0700 Ticket #508 - part 2 - lock-free access to FrontendConfig structure https://fedorahosted.org/389/ticket/508 Reviewed by: mreynolds (Thanks!) Branch: master Fix Description: When computing the idletimeout, only check the config anon_limits_dn if the connection c_dn is NULL. Platforms tested: RHEL6 x86_64 Flag Day: no Doc impact: no diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c index e3d200967..abf7611f9 100644 --- a/ldap/servers/slapd/daemon.c +++ b/ldap/servers/slapd/daemon.c @@ -1798,27 +1798,28 @@ compute_idletimeout( slapdFrontendConfig_t *fecfg, Connection *conn ) * this is not an anonymous user and no bind-based limits are set, * use the default idle timeout. */ - char *anon_dn = config_get_anon_limits_dn(); - if ((conn->c_dn == NULL) && anon_dn && (strlen(anon_dn) > 0)) { - Slapi_DN *anon_sdn = slapi_sdn_new_dn_byref( anon_dn ); + if (conn->c_dn == NULL) { + char *anon_dn = config_get_anon_limits_dn(); + if (anon_dn && (strlen(anon_dn) > 0)) { + Slapi_DN *anon_sdn = slapi_sdn_new_dn_byref(anon_dn); - reslimit_update_from_dn( conn, anon_sdn ); + reslimit_update_from_dn(conn, anon_sdn); - if ( slapi_reslimit_get_integer_limit( conn, - idletimeout_reslimit_handle, &idletimeout ) != - SLAPI_RESLIMIT_STATUS_SUCCESS ) { - idletimeout = fecfg->idletimeout; - } + if (slapi_reslimit_get_integer_limit(conn, idletimeout_reslimit_handle, + &idletimeout) + != SLAPI_RESLIMIT_STATUS_SUCCESS) { + idletimeout = fecfg->idletimeout; + } - slapi_sdn_free( &anon_sdn ); + slapi_sdn_free(&anon_sdn); + } + slapi_ch_free_string(&anon_dn); } else if ( conn->c_isroot ) { idletimeout = 0; /* no limit for Directory Manager */ } else { idletimeout = fecfg->idletimeout; } - - slapi_ch_free_string( &anon_dn ); } return( idletimeout );
0
70f1c83416366d9e7191ebc9c5133ef186a8c671
389ds/389-ds-base
Ticket 175 - minor fixes Corrected a output problem, and refined the usage informaton about yhte CSV style reporting features
commit 70f1c83416366d9e7191ebc9c5133ef186a8c671 Author: Mark Reynolds <[email protected]> Date: Tue Feb 7 13:14:36 2012 -0500 Ticket 175 - minor fixes Corrected a output problem, and refined the usage informaton about yhte CSV style reporting features diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl index 0259cde11..c6e8708a0 100755 --- a/ldap/admin/src/logconv.pl +++ b/ldap/admin/src/logconv.pl @@ -374,7 +374,7 @@ for ($count=0; $count < $fc; $count++){ print_stats_block( $s_stats ); print_stats_block( $m_stats ); $tlc = $tlc + $ff; - if($ff > $limit){print sprintf " %10s Lines Processed\n\n",--$ff;} + if($ff => $limit){print sprintf " %10s Lines Processed\n\n",--$ff;} } print "\n\nTotal Log Lines Analysed: " . ($tlc - 1) . "\n"; @@ -1195,8 +1195,8 @@ sub displayUsage { print " E.g. [28/Mar/2002:13:14:22 -0800]\n"; print " -E <time to stop analyzing logfile>\n"; print " E.g. [28/Mar/2002:13:24:62 -0800]\n"; - print " -m <per second stats file>\n"; - print " -M <per minute stats file>\n"; + print " -m <CSV output file - per second stats>\n"; + print " -M <CSV output file - per minute stats>\n"; print " -V <enable verbose output - includes all stats listed below>\n"; print " -[efcibaltnxgju]\n\n"; @@ -1219,13 +1219,14 @@ sub displayUsage { print " Examples:\n\n"; - print " ./logconv.pl -s 10 -V access\n\n"; + print " ./logconv.pl -s 10 -V /logs/access*\n\n"; - print " ./logconv.pl -d cn=dm /export/server4/slapd-host/logs/access*\n\n"; + print " ./logconv.pl -d cn=dm /logs/access*\n\n"; - print " ./logconv.pl -s 50 -ibgju access*\n\n"; + print " ./logconv.pl -s 50 -ibgju /logs/access*\n\n"; - print " ./logconv.pl -S \"\[28/Mar/2002:13:14:22 -0800\]\" -E \"\[28/Mar/2002:13:50:05 -0800\]\" -e access\n\n"; + print " ./logconv.pl -S \"\[28/Mar/2002:13:14:22 -0800\]\" -E \"\[28/Mar/2002:13:50:05 -0800\]\" -e /logs/access*\n\n"; + print " ./logconv.pl -m log-minute-stats-csv.out /logs/access*\n\n"; exit 1; } @@ -1269,7 +1270,7 @@ if ($endTime && !$endFlag) { $ff++; $iff++; -if ($iff > $limit){ print STDERR sprintf" %10s Lines Processed\n",$ff; $iff="0";} +if ($iff >= $limit){ print STDERR sprintf" %10s Lines Processed\n",$ff; $iff="0";} # Additional performance stats ($time, $tzone) = split (' ', $_);
0
af20dce9eba1059eb42c7c45d4e36a071e358f0b
389ds/389-ds-base
Issue 5127 - ds_selinux_restorecon.sh: always exit 0 Description: We don't want to error out and give up on starting the service if the restorecon fails - it might just be that the directory doesn't exist and doesn't need restoring. Issue identified and fix suggested by Simon Farnsworth relates: https://github.com/389ds/389-ds-base/issues/5127 Reviewed by: adamw & mreynolds
commit af20dce9eba1059eb42c7c45d4e36a071e358f0b Author: Adam Williamson <[email protected]> Date: Thu Jan 27 11:07:26 2022 -0800 Issue 5127 - ds_selinux_restorecon.sh: always exit 0 Description: We don't want to error out and give up on starting the service if the restorecon fails - it might just be that the directory doesn't exist and doesn't need restoring. Issue identified and fix suggested by Simon Farnsworth relates: https://github.com/389ds/389-ds-base/issues/5127 Reviewed by: adamw & mreynolds diff --git a/wrappers/ds_selinux_restorecon.sh.in b/wrappers/ds_selinux_restorecon.sh.in index 063347de3..2d7386233 100644 --- a/wrappers/ds_selinux_restorecon.sh.in +++ b/wrappers/ds_selinux_restorecon.sh.in @@ -29,5 +29,6 @@ then exit 0 fi -# Now run restorecon -restorecon ${DS_HOME_DIR} +# Now run restorecon, but don't die if it fails (could be that the +# directory doesn't exist) +restorecon ${DS_HOME_DIR} || :
0
6b9f1aac9e0e5059e10e0ed92e6e8d9c4d5f4253
389ds/389-ds-base
remove extra format argument; use %lu for size_t printf format Removed the extra proxydn format argument that was not being used Use %lu for size_t format arguments Reviewed by: nkinder (Thanks!)
commit 6b9f1aac9e0e5059e10e0ed92e6e8d9c4d5f4253 Author: Rich Megginson <[email protected]> Date: Thu Oct 14 09:13:03 2010 -0600 remove extra format argument; use %lu for size_t printf format Removed the extra proxydn format argument that was not being used Use %lu for size_t format arguments Reviewed by: nkinder (Thanks!) diff --git a/ldap/servers/slapd/add.c b/ldap/servers/slapd/add.c index 93f4511b1..200d79ce3 100644 --- a/ldap/servers/slapd/add.c +++ b/ldap/servers/slapd/add.c @@ -497,8 +497,7 @@ static void op_shared_add (Slapi_PBlock *pb) slapi_log_access(LDAP_DEBUG_ARGS, "conn=%s op=%d ADD dn=\"%s\"\n", LOG_INTERNAL_OP_CON_ID, LOG_INTERNAL_OP_OP_ID, - escape_string(slapi_entry_get_dn_const(e), ebuf), - proxystr ? proxystr : ""); + escape_string(slapi_entry_get_dn_const(e), ebuf)); } } diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c b/ldap/servers/slapd/back-ldbm/import-threads.c index c00e4b7ce..d8153d7d9 100644 --- a/ldap/servers/slapd/back-ldbm/import-threads.c +++ b/ldap/servers/slapd/back-ldbm/import-threads.c @@ -726,8 +726,8 @@ import_producer(void *param) "ending line %d of file \"%s\"", escape_string(slapi_entry_get_dn(e), ebuf), curr_lineno, curr_filename); - import_log_notice(job, "REASON: entry too large (%u bytes) for " - "the buffer size (%u bytes)", newesize, job->fifo.bsize); + import_log_notice(job, "REASON: entry too large (%lu bytes) for " + "the buffer size (%lu bytes)", newesize, job->fifo.bsize); backentry_free(&ep); job->skipped++; continue;
0
de006310079abf5c93caed26d33455e22d7c7eb4
389ds/389-ds-base
Config schema not included in core schema https://bugzilla.redhat.com/show_bug.cgi?id=520921 Resolves: bug 520921 Bug Description: Config schema not included in core schema Reviewed by: nkinder (Thanks!) Fix Description: Just had to move a few schema from 02common and 30ns-common into 01core389.ldif. I also added 01core389.ldif to the list of schema installed when install_full_schema=0 is specified with setup-ds.pl. I also added these schema files to the list of schema files to upgrade. With these changes, the server starts up fine. The only error is this: [29/Sep/2009:16:47:53 -0600] - Entry "cn=PAM Pass Through Auth,cn=plugins,cn=config" has unknown object class "pamConfig" This is because the pam pass through plugin is included in the default config. I'd rather not move that schema file. That plugin can be removed from the default config during setup by specifying a slapd.ConfigFile directive with contents like this: dn: cn=PAM Pass Through Auth,cn=plugins,cn=config changetype: delete Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
commit de006310079abf5c93caed26d33455e22d7c7eb4 Author: Rich Megginson <[email protected]> Date: Tue Sep 29 16:55:32 2009 -0600 Config schema not included in core schema https://bugzilla.redhat.com/show_bug.cgi?id=520921 Resolves: bug 520921 Bug Description: Config schema not included in core schema Reviewed by: nkinder (Thanks!) Fix Description: Just had to move a few schema from 02common and 30ns-common into 01core389.ldif. I also added 01core389.ldif to the list of schema installed when install_full_schema=0 is specified with setup-ds.pl. I also added these schema files to the list of schema files to upgrade. With these changes, the server starts up fine. The only error is this: [29/Sep/2009:16:47:53 -0600] - Entry "cn=PAM Pass Through Auth,cn=plugins,cn=config" has unknown object class "pamConfig" This is because the pam pass through plugin is included in the default config. I'd rather not move that schema file. That plugin can be removed from the default config during setup by specifying a slapd.ConfigFile directive with contents like this: dn: cn=PAM Pass Through Auth,cn=plugins,cn=config changetype: delete Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no diff --git a/ldap/admin/src/scripts/60upgradeschemafiles.pl b/ldap/admin/src/scripts/60upgradeschemafiles.pl index b0f57580d..c1b1bb7c8 100644 --- a/ldap/admin/src/scripts/60upgradeschemafiles.pl +++ b/ldap/admin/src/scripts/60upgradeschemafiles.pl @@ -10,7 +10,7 @@ sub runinst { # these schema files are obsolete, or we want to replace # them with newer versions - my @toremove = qw(00core.ldif 01common.ldif 05rfc2247.ldif 10presence.ldif 28pilot.ldif 50ns-directory.ldif 60mozilla.ldif); + my @toremove = qw(00core.ldif 01core389.ldif 01common.ldif 02common.ldif 05rfc2247.ldif 10presence.ldif 28pilot.ldif 30ns-common.ldif 50ns-directory.ldif 60mozilla.ldif); # make a backup directory to store the deleted schema, then # don't really delete it, just move it to that directory diff --git a/ldap/admin/src/scripts/DSCreate.pm.in b/ldap/admin/src/scripts/DSCreate.pm.in index f351a21b1..96930dfda 100644 --- a/ldap/admin/src/scripts/DSCreate.pm.in +++ b/ldap/admin/src/scripts/DSCreate.pm.in @@ -493,7 +493,8 @@ sub installSchema { $inf->{slapd}->{install_full_schema}) { push @schemafiles, glob("$inf->{General}->{prefix}@schemadir@/*"); } else { - push @schemafiles, "$inf->{General}->{prefix}@schemadir@/00core.ldif"; + push @schemafiles, "$inf->{General}->{prefix}@schemadir@/00core.ldif", + "$inf->{General}->{prefix}@schemadir@/01core389.ldif"; } # additional schema files diff --git a/ldap/schema/01core389.ldif b/ldap/schema/01core389.ldif index 5046e5d0d..af445e7c7 100644 --- a/ldap/schema/01core389.ldif +++ b/ldap/schema/01core389.ldif @@ -106,6 +106,22 @@ attributeTypes: ( 2.16.840.1.113730.3.1.809 NAME 'nsds5replicaLastInitStatus' DE attributeTypes: ( 2.16.840.1.113730.3.1.1097 NAME 'nsds5replicaBusyWaitTime' DESC 'Netscape defined attribute type' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' ) attributeTypes: ( 2.16.840.1.113730.3.1.1098 NAME 'nsds5replicaSessionPauseTime' DESC 'Netscape defined attribute type' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' ) attributeTypes: ( 2.16.840.1.113730.3.1.9999999 NAME 'nsds5debugreplicatimeout' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' ) +attributeTypes: ( 2.16.840.1.113730.3.1.2064 NAME 'nsSaslMapRegexString' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' ) +attributeTypes: ( 2.16.840.1.113730.3.1.2065 NAME 'nsSaslMapBaseDNTemplate' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' ) +attributeTypes: ( 2.16.840.1.113730.3.1.2066 NAME 'nsSaslMapFilterTemplate' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' ) +attributeTypes: ( nsCertfile-oid NAME 'nsCertfile' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) +attributeTypes: ( nsKeyfile-oid NAME 'nsKeyfile' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) +attributeTypes: ( nsSSL2-oid NAME 'nsSSL2' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) +attributeTypes: ( nsSSL3-oid NAME 'nsSSL3' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) +attributeTypes: ( nsSSLClientAuth-oid NAME 'nsSSLClientAuth' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) +attributeTypes: ( nsSSLSessionTimeout-oid NAME 'nsSSLSessionTimeout' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) +attributeTypes: ( nsSSL3SessionTimeout-oid NAME 'nsSSL3SessionTimeout' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) +attributeTypes: ( nsSSL2Ciphers-oid NAME 'nsSSL2Ciphers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) +attributeTypes: ( nsSSL3Ciphers-oid NAME 'nsSSL3Ciphers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) +attributeTypes: ( nsSSLSupportedCiphers-oid NAME 'nsSSLSupportedCiphers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) +attributeTypes: ( nsSSLToken-oid NAME 'nsSSLToken' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) +attributeTypes: ( nsSSLPersonalitySSL-oid NAME 'nsSSLPersonalitySSL' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) +attributeTypes: ( nsSSLActivation-oid NAME 'nsSSLActivation' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) # # objectclasses # @@ -118,3 +134,8 @@ objectClasses: ( 2.16.840.1.113730.3.2.104 NAME 'nsContainer' DESC 'Netscape def objectClasses: ( 2.16.840.1.113730.3.2.108 NAME 'nsDS5Replica' DESC 'Netscape defined objectclass' SUP top MUST ( nsDS5ReplicaRoot $ nsDS5ReplicaId ) MAY (cn $ nsDS5ReplicaType $ nsDS5ReplicaBindDN $ nsState $ nsDS5ReplicaName $ nsDS5Flags $ nsDS5Task $ nsDS5ReplicaReferral $ nsDS5ReplicaAutoReferral $ nsds5ReplicaPurgeDelay $ nsds5ReplicaTombstonePurgeInterval $ nsds5ReplicaChangeCount $ nsds5ReplicaLegacyConsumer) X-ORIGIN 'Netscape Directory Server' ) objectClasses: ( 2.16.840.1.113730.3.2.113 NAME 'nsTombstone' DESC 'Netscape defined objectclass' SUP top MAY ( nsParentUniqueId $ nscpEntryDN ) X-ORIGIN 'Netscape Directory Server' ) objectClasses: ( 2.16.840.1.113730.3.2.103 NAME 'nsDS5ReplicationAgreement' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsDS5ReplicaHost $ nsDS5ReplicaPort $ nsDS5ReplicaTransportInfo $ nsDS5ReplicaBindDN $ nsDS5ReplicaCredentials $ nsDS5ReplicaBindMethod $ nsDS5ReplicaRoot $ nsDS5ReplicatedAttributeList $ nsDS5ReplicaUpdateSchedule $ nsds5BeginReplicaRefresh $ description $ nsds50ruv $ nsruvReplicaLastModified $ nsds5ReplicaTimeout $ nsds5replicaChangesSentSinceStartup $ nsds5replicaLastUpdateEnd $ nsds5replicaLastUpdateStart $ nsds5replicaLastUpdateStatus $ nsds5replicaUpdateInProgress $ nsds5replicaLastInitEnd $ nsds5replicaLastInitStart $ nsds5replicaLastInitStatus $ nsds5debugreplicatimeout $ nsds5replicaBusyWaitTime $ nsds5replicaSessionPauseTime ) X-ORIGIN 'Netscape Directory Server' ) +objectClasses: ( 2.16.840.1.113730.3.2.39 NAME 'nsslapdConfig' DESC 'Netscape defined objectclass' SUP top MAY ( cn ) X-ORIGIN 'Netscape Directory Server' ) +objectClasses: ( 2.16.840.1.113730.3.2.317 NAME 'nsSaslMapping' DESC 'Netscape defined objectclass' SUP top MUST ( cn $ nsSaslMapRegexString $ nsSaslMapBaseDNTemplate $ nsSaslMapFilterTemplate ) X-ORIGIN 'Netscape Directory Server' ) +objectClasses: ( 2.16.840.1.113730.3.2.43 NAME 'nsSNMP' DESC 'Netscape defined objectclass' SUP top MUST ( cn $ nsSNMPEnabled ) MAY ( nsSNMPOrganization $ nsSNMPLocation $ nsSNMPContact $ nsSNMPDescription $ nsSNMPName $ nsSNMPMasterHost $ nsSNMPMasterPort ) X-ORIGIN 'Netscape Directory Server' ) +objectClasses: ( nsEncryptionConfig-oid NAME 'nsEncryptionConfig' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsCertfile $ nsKeyfile $ nsSSL2 $ nsSSL3 $ nsSSLSessionTimeout $ nsSSL3SessionTimeout $ nsSSLClientAuth $ nsSSL2Ciphers $ nsSSL3Ciphers $ nsSSLSupportedCiphers) X-ORIGIN 'Netscape' ) +objectClasses: ( nsEncryptionModule-oid NAME 'nsEncryptionModule' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsSSLToken $ nsSSLPersonalityssl $ nsSSLActivation ) X-ORIGIN 'Netscape' ) diff --git a/ldap/schema/02common.ldif b/ldap/schema/02common.ldif index cf851e136..7ea5594d6 100644 --- a/ldap/schema/02common.ldif +++ b/ldap/schema/02common.ldif @@ -144,9 +144,6 @@ attributeTypes: ( 1.3.6.1.1.4 NAME 'vendorName' EQUALITY 1.3.6.1.4.1.1466.109.11 attributeTypes: ( 1.3.6.1.1.5 NAME 'vendorVersion' EQUALITY 1.3.6.1.4.1.1466.109.114.1 SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation X-ORIGIN 'RFC 3045' ) attributeTypes: ( 2.16.840.1.113730.3.1.3023 NAME 'nsViewFilter' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Directory Server' ) attributeTypes: ( 2.16.840.1.113730.3.1.2063 NAME 'nsEncryptionAlgorithm' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' ) -attributeTypes: ( 2.16.840.1.113730.3.1.2064 NAME 'nsSaslMapRegexString' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' ) -attributeTypes: ( 2.16.840.1.113730.3.1.2065 NAME 'nsSaslMapBaseDNTemplate' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' ) -attributeTypes: ( 2.16.840.1.113730.3.1.2066 NAME 'nsSaslMapFilterTemplate' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' ) # # objectclasses: # @@ -163,9 +160,7 @@ objectClasses: ( 2.16.840.1.113730.3.2.13 NAME 'passwordPolicy' DESC 'Netscape d objectClasses: ( 2.16.840.1.113730.3.2.30 NAME 'glue' DESC 'Netscape defined objectclass' SUP top X-ORIGIN 'Netscape Directory Server' ) objectClasses: ( 2.16.840.1.113730.3.2.32 NAME 'netscapeMachineData' DESC 'Netscape defined objectclass' SUP top X-ORIGIN 'Netscape Directory Server' ) objectClasses: ( 2.16.840.1.113730.3.2.38 NAME 'vlvSearch' DESC 'Netscape defined objectclass' SUP top MUST ( cn $ vlvBase $ vlvScope $ vlvFilter ) MAY ( multiLineDescription ) X-ORIGIN 'Netscape Directory Server' ) -objectClasses: ( 2.16.840.1.113730.3.2.39 NAME 'nsslapdConfig' DESC 'Netscape defined objectclass' SUP top MAY ( cn ) X-ORIGIN 'Netscape Directory Server' ) objectClasses: ( 2.16.840.1.113730.3.2.42 NAME 'vlvIndex' DESC 'Netscape defined objectclass' SUP top MUST ( cn $ vlvSort ) MAY ( vlvEnabled $ vlvUses ) X-ORIGIN 'Netscape Directory Server' ) -objectClasses: ( 2.16.840.1.113730.3.2.43 NAME 'nsSNMP' DESC 'Netscape defined objectclass' SUP top MUST ( cn $ nsSNMPEnabled ) MAY ( nsSNMPOrganization $ nsSNMPLocation $ nsSNMPContact $ nsSNMPDescription $ nsSNMPName $ nsSNMPMasterHost $ nsSNMPMasterPort ) X-ORIGIN 'Netscape Directory Server' ) objectClasses: ( 2.16.840.1.113730.3.2.84 NAME 'cosDefinition' DESC 'Netscape defined objectclass' SUP top MAY ( costargettree $ costemplatedn $ cosspecifier $ cosattribute $ aci $ cn $ uid ) X-ORIGIN 'Netscape Directory Server' ) objectClasses: ( 2.16.840.1.113730.3.2.93 NAME 'nsRoleDefinition' DESC 'Netscape defined objectclass' SUP ldapSubEntry MAY ( description ) X-ORIGIN 'Netscape Directory Server' ) objectClasses: ( 2.16.840.1.113730.3.2.94 NAME 'nsSimpleRoleDefinition' DESC 'Netscape defined objectclass' SUP nsRoleDefinition X-ORIGIN 'Netscape Directory Server' ) @@ -181,5 +176,4 @@ objectClasses: ( 2.16.840.1.113730.3.2.503 NAME 'nsDSWindowsReplicationAgreement objectClasses: ( 2.16.840.1.113730.3.2.128 NAME 'costemplate' DESC 'Netscape defined objectclass' SUP top MAY ( cn $ cospriority ) X-ORIGIN 'Netscape Directory Server' ) objectClasses: ( 2.16.840.1.113730.3.2.304 NAME 'nsView' DESC 'Netscape defined objectclass' SUP top AUXILIARY MAY ( nsViewFilter $ description ) X-ORIGIN 'Netscape Directory Server' ) objectClasses: ( 2.16.840.1.113730.3.2.316 NAME 'nsAttributeEncryption' DESC 'Netscape defined objectclass' SUP top MUST ( cn $ nsEncryptionAlgorithm ) X-ORIGIN 'Netscape Directory Server' ) -objectClasses: ( 2.16.840.1.113730.3.2.317 NAME 'nsSaslMapping' DESC 'Netscape defined objectclass' SUP top MUST ( cn $ nsSaslMapRegexString $ nsSaslMapBaseDNTemplate $ nsSaslMapFilterTemplate ) X-ORIGIN 'Netscape Directory Server' ) attributeTypes: ( 2.16.840.1.113730.3.1.2085 NAME 'isReplicated' DESC 'Changelog attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 X-ORIGIN 'Netscape Directory Server' ) diff --git a/ldap/schema/30ns-common.ldif b/ldap/schema/30ns-common.ldif index ea48c660c..a6b109d86 100644 --- a/ldap/schema/30ns-common.ldif +++ b/ldap/schema/30ns-common.ldif @@ -76,19 +76,6 @@ attributeTypes: ( nsPidLog-oid NAME 'nsPidLog' DESC 'Netscape defined attribute attributeTypes: ( nsAccessLog-oid NAME 'nsAccessLog' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) attributeTypes: ( nsDefaultAcceptLanguage-oid NAME 'nsDefaultAcceptLanguage' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) attributeTypes: ( nsServerSecurity-oid NAME 'nsServerSecurity' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) -attributeTypes: ( nsCertfile-oid NAME 'nsCertfile' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) -attributeTypes: ( nsKeyfile-oid NAME 'nsKeyfile' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) -attributeTypes: ( nsSSL2-oid NAME 'nsSSL2' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) -attributeTypes: ( nsSSL3-oid NAME 'nsSSL3' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) -attributeTypes: ( nsSSLClientAuth-oid NAME 'nsSSLClientAuth' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) -attributeTypes: ( nsSSLSessionTimeout-oid NAME 'nsSSLSessionTimeout' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) -attributeTypes: ( nsSSL3SessionTimeout-oid NAME 'nsSSL3SessionTimeout' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) -attributeTypes: ( nsSSL2Ciphers-oid NAME 'nsSSL2Ciphers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) -attributeTypes: ( nsSSL3Ciphers-oid NAME 'nsSSL3Ciphers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) -attributeTypes: ( nsSSLSupportedCiphers-oid NAME 'nsSSLSupportedCiphers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) -attributeTypes: ( nsSSLToken-oid NAME 'nsSSLToken' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) -attributeTypes: ( nsSSLPersonalitySSL-oid NAME 'nsSSLPersonalitySSL' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) -attributeTypes: ( nsSSLActivation-oid NAME 'nsSSLActivation' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) attributeTypes: ( nsTaskLabel-oid NAME 'nsTaskLabel' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) attributeTypes: ( nsHelpRef-oid NAME 'nsHelpRef' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) attributeTypes: ( nsExecRef-oid NAME 'nsExecRef' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' ) @@ -99,8 +86,6 @@ objectClasses: ( nsAdminDomain-oid NAME 'nsAdminDomain' DESC 'Netscape defined o objectClasses: ( nsHost-oid NAME 'nsHost' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( serverHostName $ description $ l $ nsHostLocation $ nsHardwarePlatform $ nsOsVersion ) X-ORIGIN 'Netscape' ) objectClasses: ( nsAdminGroup-oid NAME 'nsAdminGroup' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsAdminGroupName $ description $ nsConfigRoot $ nsAdminSIEDN ) X-ORIGIN 'Netscape' ) objectClasses: ( nsApplication-oid NAME 'nsApplication' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsVendor $ description $ nsProductName $ nsNickName $ nsProductVersion $ nsBuildNumber $ nsRevisionNumber $ nsSerialNumber $ nsInstalledLocation $ installationTimeStamp $ nsExpirationDate $ nsBuildSecurity $ nsLdapSchemaVersion $ nsServerMigrationClassname $ nsServerCreationClassname ) X-ORIGIN 'Netscape' ) -objectClasses: ( nsEncryptionConfig-oid NAME 'nsEncryptionConfig' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsCertfile $ nsKeyfile $ nsSSL2 $ nsSSL3 $ nsSSLSessionTimeout $ nsSSL3SessionTimeout $ nsSSLClientAuth $ nsSSL2Ciphers $ nsSSL3Ciphers $ nsSSLSupportedCiphers) X-ORIGIN 'Netscape' ) -objectClasses: ( nsEncryptionModule-oid NAME 'nsEncryptionModule' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsSSLToken $ nsSSLPersonalityssl $ nsSSLActivation ) X-ORIGIN 'Netscape' ) objectClasses: ( nsResourceRef-oid NAME 'nsResourceRef' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( seeAlso ) X-ORIGIN 'Netscape' ) objectClasses: ( nsTask-oid NAME 'nsTask' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsTaskLabel $ nsHelpref $ nsExecref $ nsLogSuppress ) X-ORIGIN 'Netscape' ) objectClasses: ( nsTaskGroup-oid NAME 'nsTaskGroup' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsTaskLabel ) X-ORIGIN 'Netscape' )
0
ad3e77d71d3954c7cd12530e95f01a9c78b1148b
389ds/389-ds-base
Issue 4759 - Fix coverity issue (#4760) Bug description: with #4218 (wtime, optime in access log), hrtime is set in the operation. But it is done before checking if the operation is set. covscan fails Fix description: move the setting after verification that operation != NULL relates: https://github.com/389ds/389-ds-base/issues/4759 Reviewed by: Simon Pichugin Platforms tested: F34
commit ad3e77d71d3954c7cd12530e95f01a9c78b1148b Author: tbordaz <[email protected]> Date: Thu May 6 18:50:06 2021 +0200 Issue 4759 - Fix coverity issue (#4760) Bug description: with #4218 (wtime, optime in access log), hrtime is set in the operation. But it is done before checking if the operation is set. covscan fails Fix description: move the setting after verification that operation != NULL relates: https://github.com/389ds/389-ds-base/issues/4759 Reviewed by: Simon Pichugin Platforms tested: F34 diff --git a/ldap/servers/slapd/extendop.c b/ldap/servers/slapd/extendop.c index 2c2f9c7f8..fc713573e 100644 --- a/ldap/servers/slapd/extendop.c +++ b/ldap/servers/slapd/extendop.c @@ -279,9 +279,6 @@ do_extended(Slapi_PBlock *pb) slapi_pblock_get(pb, SLAPI_OPERATION, &pb_op); slapi_pblock_get(pb, SLAPI_CONNECTION, &pb_conn); - /* Set the time we actually started the operation */ - slapi_operation_set_time_started(pb_op); - if (pb_conn == NULL || pb_op == NULL) { send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, "param error", 0, NULL); slapi_log_err(SLAPI_LOG_ERR, "do_extended", @@ -289,6 +286,9 @@ do_extended(Slapi_PBlock *pb) goto free_and_return; } + /* Set the time we actually started the operation */ + slapi_operation_set_time_started(pb_op); + /* * Parse the extended request. It looks like this: * diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c index 223bc2eea..29e8731b1 100644 --- a/ldap/servers/slapd/opshared.c +++ b/ldap/servers/slapd/opshared.c @@ -284,9 +284,6 @@ op_shared_search(Slapi_PBlock *pb, int send_result) slapi_pblock_get(pb, SLAPI_SEARCH_TARGET_SDN, &sdn); slapi_pblock_get(pb, SLAPI_OPERATION, &operation); - /* Set the time we actually started the operation */ - slapi_operation_set_time_started(operation); - if (NULL == sdn) { sdn = slapi_sdn_new_dn_byval(base); slapi_pblock_set(pb, SLAPI_SEARCH_TARGET_SDN, sdn); @@ -317,6 +314,9 @@ op_shared_search(Slapi_PBlock *pb, int send_result) rc = -1; goto free_and_return_nolock; } + + /* Set the time we actually started the operation */ + slapi_operation_set_time_started(operation); internal_op = operation_is_flag_set(operation, OP_FLAG_INTERNAL); flag_psearch = operation_is_flag_set(operation, OP_FLAG_PS);
0
9737076aa97622ac5f25d59e86b350050e700f60
389ds/389-ds-base
Ticket #47378 - fix recent compiler warnings Description: This patch removes unused function compare_entries in back-ldbm/sort.c. https://fedorahosted.org/389/ticket/47378
commit 9737076aa97622ac5f25d59e86b350050e700f60 Author: Noriko Hosoi <[email protected]> Date: Mon Jul 29 09:34:50 2013 -0700 Ticket #47378 - fix recent compiler warnings Description: This patch removes unused function compare_entries in back-ldbm/sort.c. https://fedorahosted.org/389/ticket/47378 diff --git a/ldap/servers/slapd/back-ldbm/sort.c b/ldap/servers/slapd/back-ldbm/sort.c index 8fb4be97c..416414718 100644 --- a/ldap/servers/slapd/back-ldbm/sort.c +++ b/ldap/servers/slapd/back-ldbm/sort.c @@ -469,141 +469,6 @@ int sort_attr_compare(struct berval ** value_a, struct berval ** value_b, value_ } - -#if 0 -/* USE THE _SV VERSION NOW */ - -/* Comparison routine, called by qsort. - * The job here is to return the correct value - * for the operation a < b - * Returns: - * <0 when a < b - * 0 when a == b - * >0 when a > b - */ -static int compare_entries(ID *id_a, ID *id_b, sort_spec *s,baggage_carrier *bc, int *error) -{ - /* We get passed the IDs, but need to fetch the entries in order to - * perform the comparison . - */ - struct backentry *a = NULL; - struct backentry *b = NULL; - int result = 0; - sort_spec_thing *this_one = NULL; - int return_value = -1; - backend *be = bc->be; - ldbm_instance *inst = (ldbm_instance *) be->be_instance_info; - int err; - - *error = 1; - a = id2entry(be,*id_a,NULL,&err); - if (NULL == a) { - if (0 != err ) { - LDAPDebug(LDAP_DEBUG_ANY,"compare_entries db err %d\n",err,0,0); - } - /* Were up a creek without paddle here */ - /* Best to log error and set some flag */ - return 0; - } - b = id2entry(be,*id_b,NULL,&err); - if (NULL == b) { - if (0 != err ) { - LDAPDebug(LDAP_DEBUG_ANY,"compare_entries db err %d\n",err,0,0); - } - return 0; - } - /* OK, now we have the entries, so we work our way down the attribute list comparing as we go */ - for (this_one = (sort_spec_thing*)s; this_one ; this_one = this_one->next) { - - char *type = this_one->type; - int order = this_one->order; - Slapi_Attr *attr_a = NULL; - Slapi_Attr *attr_b = NULL; - struct berval **value_a = NULL; - struct berval **value_b = NULL; - - /* Get the two attribute values from the entries */ - return_value = slapi_entry_attr_find(a->ep_entry,type,&attr_a); - return_value = slapi_entry_attr_find(b->ep_entry,type,&attr_b); - /* What do we do if one or more of the entries lacks this attribute ? */ - /* if one lacks the attribute */ - if (NULL == attr_a) { - /* then if the other does too, they're equal */ - if (NULL == attr_b) { - result = 0; - continue; - } else - { - /* If one has the attribute, and the other - * doesn't, the missing attribute is the - * LARGER one. (bug #108154) -robey - */ - result = 1; - break; - } - } - if (NULL == attr_b) { - result = -1; - break; - } - /* Somewhere in here, we need to go sideways for match rule case - * we need to call the match rule plugin to get the attribute values - * converted into ordering keys. Then we proceed as usual to use those, - * but ensuring that we don't leak memory anywhere. This works as follows: - * the code assumes that the attrs are references into the entry, so - * doesn't try to free them. We need to note at the right place that - * we're on the matchrule path, and accordingly free the keys---this turns out - * to be when we free the indexer */ - if (NULL == s->matchrule) { - /* Non-match rule case */ - /* xxxPINAKI - needs modification - - value_a = attr_a->a_vals; - value_b = attr_b->a_vals; - */ - } else { - /* Match rule case */ - struct berval **actual_value_b = NULL; - struct berval **temp_value = NULL; - - /* xxxPINAKI - needs modification - struct berval **actual_value_a = NULL; - - actual_value_a = attr_a->a_vals; - actual_value_b = attr_b->a_vals; - matchrule_values_to_keys(s->mr_pb,actual_value_a,&temp_value); - */ - /* Now copy it, so the second call doesn't crap on it */ - value_a = slapi_ch_bvecdup(temp_value); /* Really, we'd prefer to not call the chXXX variant...*/ - matchrule_values_to_keys(s->mr_pb,actual_value_b,&value_b); - } - /* Compare them */ - if (!order) { - result = sort_attr_compare(value_a, value_b, s->compare_fn); - } else { - /* If reverse, invert the sense of the comparison */ - result = sort_attr_compare(value_b, value_a, s->compare_fn); - } - /* Time to free up the attribute allocated above */ - if (NULL != s->matchrule) { - ber_bvecfree(value_a); - } - /* Are they equal ? */ - if (0 != result) { - /* If not, we're done */ - break; - } - /* If so, proceed to the next attribute for comparison */ - } - CACHE_RETURN(&inst->inst_cache,&a); - CACHE_RETURN(&inst->inst_cache,&b); - *error = 0; - return result; -} -#endif - /* Comparison routine, called by qsort. * The job here is to return the correct value * for the operation a < b @@ -631,7 +496,7 @@ static int compare_entries_sv(ID *id_a, ID *id_b, sort_spec *s,baggage_carrier * a = id2entry(be,*id_a,&txn,&err); if (NULL == a) { if (0 != err ) { - LDAPDebug(LDAP_DEBUG_TRACE,"compare_entries db err %d\n",err,0,0); + LDAPDebug(LDAP_DEBUG_TRACE,"compare_entries_sv db err %d\n",err,0,0); } /* Were up a creek without paddle here */ /* Best to log error and set some flag */ @@ -640,7 +505,7 @@ static int compare_entries_sv(ID *id_a, ID *id_b, sort_spec *s,baggage_carrier * b = id2entry(be,*id_b,&txn,&err); if (NULL == b) { if (0 != err ) { - LDAPDebug(LDAP_DEBUG_TRACE,"compare_entries db err %d\n",err,0,0); + LDAPDebug(LDAP_DEBUG_TRACE,"compare_entries_sv db err %d\n",err,0,0); } CACHE_RETURN(&inst->inst_cache,&a); return 0;
0
ab6438901fd1481ceceb40d6dff8935ac656dc04
389ds/389-ds-base
Ticket 47753 - Add switch to disable pre-hashed password checking By default, 389 DS doesn't allow pre-hashed passwords to be set by anyone other than Directory Manager. This privilege can be delegated to other users by adding them to the Password Administrators group. This works fine for most cases, but there are cases where one might want to allow anyone to set pre-hashed passwords. An example is the FreeIPA project, who has their own SLAPI plug-in that controls pre-hashed password checking. We should add a switch to completely disable pre-hashed password checking to support this case. https://fedorahosted.org/389/ticket/47753 Reviewed by [email protected]
commit ab6438901fd1481ceceb40d6dff8935ac656dc04 Author: Nathan Kinder <[email protected]> Date: Mon Mar 17 17:35:24 2014 -0700 Ticket 47753 - Add switch to disable pre-hashed password checking By default, 389 DS doesn't allow pre-hashed passwords to be set by anyone other than Directory Manager. This privilege can be delegated to other users by adding them to the Password Administrators group. This works fine for most cases, but there are cases where one might want to allow anyone to set pre-hashed passwords. An example is the FreeIPA project, who has their own SLAPI plug-in that controls pre-hashed password checking. We should add a switch to completely disable pre-hashed password checking to support this case. https://fedorahosted.org/389/ticket/47753 Reviewed by [email protected] diff --git a/ldap/ldif/template-dse.ldif.in b/ldap/ldif/template-dse.ldif.in index 8f0077233..85662a3ca 100644 --- a/ldap/ldif/template-dse.ldif.in +++ b/ldap/ldif/template-dse.ldif.in @@ -59,6 +59,7 @@ nsslapd-max-filter-nest-level: 40 nsslapd-ndn-cache-enabled: on nsslapd-sasl-mapping-fallback: off nsslapd-dynamic-plugins: off +nsslapd-allow-hashed-passwords: off dn: cn=features,cn=config objectclass: top diff --git a/ldap/schema/01core389.ldif b/ldap/schema/01core389.ldif index 6a2d28c7d..619927723 100644 --- a/ldap/schema/01core389.ldif +++ b/ldap/schema/01core389.ldif @@ -298,6 +298,7 @@ attributeTypes: ( 2.16.840.1.113730.3.1.2303 NAME 'nsslapd-ignore-time-skew' DES attributeTypes: ( 2.16.840.1.113730.3.1.2304 NAME 'nsslapd-dynamic-plugins' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' ) attributeTypes: ( 2.16.840.1.113730.3.1.2305 NAME 'nsslapd-moddn-aci' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' ) attributeTypes: ( 2.16.840.1.113730.3.1.2306 NAME 'nsslapd-return-default-opattr' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' ) +attributeTypes: ( 2.16.840.1.113730.3.1.2307 NAME 'nsslapd-allow-hashed-passwords' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' ) # # objectclasses # diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c index fbe10ff46..e890aed36 100644 --- a/ldap/servers/slapd/libglobs.c +++ b/ldap/servers/slapd/libglobs.c @@ -228,6 +228,7 @@ slapi_onoff_t init_pw_is_legacy; slapi_onoff_t init_pw_track_update_time; slapi_onoff_t init_pw_change; slapi_onoff_t init_pw_exp; +slapi_onoff_t init_allow_hashed_pw; slapi_onoff_t init_pw_syntax; slapi_onoff_t init_schemacheck; slapi_onoff_t init_schemamod; @@ -744,6 +745,10 @@ static struct config_get_and_set { log_set_expirationtimeunit, SLAPD_AUDIT_LOG, (void**)&global_slapdFrontendConfig.auditlog_exptimeunit, CONFIG_STRING_OR_UNKNOWN, NULL, INIT_AUDITLOG_EXPTIMEUNIT}, + {CONFIG_ALLOW_HASHED_PW_ATTRIBUTE, config_set_allow_hashed_pw, + NULL, 0, + (void**)&global_slapdFrontendConfig.allow_hashed_pw, + CONFIG_ON_OFF, NULL, &init_allow_hashed_pw}, {CONFIG_PW_SYNTAX_ATTRIBUTE, config_set_pw_syntax, NULL, 0, (void**)&global_slapdFrontendConfig.pw_policy.pw_syntax, @@ -1458,6 +1463,7 @@ FrontendConfig_init () { init_pwpolicy_local = cfg->pwpolicy_local = LDAP_OFF; init_pw_change = cfg->pw_policy.pw_change = LDAP_ON; init_pw_must_change = cfg->pw_policy.pw_must_change = LDAP_OFF; + init_allow_hashed_pw = cfg->allow_hashed_pw = LDAP_OFF; init_pw_syntax = cfg->pw_policy.pw_syntax = LDAP_OFF; init_pw_exp = cfg->pw_policy.pw_exp = LDAP_OFF; cfg->pw_policy.pw_minlength = 8; @@ -2526,6 +2532,20 @@ config_set_pwpolicy_local( const char *attrname, char *value, char *errorbuf, in return retVal; } +int +config_set_allow_hashed_pw( const char *attrname, char *value, char *errorbuf, int apply ) { + int retVal = LDAP_SUCCESS; + slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); + + retVal = config_set_onoff ( attrname, + value, + &(slapdFrontendConfig->allow_hashed_pw), + errorbuf, + apply); + + return retVal; +} + int config_set_pw_syntax( const char *attrname, char *value, char *errorbuf, int apply ) { int retVal = LDAP_SUCCESS; @@ -4820,6 +4840,18 @@ config_get_pw_must_change() { return retVal; } +int +config_get_allow_hashed_pw() +{ + slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); + int retVal; + + CFG_ONOFF_LOCK_READ(slapdFrontendConfig); + retVal = (int)slapdFrontendConfig->allow_hashed_pw; + CFG_ONOFF_UNLOCK_READ(slapdFrontendConfig); + + return retVal; +} int config_get_pw_syntax() { diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h index 34c4ac60a..c987b4a21 100644 --- a/ldap/servers/slapd/proto-slap.h +++ b/ldap/servers/slapd/proto-slap.h @@ -323,6 +323,7 @@ int config_set_errorlog(const char *attrname, char *value, char *errorbuf, int a int config_set_pw_change(const char *attrname, char *value, char *errorbuf, int apply ); int config_set_pw_must_change(const char *attrname, char *value, char *errorbuf, int apply ); int config_set_pwpolicy_local(const char *attrname, char *value, char *errorbuf, int apply ); +int config_set_allow_hashed_pw( const char *attrname, char *value, char *errorbuf, int apply ); int config_set_pw_syntax(const char *attrname, char *value, char *errorbuf, int apply ); int config_set_pw_minlength(const char *attrname, char *value, char *errorbuf, int apply ); int config_set_pw_mindigits(const char *attrname, char *value, char *errorbuf, int apply ); @@ -447,6 +448,7 @@ char *config_get_pw_storagescheme(); int config_get_pw_change(); int config_get_pw_history(); int config_get_pw_must_change(); +int config_get_allow_hashed_pw(); int config_get_pw_syntax(); int config_get_pw_minlength(); int config_get_pw_mindigits(); diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c index b4a3295d3..a4d2dc6be 100644 --- a/ldap/servers/slapd/pw.c +++ b/ldap/servers/slapd/pw.c @@ -820,8 +820,9 @@ check_pw_syntax_ext ( Slapi_PBlock *pb, const Slapi_DN *sdn, Slapi_Value **vals, */ for ( i = 0; vals[ i ] != NULL; ++i ){ if (slapi_is_encoded((char *)slapi_value_get_string(vals[i]))) { - if ((!is_replication && ((internal_op && pb->pb_conn && !slapi_dn_isroot(pb->pb_conn->c_dn)) || - (!internal_op && !pw_is_pwp_admin(pb, pwpolicy))))) { + if (!is_replication && !config_get_allow_hashed_pw() && + ((internal_op && pb->pb_conn && !slapi_dn_isroot(pb->pb_conn->c_dn)) || + (!internal_op && !pw_is_pwp_admin(pb, pwpolicy)))) { PR_snprintf( errormsg, BUFSIZ, "invalid password syntax - passwords with storage scheme are not allowed"); if ( pwresponse_req == 1 ) { diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h index bbc1dc593..d234c1324 100644 --- a/ldap/servers/slapd/slap.h +++ b/ldap/servers/slapd/slap.h @@ -2066,6 +2066,7 @@ typedef struct _slapdEntryPoints { #define CONFIG_GROUPEVALNESTLEVEL_ATTRIBUTE "nsslapd-groupevalnestlevel" #define CONFIG_NAGLE_ATTRIBUTE "nsslapd-nagle" #define CONFIG_PWPOLICY_LOCAL_ATTRIBUTE "nsslapd-pwpolicy-local" +#define CONFIG_ALLOW_HASHED_PW_ATTRIBUTE "nsslapd-allow-hashed-passwords" #define CONFIG_PW_CHANGE_ATTRIBUTE "passwordChange" #define CONFIG_PW_MUSTCHANGE_ATTRIBUTE "passwordMustChange" #define CONFIG_PW_SYNTAX_ATTRIBUTE "passwordCheckSyntax" @@ -2278,6 +2279,7 @@ typedef struct _slapdFrontendConfig { slapi_onoff_t pwpolicy_local; slapi_onoff_t pw_is_global_policy; + slapi_onoff_t allow_hashed_pw; passwdPolicy pw_policy; /* ACCESS LOG */
0
ab7bab02e7d240da9736290b7b35ee69f7b569b5
389ds/389-ds-base
Compilation warnings (ticket 47350) Bug Description: Get rid of the following warnings: repl5_replica_config.c:543:14: warning: variable 'r' set but not used [-Wunused-but-set-variable] repl5_replica_config.c:721: warning: implicit declaration of function 'valuearray_free' repl5_replica_config.c: In function 'replica_config_search': repl5_replica_config.c:799: warning: passing argument 2 of 'search_requested_attr' discards qualifiers from pointer target type repl5_replica_config.c:753: note: expected 'char *' but argument is of type 'const char *' repl5_replica_config.c:804: warning: passing argument 2 of 'search_requested_attr' discards qualifiers from pointer target type repl5_replica_config.c:753: note: expected 'char *' but argument is of type 'const char *' Fix Description: https://fedorahosted.org/389/ticket/47350 Reviewed by: Mark Reynolds Platforms tested: fedora Flag Day: no Doc impact: no
commit ab7bab02e7d240da9736290b7b35ee69f7b569b5 Author: Thierry bordaz (tbordaz) <[email protected]> Date: Wed Jun 5 14:49:20 2013 +0200 Compilation warnings (ticket 47350) Bug Description: Get rid of the following warnings: repl5_replica_config.c:543:14: warning: variable 'r' set but not used [-Wunused-but-set-variable] repl5_replica_config.c:721: warning: implicit declaration of function 'valuearray_free' repl5_replica_config.c: In function 'replica_config_search': repl5_replica_config.c:799: warning: passing argument 2 of 'search_requested_attr' discards qualifiers from pointer target type repl5_replica_config.c:753: note: expected 'char *' but argument is of type 'const char *' repl5_replica_config.c:804: warning: passing argument 2 of 'search_requested_attr' discards qualifiers from pointer target type repl5_replica_config.c:753: note: expected 'char *' but argument is of type 'const char *' Fix Description: https://fedorahosted.org/389/ticket/47350 Reviewed by: Mark Reynolds Platforms tested: fedora Flag Day: no Doc impact: no diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c index 9dc916921..58285f900 100644 --- a/ldap/servers/plugins/replication/repl5_replica_config.c +++ b/ldap/servers/plugins/replication/repl5_replica_config.c @@ -47,6 +47,7 @@ #include "repl5.h" #include "cl5_api.h" #include "cl5.h" +#include "slap.h" /* CONFIG_BASE: no need to optimize */ #define CONFIG_BASE "cn=mapping tree,cn=config" @@ -540,7 +541,6 @@ replica_config_post_modify(Slapi_PBlock *pb, LDAPMod **mods; int i, apply_mods; multimaster_mtnode_extension *mtnode_ext; - Replica *r = NULL; char *replica_root = NULL; char buf [SLAPI_DSE_RETURNTEXT_SIZE]; char *errortext = returntext ? returntext : buf; @@ -587,8 +587,7 @@ replica_config_post_modify(Slapi_PBlock *pb, goto done; } - r = object_get_data (mtnode_ext->replica); - PR_ASSERT (r); + PR_ASSERT (object_get_data (mtnode_ext->replica) != NULL); slapi_pblock_get(pb, SLAPI_MODIFY_MODS, &mods); for (apply_mods = 0; apply_mods <= 1; apply_mods++) @@ -750,7 +749,7 @@ replica_config_search_ruv(Slapi_PBlock *pb, Slapi_Entry* e, Replica *replica) * else it returns PR_FALSE */ static PRBool -search_requested_attr(Slapi_PBlock *pb, char *attr) +search_requested_attr(Slapi_PBlock *pb, const char *attr) { char **attrs = NULL; int i;
0
47e725dff781d84549501815d5713db48307e273
389ds/389-ds-base
Bug 693473 - rhds82 rfe - windows_tot_run to log Sizelimit exceeded instead of LDAP error - -1 https://bugzilla.redhat.com/show_bug.cgi?id=693473 Resolves: bug 693473 Bug Description: rhds82 rfe - windows_tot_run to log Sizelimit exceeded instead of LDAP error - -1 Reviewed by: nkinder (Thanks!) Branch: master Fix Description: I could not reproduce the sizelimit error. However, I did add error logging. Now if the search gets some error, the search paramters and the error code and message will be logged. Platforms tested: RHEL6 x86_64 Flag Day: no Doc impact: no
commit 47e725dff781d84549501815d5713db48307e273 Author: Rich Megginson <[email protected]> Date: Mon Apr 4 19:30:16 2011 -0600 Bug 693473 - rhds82 rfe - windows_tot_run to log Sizelimit exceeded instead of LDAP error - -1 https://bugzilla.redhat.com/show_bug.cgi?id=693473 Resolves: bug 693473 Bug Description: rhds82 rfe - windows_tot_run to log Sizelimit exceeded instead of LDAP error - -1 Reviewed by: nkinder (Thanks!) Branch: master Fix Description: I could not reproduce the sizelimit error. However, I did add error logging. Now if the search gets some error, the search paramters and the error code and message will be logged. Platforms tested: RHEL6 x86_64 Flag Day: no Doc impact: no diff --git a/ldap/servers/plugins/replication/windows_connection.c b/ldap/servers/plugins/replication/windows_connection.c index e8fe94d68..4315de77c 100644 --- a/ldap/servers/plugins/replication/windows_connection.c +++ b/ldap/servers/plugins/replication/windows_connection.c @@ -658,6 +658,14 @@ windows_search_entry_ext(Repl_Connection *conn, char* searchbase, char *filter, serverctrls_copy , NULL /* client controls */, &conn->timeout, 0 /* sizelimit */, &res); + if ((LDAP_SUCCESS != ldap_rc) && !IS_DISCONNECT_ERROR(ldap_rc)) { + slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, + "Could not retrieve entry from Windows using search " + "base [%s] scope [%d] filter [%s]: error %d:%s\n", + searchbase_copy, scope, filter_copy, ldap_rc, + ldap_err2string(ldap_rc)); + } + slapi_ch_free_string(&searchbase_copy); slapi_ch_free_string(&filter_copy); slapi_ch_array_free(attrs);
0
3ce60db0a404b4663df6005b78027332d0e56f95
389ds/389-ds-base
Ticket 47953 - Should not check aci syntax when deleting an aci Bug Description: Trying to delete an aci that has an invalid sytenx, generates a syntax error when trying to remove it. Fix Description: Do not check the syntax of an aci if it's being deleted. https://fedorahosted.org/389/ticket/47953 Reviewed by: ?
commit 3ce60db0a404b4663df6005b78027332d0e56f95 Author: Mark Reynolds <[email protected]> Date: Wed Nov 12 10:15:46 2014 -0500 Ticket 47953 - Should not check aci syntax when deleting an aci Bug Description: Trying to delete an aci that has an invalid sytenx, generates a syntax error when trying to remove it. Fix Description: Do not check the syntax of an aci if it's being deleted. https://fedorahosted.org/389/ticket/47953 Reviewed by: ? diff --git a/ldap/servers/plugins/acl/acl.c b/ldap/servers/plugins/acl/acl.c index fe863c877..541633042 100644 --- a/ldap/servers/plugins/acl/acl.c +++ b/ldap/servers/plugins/acl/acl.c @@ -1553,11 +1553,12 @@ acl_check_mods( /* Are we adding/replacing a aci attribute ** value. In that case, we need to make - ** sure that the new value has thr right + ** sure that the new value has the right ** syntax */ - if (strcmp(mod->mod_type, - aci_attr_type) == 0) { + if (!SLAPI_IS_MOD_DELETE(mod->mod_op) && + strcmp(mod->mod_type, aci_attr_type) == 0) + { if ( 0 != (rv = acl_verify_syntax(pb, e_sdn, mod->mod_bvalues[i], errbuf))) { aclutil_print_err(rv, e_sdn,
0
a3a4387f399d2849bbab5b0408b11a1c9d0d7656
389ds/389-ds-base
Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053 https://bugzilla.redhat.com/show_bug.cgi?id=619122 Resolves: bug 619122 Bug description: fix coverify Defect Type: Resource leaks issues CID 11995. description: The str2entry_dupcheck() has been modified to release attributedeletioncsn properly.
commit a3a4387f399d2849bbab5b0408b11a1c9d0d7656 Author: Endi S. Dewata <[email protected]> Date: Thu Jul 29 01:56:03 2010 -0500 Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053 https://bugzilla.redhat.com/show_bug.cgi?id=619122 Resolves: bug 619122 Bug description: fix coverify Defect Type: Resource leaks issues CID 11995. description: The str2entry_dupcheck() has been modified to release attributedeletioncsn properly. diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c index 0cb856eb6..4ae7a4ea2 100644 --- a/ldap/servers/slapd/entry.c +++ b/ldap/servers/slapd/entry.c @@ -789,6 +789,7 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) /* the memory below was not allocated by the slapi_ch_ functions */ if (retmalloc) slapi_ch_free_string(&valuecharptr); if (freetype) slapi_ch_free_string(&type); + csn_free(&attributedeletioncsn); continue; } /* Ignore CSNs */ @@ -805,6 +806,7 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) slapi_entry_free( e ); if (retmalloc) slapi_ch_free_string(&valuecharptr); if (freetype) slapi_ch_free_string(&type); + csn_free(&attributedeletioncsn); return NULL; } /* normdn is consumed in e */ @@ -822,6 +824,7 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) slapi_entry_free( e ); if (retmalloc) slapi_ch_free_string(&valuecharptr); if (freetype) slapi_ch_free_string(&type); + csn_free(&attributedeletioncsn); return NULL; } /* normdn is just referred in slapi_entry_set_rdn. */ @@ -843,6 +846,7 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) /* the memory below was not allocated by the slapi_ch_ functions */ if (retmalloc) slapi_ch_free_string(&valuecharptr); if (freetype) slapi_ch_free_string(&type); + csn_free(&attributedeletioncsn); continue; } normdn = slapi_create_dn_string("%s", valuecharptr); @@ -859,6 +863,7 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) /* the memory below was not allocated by the slapi_ch_ functions */ if (retmalloc) slapi_ch_free_string(&valuecharptr); if (freetype) slapi_ch_free_string(&type); + csn_free(&attributedeletioncsn); continue; } @@ -869,6 +874,7 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) /* the memory below was not allocated by the slapi_ch_ functions */ if (retmalloc) slapi_ch_free_string(&valuecharptr); if (freetype) slapi_ch_free_string(&type); + csn_free(&attributedeletioncsn); continue; } @@ -886,6 +892,7 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) /* the memory below was not allocated by the slapi_ch_ functions */ if (retmalloc) slapi_ch_free_string(&valuecharptr); if (freetype) slapi_ch_free_string(&type); + csn_free(&attributedeletioncsn); continue; } @@ -929,6 +936,7 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) /* Something very bad happened */ if (retmalloc) slapi_ch_free_string(&valuecharptr); if (freetype) slapi_ch_free_string(&type); + csn_free(&attributedeletioncsn); return NULL; } for ( i = 0; i < nattrs; i++ ) @@ -1015,6 +1023,7 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) slapi_entry_free( e ); e = NULL; if (retmalloc) slapi_ch_free_string(&valuecharptr); if (freetype) slapi_ch_free_string(&type); + csn_free(&attributedeletioncsn); goto free_and_return; } } @@ -1123,12 +1132,14 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo ) else if (rc==LDAP_TYPE_OR_VALUE_EXISTS) { sa->sa_numdups++; + csn_free(&attributedeletioncsn); } else { /* Failure adding to value tree */ LDAPDebug( LDAP_DEBUG_ANY, "str2entry_dupcheck: unexpected failure %d constructing value tree\n", rc, 0, 0 ); slapi_entry_free( e ); e = NULL; + csn_free(&attributedeletioncsn); goto free_and_return; }
0
4b7791f3ab9370ccf30b09077656e247682bf384
389ds/389-ds-base
Ticket 616 - High contention on computed attribute lock Bug Description: On search request, some requested attributes are computed: - subschemasubentry - nscpentrywsi - numsubordinates - hassubordinates This is done with a linked list of registered callback. When sending the results, each requested attribute is evaluated against all the callbacks. When going through the callbacks list the thread hold the lock on the list. Currently all the server callbacks are registered at startup time with only one thread registering them (main). A custom plugin may register custom callback using slapi_compute_add_evaluator The important point is that callback are only added to the list. Also on standard deployment without custom plugin adding new computed attribute, this list is built at startup. The problem on computed attribute is that it can create contention between search threads trying to evaluate/compute the requested attributes The same description applies to computed filters. For example with 'views' or filters containing "subordinates", the filter is recomputed. This using a linked list of callbacks registered during startup. A custom plugin may register custom callback using slapi_compute_add_search_rewriter. In short: On standard deployment computed filters and computed attributes lists are unchanged after startup. Computed filters/attribute are only added to the lists. Fix Description: The fix consist to not protect the access to computed filter/attribute unless a computed filter/attribute is added after startup. The fix also contains a improvement of rsearch to support filters larger than 256 char The fix also contains reworks according to review feedback. Basically using a temporary variable to hold the actual value of require_* The benefit is limited to 2% in terms of search throughput (8*4core machine) https://fedorahosted.org/389/ticket/616 Reviewed by: Rich Megginson (thanks Rich !) Platforms tested: 1*4cores fedora and 8*4cores RHEL6.4 Flag Day: no Doc impact: no
commit 4b7791f3ab9370ccf30b09077656e247682bf384 Author: Thierry bordaz (tbordaz) <[email protected]> Date: Thu Mar 14 18:35:21 2013 +0100 Ticket 616 - High contention on computed attribute lock Bug Description: On search request, some requested attributes are computed: - subschemasubentry - nscpentrywsi - numsubordinates - hassubordinates This is done with a linked list of registered callback. When sending the results, each requested attribute is evaluated against all the callbacks. When going through the callbacks list the thread hold the lock on the list. Currently all the server callbacks are registered at startup time with only one thread registering them (main). A custom plugin may register custom callback using slapi_compute_add_evaluator The important point is that callback are only added to the list. Also on standard deployment without custom plugin adding new computed attribute, this list is built at startup. The problem on computed attribute is that it can create contention between search threads trying to evaluate/compute the requested attributes The same description applies to computed filters. For example with 'views' or filters containing "subordinates", the filter is recomputed. This using a linked list of callbacks registered during startup. A custom plugin may register custom callback using slapi_compute_add_search_rewriter. In short: On standard deployment computed filters and computed attributes lists are unchanged after startup. Computed filters/attribute are only added to the lists. Fix Description: The fix consist to not protect the access to computed filter/attribute unless a computed filter/attribute is added after startup. The fix also contains a improvement of rsearch to support filters larger than 256 char The fix also contains reworks according to review feedback. Basically using a temporary variable to hold the actual value of require_* The benefit is limited to 2% in terms of search throughput (8*4core machine) https://fedorahosted.org/389/ticket/616 Reviewed by: Rich Megginson (thanks Rich !) Platforms tested: 1*4cores fedora and 8*4cores RHEL6.4 Flag Day: no Doc impact: no diff --git a/ldap/servers/slapd/computed.c b/ldap/servers/slapd/computed.c index 353d37591..8259deaad 100644 --- a/ldap/servers/slapd/computed.c +++ b/ldap/servers/slapd/computed.c @@ -44,6 +44,7 @@ /* Handles computed attributes for entries as they're returned to the client */ #include "slap.h" +#include "proto-slap.h" /* Structure used to pass the context needed for completing a computed attribute operation */ @@ -61,8 +62,11 @@ struct _compute_evaluator { }; typedef struct _compute_evaluator compute_evaluator; +static PRBool startup_completed = PR_FALSE; + static compute_evaluator *compute_evaluators = NULL; static Slapi_RWLock *compute_evaluators_lock = NULL; +static PRBool require_compute_evaluator_lock = PR_FALSE; static int compute_stock_evaluator(computed_attr_context *c,char* type,Slapi_Entry *e,slapi_compute_output_t outputfn); @@ -75,6 +79,7 @@ typedef struct _compute_rewriter compute_rewriter; static compute_rewriter *compute_rewriters = NULL; static Slapi_RWLock *compute_rewriters_lock = NULL; +static PRBool require_compute_rewriters_lock = PR_FALSE; /* Function called by evaluators to have the value output */ static int @@ -83,17 +88,36 @@ compute_output_callback(computed_attr_context *c,Slapi_Attr *a , Slapi_Entry *e) return encode_attr (c->pb, c->ber, e, a, c->attrsonly, c->requested_type); } +static +int compute_call_evaluators_nolock(computed_attr_context *c,slapi_compute_output_t outfn,char *type,Slapi_Entry *e) +{ + int rc = -1; + compute_evaluator *current = NULL; + + for (current = compute_evaluators; (current != NULL) && (-1 == rc); current = current->next) { + rc = (*(current->function))(c,type,e,outfn); + } + return rc; +} + static int compute_call_evaluators(computed_attr_context *c,slapi_compute_output_t outfn,char *type,Slapi_Entry *e) { int rc = -1; - compute_evaluator *current = NULL; + int need_lock = require_compute_evaluator_lock; + /* Walk along the list (locked) calling the evaluator functions util one says yes, an error happens, or we finish */ - slapi_rwlock_rdlock(compute_evaluators_lock); - for (current = compute_evaluators; (current != NULL) && (-1 == rc); current = current->next) { - rc = (*(current->function))(c,type,e,outfn); - } - slapi_rwlock_unlock(compute_evaluators_lock); + + if (need_lock) { + slapi_rwlock_rdlock(compute_evaluators_lock); + } + + rc = compute_call_evaluators_nolock(c, outfn, type, e); + + if (need_lock) { + slapi_rwlock_unlock(compute_evaluators_lock); + } + return rc; } @@ -132,25 +156,54 @@ compute_stock_evaluator(computed_attr_context *c,char* type,Slapi_Entry *e,slapi return rc; /* I see no ships */ } +static void +compute_add_evaluator_nolock(slapi_compute_callback_t function, compute_evaluator *new_eval) +{ + new_eval->next = compute_evaluators; + new_eval->function = function; + compute_evaluators = new_eval; +} int slapi_compute_add_evaluator(slapi_compute_callback_t function) { int rc = 0; compute_evaluator *new_eval = NULL; PR_ASSERT(NULL != function); PR_ASSERT(NULL != compute_evaluators_lock); - slapi_rwlock_wrlock(compute_evaluators_lock); + if (startup_completed) { + /* We are now in multi-threaded and we still add + * a attribute evaluator. + * switch to use locking mechanimsm + */ + require_compute_evaluator_lock = PR_TRUE; + } + new_eval = (compute_evaluator *)slapi_ch_calloc(1,sizeof (compute_evaluator)); if (NULL == new_eval) { rc = ENOMEM; } else { - new_eval->next = compute_evaluators; - new_eval->function = function; - compute_evaluators = new_eval; + int need_lock = require_compute_evaluator_lock; + + if (need_lock) { + slapi_rwlock_wrlock(compute_evaluators_lock); + } + + compute_add_evaluator_nolock(function, new_eval); + + if (need_lock) { + slapi_rwlock_unlock(compute_evaluators_lock); + } } - slapi_rwlock_unlock(compute_evaluators_lock); + return rc; } +/* Called when */ +void +compute_plugins_started() +{ + startup_completed = PR_TRUE; +} + /* Call this on server startup, before the first LDAP operation is serviced */ int compute_init() { @@ -200,6 +253,14 @@ int compute_terminate() return 0; } +static void +compute_add_search_rewrite_nolock(slapi_search_rewrite_callback_t function, compute_rewriter *new_rewriter) +{ + new_rewriter->next = compute_rewriters; + new_rewriter->function = function; + compute_rewriters = new_rewriter; +} + /* Functions dealing with re-writing of search filters */ int slapi_compute_add_search_rewriter(slapi_search_rewrite_callback_t function) @@ -208,36 +269,66 @@ int slapi_compute_add_search_rewriter(slapi_search_rewrite_callback_t function) compute_rewriter *new_rewriter = NULL; PR_ASSERT(NULL != function); PR_ASSERT(NULL != compute_rewriters_lock); + if (startup_completed) { + /* We are now in multi-threaded and we still add + * a filter rewriter. + * switch to use locking mechanimsm + */ + require_compute_rewriters_lock = PR_TRUE; + } new_rewriter = (compute_rewriter *)slapi_ch_calloc(1,sizeof (compute_rewriter)); if (NULL == new_rewriter) { rc = ENOMEM; } else { - slapi_rwlock_wrlock(compute_rewriters_lock); - new_rewriter->next = compute_rewriters; - new_rewriter->function = function; - compute_rewriters = new_rewriter; - slapi_rwlock_unlock(compute_rewriters_lock); + int need_lock = require_compute_rewriters_lock; + + if (need_lock) { + slapi_rwlock_wrlock(compute_rewriters_lock); + } + + compute_add_search_rewrite_nolock(function, new_rewriter); + + if (need_lock) { + slapi_rwlock_unlock(compute_rewriters_lock); + } } return rc; } -int compute_rewrite_search_filter(Slapi_PBlock *pb) +static +int compute_rewrite_search_filter_nolock(Slapi_PBlock *pb) +{ + int rc = -1; + compute_rewriter *current = NULL; + + for (current = compute_rewriters; (current != NULL) && (-1 == rc); current = current->next) { + rc = (*(current->function))(pb); + /* Meaning of the return code : + -1 : keep looking + 0 : rewrote OK + 1 : refuse to do this search + 2 : operations error + */ + } + return(rc); +} + +int compute_rewrite_search_filter(Slapi_PBlock *pb) { /* Iterate through the listed rewriters until one says it matched */ int rc = -1; - compute_rewriter *current = NULL; + int need_lock = require_compute_rewriters_lock; + /* Walk along the list (locked) calling the evaluator functions util one says yes, an error happens, or we finish */ - slapi_rwlock_rdlock(compute_rewriters_lock); - for (current = compute_rewriters; (current != NULL) && (-1 == rc); current = current->next) { - rc = (*(current->function))(pb); - /* Meaning of the return code : - -1 : keep looking - 0 : rewrote OK - 1 : refuse to do this search - 2 : operations error - */ - } - slapi_rwlock_unlock(compute_rewriters_lock); + if (need_lock) { + slapi_rwlock_rdlock(compute_rewriters_lock); + } + + rc = compute_rewrite_search_filter_nolock(pb); + + if (need_lock) { + slapi_rwlock_unlock(compute_rewriters_lock); + } return rc; } diff --git a/ldap/servers/slapd/main.c b/ldap/servers/slapd/main.c index f438fce3f..e97e5ef86 100644 --- a/ldap/servers/slapd/main.c +++ b/ldap/servers/slapd/main.c @@ -1178,7 +1178,8 @@ main( int argc, char **argv) pw_exp_init (); plugin_print_lists(); - plugin_startall(argc, argv, 1 /* Start Backends */, 1 /* Start Globals */); + plugin_startall(argc, argv, 1 /* Start Backends */, 1 /* Start Globals */); + compute_plugins_started(); if (housekeeping_start((time_t)0, NULL) == NULL) { return_value = 1; goto cleanup; diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h index 0da266ba8..53d356994 100644 --- a/ldap/servers/slapd/proto-slap.h +++ b/ldap/servers/slapd/proto-slap.h @@ -251,6 +251,7 @@ void do_compare( Slapi_PBlock *pb ); int compute_attribute(char *type, Slapi_PBlock *pb,BerElement *ber,Slapi_Entry *e,int attrsonly,char *requested_type); int compute_init(); int compute_terminate(); +void compute_plugins_started(); /* diff --git a/ldap/servers/slapd/tools/rsearch/nametable.c b/ldap/servers/slapd/tools/rsearch/nametable.c index 0a4b6fce1..e5d04cd2f 100644 --- a/ldap/servers/slapd/tools/rsearch/nametable.c +++ b/ldap/servers/slapd/tools/rsearch/nametable.c @@ -152,8 +152,8 @@ int nt_load(NameTable *nt, const char *filename) if (!fd) return 0; while (PR_Available(fd) > 0) { - char temp[256], *s; - if (PR_GetLine(fd, temp, 256)) break; + char temp[4096], *s; + if (PR_GetLine(fd, temp, sizeof(temp))) break; s = strdup(temp); if (!s) break; if (!nt_push(nt, s)) break; diff --git a/ldap/servers/slapd/tools/rsearch/searchthread.c b/ldap/servers/slapd/tools/rsearch/searchthread.c index 8a74d587f..6c43dfbc4 100644 --- a/ldap/servers/slapd/tools/rsearch/searchthread.c +++ b/ldap/servers/slapd/tools/rsearch/searchthread.c @@ -285,7 +285,7 @@ static int st_bind(SearchThread *st) return 0; } } else if (uid) { - char filterBuffer[100]; + char filterBuffer[4096]; char *pFilter; char *filterTemplate = (uidFilter) ? uidFilter : "(uid=%s)"; struct timeval timeout;
0
6def0ac9433be6eb5495cde4702abd3c8a4d4ff4
389ds/389-ds-base
Issue 4648 - Fix some issues and improvement around CI tests (#4651) * Issue 4648 - Fix some issues and improvement around CI tests * Issue 4648 - Fix some issues and improvement around CI tests
commit 6def0ac9433be6eb5495cde4702abd3c8a4d4ff4 Author: progier389 <[email protected]> Date: Thu Mar 18 12:34:04 2021 +0100 Issue 4648 - Fix some issues and improvement around CI tests (#4651) * Issue 4648 - Fix some issues and improvement around CI tests * Issue 4648 - Fix some issues and improvement around CI tests diff --git a/dirsrvtests/tests/suites/import/import_test.py b/dirsrvtests/tests/suites/import/import_test.py index edeb81b01..3d4aaebac 100644 --- a/dirsrvtests/tests/suites/import/import_test.py +++ b/dirsrvtests/tests/suites/import/import_test.py @@ -195,7 +195,7 @@ def test_import_with_index(topo, _import_clean): 3. Operation successful """ place = topo.standalone.dbdir - assert f'{place}/userRoot/roomNumber.db' not in glob.glob(f'{place}/userRoot/*.db', recursive=True) + assert not glob.glob(f'{place}/userRoot/roomNumber.db*', recursive=True) # Creating the room number index indexes = Indexes(topo.standalone) indexes.create(properties={ @@ -206,7 +206,8 @@ def test_import_with_index(topo, _import_clean): # Importing online _import_online(topo, 5) # Import is done -- verifying that it worked - assert f'{place}/userRoot/roomNumber.db' in glob.glob(f'{place}/userRoot/*.db', recursive=True) + assert glob.glob(f'{place}/userRoot/roomNumber.db*', recursive=True) + def test_online_import_with_warning(topo, _import_clean): diff --git a/dirsrvtests/tests/suites/password/regression_test.py b/dirsrvtests/tests/suites/password/regression_test.py index 5d0c17a5f..11edf8050 100644 --- a/dirsrvtests/tests/suites/password/regression_test.py +++ b/dirsrvtests/tests/suites/password/regression_test.py @@ -7,6 +7,7 @@ # import pytest import time +import glob from lib389._constants import PASSWORD, DN_DM, DEFAULT_SUFFIX from lib389._constants import SUFFIX, PASSWORD, DN_DM, DN_CONFIG, PLUGIN_RETRO_CHANGELOG, DEFAULT_SUFFIX, DEFAULT_CHANGELOG_DB, DEFAULT_BENAME from lib389 import Entry @@ -47,12 +48,9 @@ def _check_unhashed_userpw(inst, user_dn, is_present=False): dbscanOut = inst.dbscan(DEFAULT_BENAME, 'replication_changelog') else: changelog_dbdir = os.path.join(os.path.dirname(inst.dbdir), DEFAULT_CHANGELOG_DB) - for dbfile in os.listdir(changelog_dbdir): - if dbfile.endswith('.db'): - changelog_dbfile = os.path.join(changelog_dbdir, dbfile) - log.info('Changelog dbfile file exist: {}'.format(changelog_dbfile)) - log.info('Running dbscan -f to check {} attr'.format(unhashed_pwd_attribute)) - dbscanOut = inst.dbscan(DEFAULT_CHANGELOG_DB, changelog_dbfile) + for changelog_dbfile in glob.glob(f'{changelog_dbdir}*/*.db*'): + log.info('Changelog dbfile file exist: {}'.format(changelog_dbfile)) + dbscanOut = inst.dbscan(DEFAULT_CHANGELOG_DB, changelog_dbfile) for entry in dbscanOut.split(b'dbid: '): if ensure_bytes('operation: modify') in entry and ensure_bytes(user_dn) in entry and ensure_bytes('userPassword') in entry: diff --git a/dirsrvtests/tests/suites/replication/changelog_test.py b/dirsrvtests/tests/suites/replication/changelog_test.py index 8ae9c5917..96cef38da 100644 --- a/dirsrvtests/tests/suites/replication/changelog_test.py +++ b/dirsrvtests/tests/suites/replication/changelog_test.py @@ -13,6 +13,7 @@ import ldif import pytest import time import subprocess +import glob from lib389.properties import TASK_WAIT from lib389.replica import Replicas from lib389.idm.user import UserAccounts @@ -489,10 +490,10 @@ def test_verify_changelog_online_backup(topo): backup_checkdir = os.path.join(backup_dir, DEFAULT_BENAME, BDB_CL_FILENAME) else: backup_checkdir = os.path.join(backup_dir, '.repl_changelog_backup', DEFAULT_CHANGELOG_DB) - if os.path.exists(backup_checkdir): + if glob.glob(f'{backup_checkdir}*'): log.info('Database backup is created successfully') else: - log.fatal('test_changelog5: backup directory does not exist : {}'.format(backup_checkdir)) + log.fatal('test_changelog5: backup directory does not exist : {}*'.format(backup_checkdir)) assert False log.info('Run bak2db to restore directory server') @@ -550,10 +551,10 @@ def test_verify_changelog_offline_backup(topo): backup_checkdir = os.path.join(backup_dir, DEFAULT_BENAME, BDB_CL_FILENAME) else: backup_checkdir = os.path.join(backup_dir, '.repl_changelog_backup', DEFAULT_CHANGELOG_DB) - if os.path.exists(backup_checkdir): + if glob.glob(f'{backup_checkdir}*'): log.info('Database backup is created successfully') else: - log.fatal('test_changelog5: backup directory does not exist : {}'.format(backup_checkdir)) + log.fatal('test_changelog5: backup directory does not exist : {}*'.format(backup_checkdir)) assert False log.info('LDAP operations add, modify, modrdn and delete') diff --git a/dirsrvtests/tests/suites/replication/encryption_cl5_test.py b/dirsrvtests/tests/suites/replication/encryption_cl5_test.py index e1738988a..a3ece0190 100644 --- a/dirsrvtests/tests/suites/replication/encryption_cl5_test.py +++ b/dirsrvtests/tests/suites/replication/encryption_cl5_test.py @@ -65,12 +65,10 @@ def _check_unhashed_userpw_encrypted(inst, change_type, user_dn, user_pw, is_enc dbscanOut = inst.dbscan(DEFAULT_BENAME, 'replication_changelog') else: changelog_dbdir = os.path.join(os.path.dirname(inst.dbdir), DEFAULT_CHANGELOG_DB) - for dbfile in os.listdir(changelog_dbdir): - if dbfile.endswith('.db'): - changelog_dbfile = os.path.join(changelog_dbdir, dbfile) - log.info('Changelog dbfile file exist: {}'.format(changelog_dbfile)) - log.info('Running dbscan -f to check {} attr'.format(ATTRIBUTE)) - dbscanOut = inst.dbscan(DEFAULT_CHANGELOG_DB, changelog_dbfile) + for changelog_dbfile in glob.glob(f'{changelog_dbdir}*/*.db*'): + log.info('Changelog dbfile file exist: {}'.format(changelog_dbfile)) + log.info('Running dbscan -f to check {} attr'.format(ATTRIBUTE)) + dbscanOut = inst.dbscan(DEFAULT_CHANGELOG_DB, changelog_dbfile) count = 0 for entry in dbscanOut.split(b'dbid: '): diff --git a/ldap/servers/slapd/detach.c b/ldap/servers/slapd/detach.c index d5c95a04f..1a69365a1 100644 --- a/ldap/servers/slapd/detach.c +++ b/ldap/servers/slapd/detach.c @@ -124,6 +124,7 @@ int detach(int slapd_exemode, int importexport_encrypt, int s_port, daemon_ports_t *ports_info) { int i, sd; + char buf[50]; if (should_detach) { for (i = 0; i < 5; i++) { @@ -163,9 +164,23 @@ detach(int slapd_exemode, int importexport_encrypt, int s_port, daemon_ports_t * return 1; } (void)dup2(sd, 0); + /* Lets ignore libaccess printf */ (void)dup2(sd, 1); (void)dup2(sd, 2); close(sd); +#ifdef DEBUG + /* But lets try to preserve other errors like loader undefined symbols */ + sprintf(buf, "/var/dirsrv/ns-slapd-%d-XXXXXX.stderr", getpid()); + if ((sd = mkstemps(buf, 7)) < 0) { + /* Lets try /tmp (so that non root users may keep the stderr */ + sprintf(buf, "/tmp/ns-slapd-%d-XXXXXX.stderr", getpid()); + sd = mkstemps(buf, 7); + } + if (sd >= 0) { + (void)dup2(sd, 2); + close(sd); + } +#endif #ifdef USE_SETSID setsid(); diff --git a/ldap/servers/slapd/tools/dbscan.c b/ldap/servers/slapd/tools/dbscan.c index 997478f04..e840334dd 100644 --- a/ldap/servers/slapd/tools/dbscan.c +++ b/ldap/servers/slapd/tools/dbscan.c @@ -1055,7 +1055,7 @@ is_changelog(char *filename) ptr++; } - if (0 == strcmp(ptr, "replication_changelog.db")) return 1; + if (strstr(ptr, "replication_changelog.db")) return 1; for (; ptr && *ptr; ptr++) { if ('.' == *ptr) { diff --git a/src/lib389/lib389/__init__.py b/src/lib389/lib389/__init__.py index c36ea84ea..c3b91bb9d 100644 --- a/src/lib389/lib389/__init__.py +++ b/src/lib389/lib389/__init__.py @@ -2989,6 +2989,9 @@ class DirSrv(SimpleLDAPObject, object): indexfile = os.path.join(self.dbdir, bename, index) else: indexfile = os.path.join(self.dbdir, bename, index + '.db') + # (we should also accept a version number for .db suffix) + for f in glob.glob(f'{indexfile}*'): + indexfile = f cmd = [prog, '-f', indexfile] diff --git a/src/lib389/lib389/utils.py b/src/lib389/lib389/utils.py index c44fcf3f7..20bb38b8e 100644 --- a/src/lib389/lib389/utils.py +++ b/src/lib389/lib389/utils.py @@ -195,8 +195,12 @@ def selinux_present(): try: import selinux if selinux.is_selinux_enabled(): - # We have selinux, continue. - status = True + # We have selinux, lets see if we are allowed to configure it. + # (just checking the uid for now - we may rather check if semanage command success) + if os.geteuid() != 0: + log.error('Non priviledged user cannot use semanage, will not relabel ports or files.' ) + else: + status = True else: # We have the module, but it's disabled. log.error('selinux is disabled, will not relabel ports or files.' ) @@ -271,7 +275,7 @@ def selinux_label_port(port, remove_label=False): log.debug('selinux python module not found, skipping port labeling.') return - if not selinux.is_selinux_enabled(): + if not selinux_present(): log.debug('selinux is disabled, skipping port relabel') return
0
c6b2d744bffdda1b490a75605446f599461f62d0
389ds/389-ds-base
Add Doxygen comments for SLAPI attr, value, and valueset functions. This adds Doxygen comment blocks to the public header file for the attr, value, and valueset related fucntions and defines.
commit c6b2d744bffdda1b490a75605446f599461f62d0 Author: Nathan Kinder <[email protected]> Date: Tue Jan 12 16:03:52 2010 -0800 Add Doxygen comments for SLAPI attr, value, and valueset functions. This adds Doxygen comment blocks to the public header file for the attr, value, and valueset related fucntions and defines. diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h index 42b571003..d35c12ce7 100644 --- a/ldap/servers/slapd/slapi-plugin.h +++ b/ldap/servers/slapd/slapi-plugin.h @@ -102,13 +102,71 @@ NSPR_API(PRUint32) PR_fprintf(struct PRFileDesc* fd, const char *fmt, ...) * * Note that the flag values 0x0010, 0x0020, 0x4000, and 0x8000 are reserved. */ +/** + * Flag indicating that an attribtue is single-valued. + * + * \see slapi_attr_flag_is_set() + * \see slapi_attr_set_flags() + */ #define SLAPI_ATTR_FLAG_SINGLE 0x0001 /* single-valued attribute */ + +/** + * Flag indicating than an attribute is operational. + * + * \see slapi_attr_flag_is_set() + * \see slapi_attr_set_flags() + */ #define SLAPI_ATTR_FLAG_OPATTR 0x0002 /* operational attribute */ + +/** + * Flag indicating than an attribute is read-only. + * + * \see slapi_attr_flag_is_set() + * \see slapi_attr_set_flags() + */ #define SLAPI_ATTR_FLAG_READONLY 0x0004 /* read from shipped config file */ + +/** + * Flag indicating than an attribute is read-only. + * + * This is an alias for #SLAPI_ATTR_FLAG_READONLY. + * \see slapi_attr_flag_is_set() + * \see slapi_attr_set_flags() + */ #define SLAPI_ATTR_FLAG_STD_ATTR SLAPI_ATTR_FLAG_READONLY /* alias for read only */ + +/** + * Flag indicating than an attribute is obsolete. + * + * \see slapi_attr_flag_is_set() + * \see slapi_attr_set_flags() + */ #define SLAPI_ATTR_FLAG_OBSOLETE 0x0040 /* an outdated definition */ + +/** + * Flag indicating that an attribute is collective. + * + * \warning Collective attributes are not supported, so this + * flag has no effect. + * \see slapi_attr_flag_is_set() + * \see slapi_attr_set_flags() + */ #define SLAPI_ATTR_FLAG_COLLECTIVE 0x0080 /* collective (not supported) */ + +/** + * Flag indicating that an attribute is not modifiable over LDAP. + * + * \see slapi_attr_flag_is_set() + * \see slapi_attr_set_flags() + */ #define SLAPI_ATTR_FLAG_NOUSERMOD 0x0100 /* can't be modified over LDAP */ + +/** + * Flag to indicate that the attribute value is normalized. + * + * \see slapi_value_set_flags() + * \see slapi_values_set_flags() + */ #define SLAPI_ATTR_FLAG_NORMALIZED 0x0200 /* the attr value is normalized */ /* operation flags */ @@ -2866,110 +2924,1133 @@ int slapi_rdn2typeval( char *rdn, char **type, struct berval *bv ); char *slapi_dn_plus_rdn(const char *dn, const char *rdn); -/* TODO - Pickup Doxygen work here */ /* * thread safe random functions */ +/** + * Generate a pseudo-random integer with optional seed. + * + * \param seed A seed to use when generating the pseudo random number. + * \return A pseudo random number. + * \see slapi_rand() + * \see slapi_rand_array() + */ int slapi_rand_r(unsigned int * seed); + +/* Generate a pseudo-random integer in an array. + * + * \param randx The array you want filled with the random number. + * \param len The length of the array you want filled with the random number. + * \see slapi_rand() + * \see slapi_rand_r() + */ void slapi_rand_array(void *randx, size_t len); + +/** + * Generate a pseudo-random integer. + * + * \return A pseudo random number. + * \see slapi_rand_r() + * \see slapi_rand_array() + */ int slapi_rand(); /* * attribute routines */ +/** + * Create a new empty attribute. + * + * \return A pointer to the newly created attribute. + * \warning You must free the returned attribute using slapi_attr_free(). + * \see slapi_attr_init() + * \see slapi_attr_dup() + * \see slapi_attr_free() + */ Slapi_Attr *slapi_attr_new( void ); + +/** + * Initializes an attribute with an attribute type. + * + * \param a The attribute to initialize. + * \param type The attribute type to set. + * \return A pointer to the initialized attribute. + */ Slapi_Attr *slapi_attr_init(Slapi_Attr *a, const char *type); + +/** + * Frees an attribute from memory. + * + * \param a Address of a pointer to the attribute to be freed. + * \see slapi_attr_init() + * \see slapi_attr_dup() + * \see slapi_attr_new() + */ void slapi_attr_free( Slapi_Attr **a ); + +/** + * Make a copy of an attribute. + * + * \param attr The attribute to be duplicated. + * \return The newly created copy of the attribute. + * \warning You must free the returned attribute using slapi_attr_free(). + * \see slapi_attr_new() + * \see slapi_attr_init() + * \see slapi_attr_free() + */ Slapi_Attr *slapi_attr_dup(const Slapi_Attr *attr); + +/** + * Adds a value to an attribute. + * + * \param a The attribute that will contain the values. + * \param v Value to be added to the attribute. + * \return Always returns 0. + * \see slapi_attr_first_value() + * \see slapi_attr_next_value() + * \see slapi_attr_get_numvalues() + * \see slapi_attr_value_cmp() + * \see slapi_attr_value_find() + */ int slapi_attr_add_value(Slapi_Attr *a, const Slapi_Value *v); + +/** + * Find syntax plugin associated with an attribute type. + * + * \param type Type of attribute for which you want to get the plugin. + * \param pi Address to receive a pointer to the plugin structure. + * \return \c 0 if successful. + * \return \c -1 if the plugin is not found. + * \see slapi_attr_get_type() + * \see slapi_attr_type_cmp() + * \see slapi_attr_types_equivalent() + * \see slapi_attr_basetype() + */ int slapi_attr_type2plugin( const char *type, void **pi ); + +/** + * Get the name of the attribute type from a specified attribute. + * + * \param attr Attribute for which you want to get the type. + * \param type Address to receive a pointer to the attribute type. + * \return Always returns \c 0. + * \warning Do not free the returned attribute type. The type is a part + * if the actual attribute data, not a copy. + * \see slapi_attr_type2plugin() + * \see slapi_attr_type_cmp() + * \see slapi_attr_types_equivalent() + * \see slapi_attr_basetype() + */ int slapi_attr_get_type( Slapi_Attr *attr, char **type ); + +/** + * Get the attribute type OID of a particular attribute. + * + * \param attr Attribute that contains the desired OID. + * \param oidp Address to receive a pointer to a copy of the + * attribute type OID. + * \return \c 0 if the attribute type is found. + * \return \c -1 if the attribute type is not found. + * \warning The returned OID should be freed by calling the + * slapi_ch_free_string() function. + * \see slapi_attr_get_syntax_oid_copy() + */ int slapi_attr_get_oid_copy( const Slapi_Attr *attr, char **oidp ); + +/* + * Get the syntax OID of a particular attribute. + * + * \param a Attribute that contains the desired OID. + * \param oidp Address to receive a pointer to a copy of the + * syntax OID. + * \return \c 0 if the syntax OID is found. + * \return \c -1 if the syntax OID is not found. + * \warning The returned OID should be freed by calling the + * slapi_ch_free_string() function. + * \see slapi_attr_get_oid_copy() + */ int slapi_attr_get_syntax_oid_copy( const Slapi_Attr *a, char **oidp ); + +/** + * Get the flags associated with a particular attribute. + * + * Valid flags are: + * \arg #SLAPI_ATTR_FLAG_SINGLE + * \arg #SLAPI_ATTR_FLAG_OPATTR + * \arg #SLAPI_ATTR_FLAG_READONLY + * \arg #SLAPI_ATTR_FLAG_OBSOLETE + * \arg #SLAPI_ATTR_FLAG_COLLECTIVE + * \arg #SLAPI_ATTR_FLAG_NOUSERMOD + * \arg #SLAPI_ATTR_FLAG_NORMALIZED + * + * \param attr Attribute for which you want to get the flags. + * \param flags Address of an integer that you want to reveive the flags. + * \return \c Always returns 0. + * \see slapi_attr_flag_is_set() + */ int slapi_attr_get_flags( const Slapi_Attr *attr, unsigned long *flags ); + +/** + * Checks if certain flags are set for a particular attribute. + * + * Valid flags are: + * \arg #SLAPI_ATTR_FLAG_SINGLE + * \arg #SLAPI_ATTR_FLAG_OPATTR + * \arg #SLAPI_ATTR_FLAG_READONLY + * \arg #SLAPI_ATTR_FLAG_OBSOLETE + * \arg #SLAPI_ATTR_FLAG_COLLECTIVE + * \arg #SLAPI_ATTR_FLAG_NOUSERMOD + * \arg #SLAPI_ATTR_FLAG_NORMALIZED + * + * \param attr Attribute that you want to check. + * \param flag Flags to check in the attribute. + * \return \c 1 if the specified flags are set. + * \return \c 0 if the specified flags are not set. + * \see slapi_attr_get_flags() + */ int slapi_attr_flag_is_set( const Slapi_Attr *attr, unsigned long flag ); + +/** + * Comare two values for a given attribute. + * + * \param attr Attribute used to determine how these values are compared; for + * example, the syntax of the attribute may perform case-insensitive + * comparisons. + * \param v1 Pointer to the \c berval structure containing the first value + * that you want to compare. + * \param v2 Pointer to the \c berval structure containing the second value + * that you want to compare. + * \return \c 0 if the values are equal. + * \return \c -1 if the values are not equal. + * \see slapi_attr_add_value() + * \see slapi_attr_first_value() + * \see slapi_attr_next_value() + * \see slapi_attr_get_numvalues() + * \see slapi_attr_value_find() + */ int slapi_attr_value_cmp( const Slapi_Attr *attr, const struct berval *v1, const struct berval *v2 ); + +/** + * Determine if an attribute contains a given value. + * + * \param a Attribute that you want to check. + * \param v Pointer to the \c berval structure containing the value for + * which you want to search. + * \return \c 0 if the attribute contains the specified value. + * \return \c 01 if the attribute does not contain the specified value. + * \see slapi_attr_add_value() + * \see slapi_attr_first_value() + * \see slapi_attr_next_value() + * \see slapi_attr_get_numvalues() + * \see slapi_attr_value_cmp() + */ int slapi_attr_value_find( const Slapi_Attr *a, const struct berval *v ); +/** + * Compare two attribute types. + * + * \param t1 Name of the first attribute type to compare. + * \param t2 Name of the second attribute type to compare. + * \param opt One of the following options: + * \arg #SLAPI_TYPE_CMP_EXACT + * \arg #SLAPI_TYPE_CMP_BASE + * \arg #SLAPI_TYPE_CMP_SUBTYPE + * \return \c 0 if the type names are equal. + * \return A non-zero value if the type names are not equal. + * \see slapi_attr_type2plugin() + * \see slapi_attr_get_type() + * \see slapi_attr_types_equivalent() + * \see slapi_attr_basetype() + */ int slapi_attr_type_cmp( const char *t1, const char *t2, int opt ); + /* Mode of operation (opt) values for slapi_attr_type_cmp() */ +/** + * Compare the types as-is. + * + * \see slapi_attr_type_cmp() + */ #define SLAPI_TYPE_CMP_EXACT 0 + +/** + * Compare only the base names of the types. + * + * \see slapi_attr_type_cmp() + */ #define SLAPI_TYPE_CMP_BASE 1 + +/** + * Ignore any subtypes in the second type that are not in the first subtype. + * + * \see slapi_attr_type_cmp() + */ #define SLAPI_TYPE_CMP_SUBTYPE 2 +/** + * Compare two attribute names to determine if they represent the same value. + * + * \param t1 Pointer to the first attribute you want to compare. + * \param t2 Pointer to the second attribute you want to compare. + * \return \c 1 if \c t1 and \c t2 represent the same attribute. + * \return \c 0 if \c t1 and \c t2 do not represent the same attribute. + * \see slapi_attr_type_cmp() + * \see slapi_attr_get_type() + * \see slapi_attr_basetype() + */ int slapi_attr_types_equivalent(const char *t1, const char *t2); + +/** + * Get the base type of an attribute. + * + * For example, if given \c cn;lang-jp, returns \c cn. + * + * \param type Attribute type from which you want to get the base type. + * \param buf Buffer to hold the returned base type. + * \param bufsiz Size of the buffer. + * \return \c NULL if the base type fits in the buffer. + * \return A pointer to a newly allocated base type if the buffer is + * too small to hold it. + * \warning If a base type is returned, if should be freed by calling + * slapi_ch_free_string(). + * \see slapi_attr_get_type() + * \see slapi_attr_type_cmp() + * \see slapi_attr_types_equivalent() + */ char *slapi_attr_basetype( const char *type, char *buf, size_t bufsiz ); + +/** + * Get the first value of an attribute. + * + * This is part of a set of functions to enumerate over a + * \c Slapi_Attr structure. + * + * \param a Attribute containing the desired value. + * \param v Holds the first value of the attribute. + * \return \c 0, which is the index of the first value. + * \return \c -1 if \c NULL or if the value is not found. + * \warning Do not free the returned value. It is a part + * of the attribute structure and not a copy. + * \see slapi_attr_next_value() + * \see slapi_attr_get_num_values() + */ int slapi_attr_first_value( Slapi_Attr *a, Slapi_Value **v ); + +/** + * Get the next value of an attribute. + * + * The value of an attribute associated with an index is placed into + * a value. This is pare of a set of functions to enumerate over a + * \c Slapi_Attr structure. + * + * \param a Attribute containing the desired value. + * \param hint Index of the value to be returned. + * \param v Holds the value of the attribute. + * \return \c hint plus \c 1 if the value is found. + * \return \c -1 if \c NULL or if a value at \c hint is not found. + * \warning Do not free the returned value. It is a part + * of the attribute structure and not a copy. + * \see slapi_attr_first_value() + * \see slapi_attr_get_num_values() + */ int slapi_attr_next_value( Slapi_Attr *a, int hint, Slapi_Value **v ); + +/** + * Get the number of values present in an attribute. + * + * Counts the number of values in an attribute and places that + * count in an integer. + * + * \param a Attribute containing the values to be counted. + * \param numValues Integer to hold the counted values. + * \see slapi_attr_first_value() + * \see slapi_attr_next_value() + */ int slapi_attr_get_numvalues( const Slapi_Attr *a, int *numValues); + +/** + * Copy existing values contained in an attribute into a valueset. + * + * \param a Attribute containing the values to be placed into + * a valueset. + * \param vs Receives the values from the attribute. + * \return Always returns \c 0. + * \warning Free the returned valueset with slapi_valueset_free() + * when finished using it. + * \see slapi_entry_add_valueset() + * \see slapi_valueset_new() + * \see slapi_valueset_free() + * \see slapi_valueset_init() + * \see slapi_valueset_done() + * \see slapi_valueset_add_value() + * \see slapi_valueset_first_value() + * \see slapi_valueset_next_value() + * \see slapi_valueset_count() + */ int slapi_attr_get_valueset(const Slapi_Attr *a, Slapi_ValueSet **vs); -/* Make the valuset in Slapi_Attr be *vs--not a copy */ + +/** + * Sets the valueset in an attribute. + * + * Intializes a valueset in a \c Slapi_Attr structure from a specified + * \c Slapi_ValueSet structure. The valueset in the \c Slapi_Attr + * will be \c vs, not a copy. + * + * \param a The attribute to set the valueset in. + * \param vs The valueset that you want to set in the attribute. + * \return Always returns \c 0. + * \warning Do not free \c vs. Ownership of \c vs is tranferred to + * the attribute. + * \see slapi_valueset_set_valueset() + */ int slapi_attr_set_valueset(Slapi_Attr *a, const Slapi_ValueSet *vs); + +/** + * Set the attribute type of an attribute. + * + * \param a The attribute whose type you want to set. + * \param type The attribute type you want to set. + * \return \c 0 if the type was set. + * \return \c -1 if the type was not set. + * \warning The passed in type is copied, so ownership of \c type + * remains with the caller. + * \see slapi_attr_get_type() + */ int slapi_attr_set_type(Slapi_Attr *a, const char *type); + +/** + * Copy the values from an attribute into a berval array. + * + * \param a Attribute that contains the desired values. + * \param vals Pointer to an array of berval structure pointers to + * hold the desired values. + * \return \c 0 if values are found. + * \return \c -1 if \c NULL. + * \warning You should free the array using ber_bvecfree() from the + * Mozilla LDAP C SDK. + */ int slapi_attr_get_bervals_copy( Slapi_Attr *a, struct berval ***vals ); + +/** + * Normalize an attribute type. + * + * The attribute type will be looked up in the defined syntaxes to + * get the normalized form. If it is not found, the passed in type + * will be normalized. + * + * \param s The attribute type that you want to normalize. + * \return A normalized copy of the passed in attribute type. + * \warning You should free the returned string using slapi_ch_free_string(). + * \see slapi_ch_free_string() + */ char * slapi_attr_syntax_normalize( const char *s ); -void slapi_valueset_set_valueset(Slapi_ValueSet *vs1, const Slapi_ValueSet *vs2); -void slapi_valueset_set_from_smod(Slapi_ValueSet *vs, Slapi_Mod *smod); /* * value routines */ +/** + * Create a new empty \c Slapi_Value structure. + * + * \return A pointer to the newly allocated \c Slapi_Value structure. + * \warning If space can not be allocated, the \c ns-slapd program terminates. + * \warning When you are no longer using the value, free it from memory + * by calling slapi_value_free() + * \see slapi_value_free() + * \see slapi_value_dup() + * \see slapi_value_new_berval() + * \see slapi_value_new_string() + * \see slapi_value_new_string_passin() + */ Slapi_Value *slapi_value_new( void ); + +/** + * Create a new \c Slapi_value structure and initialize it's value. + * + * \param bval Pointer to the \c berval structure used to initialize + * the newly allocated \c Slapi_value. + * \return A pointer to the newly allocated and initialized value. + * \warning The passed in \c berval structure will be copied. Ownership + * of \c bval remains with the caller. + * \warning If space can not be allocated, the \c ns-slapd program terminates. + * \warning When you are no longer using the value, free it from memory + * by calling slapi_value_free() + * \see slapi_value_free() + * \see slapi_value_new() + * \see slapi_value_new_string() + * \see slapi_value_new_string_passin() + * \see slapi_value_dup() + */ Slapi_Value *slapi_value_new_berval(const struct berval *bval); + +/** + * Duplicate a \c Slapi_Value structure. + * + * \param v The value to duplicate. + * \return A pointer to the copy of the value. + * \warning If space can not be allocated, the \c ns-slapd program terminates. + * \warning When you are no longer using the value, free it from memory + * by calling slapi_value_free() + * \warning This function is identical to slapi_value_dup(). + * \see slapi_value_dup() + * \see slapi_value_free() + */ Slapi_Value *slapi_value_new_value(const Slapi_Value *v); + +/** + * Create a new \c Slapi_value structure and initialize it's value. + * + * \param s A \c NULL terminated string used to initialize + * the newly allocated \c Slapi_value. + * \return A pointer to the newly allocated and initialized value. + * \warning The passed in string will be copied. Ownership of \c s + * remains with the caller. + * \warning If space can not be allocated, the \c ns-slapd program terminates. + * \warning When you are no longer using the value, free it from memory + * by calling slapi_value_free() + * \see slapi_value_free() + * \see slapi_value_new() + * \see slapi_value_new_berval() + \see slapi_value_new_string_passin() + * \see slapi_value_dup() + */ Slapi_Value *slapi_value_new_string(const char *s); + +/** + * Create a new \c Slapi_value structure and initialize it's value. + * + * \param s A \c NULL terminated string used to initialize + * the newly allocated \c Slapi_value. + * \return A pointer to the newly allocated and initialized value. + * \warning The passed in string will be used directly as the value. + * It will not be copied. Ownership of \c s is transferred + * to the new \c Slapi_Value structure, so it should not be + * freed by the caller. + * \warning If space can not be allocated, the \c ns-slapd program terminates. + * \warning When you are no longer using the value, free it from memory + * by calling slapi_value_free() + * \see slapi_value_free() + * \see slapi_value_new() + * \see slapi_value_new_berval() + * \see slapi_value_new_string() + * \see slapi_value_dup() + */ Slapi_Value *slapi_value_new_string_passin(char *s); + +/** + * Initialize a \c Slapi_Value structure. + * + * All fields of the passed in \c Slapi_Value will be reset to zero. + * + * \param v The value to initialize. + * \return A pointer to the initialized value. + * \warning The passed in value must not be \c NULL. + * \see slapi_value_init_berval() + * \see slapi_value_init_string() + * \see slapi_value_init_string_passin() + */ Slapi_Value *slapi_value_init(Slapi_Value *v); + +/** + * Initialize a \c Slapi_Value structure from the value contained in a \c berval structure. + * + * \param v The value to initialize. + * \param bval The \c berval structure to be used to intialize the value. + * \return A pointer to the initialized value. + * \warning The passed in \c Slapi_Value must not be \c NULL. + * \warning The content of the \c berval structure is duplicated. It is up + * to the caller to manage the memory used by the \c berval. + * \see slapi_value_init() + * \see slapi_value_init_string() + * \see slapi_value_init_string_passin() + */ Slapi_Value *slapi_value_init_berval(Slapi_Value *v, struct berval *bval); + +/** + * Initialize a \c Slapi_Value with a copy of the value contained in a string. + * + * \param v The value to initialize. + * \param s The null-terminated string to be used to initialize the value. + * \return A pointer to the initialized value. + * \warning The passed in \c Slapi_Value must not be \c NULL. + * \warning The passed in string is duplicated. It is up to the caller to + * manage the memory used by the passed in string. + * \see slapi_value_init() + * \see slapi_value_init_berval() + * \see slapi_value_init_string_passin() + */ Slapi_Value *slapi_value_init_string(Slapi_Value *v,const char *s); + +/* Initialize a \c Slapi_Value with the value contained in a string. + * + * \param v The value to initialize. + * \param s The null-terminated string to be used to initialize the value. + * \return A pointer to the initialized value. + * \warning The passed in \c Slapi_Value must not be \c NULL. + * \warning The passed in string is not duplicated. Responsibility for the + * memory used by the string is handed over to the \c Slapi_Value + * structure. + * \warning The passed in string must not be freed. It will be freed when + * the \c Slapi_Value structure is freed by calling \c slapi_value_free(). + * \see slapi_value_free() + * \see slapi_value_init() + * \see slapi_value_init_berval() + * \see slapi_value_init_string() + */ Slapi_Value *slapi_value_init_string_passin(Slapi_Value *v, char *s); + +/** + * Duplicate a \c Slapi_Value structure. + * + * \param v The value to duplicate. + * \return A pointer to the copy of the value. + * \warning If space can not be allocated, the \c ns-slapd program terminates. + * \warning When you are no longer using the value, free it from memory + * by calling slapi_value_free() + * \warning This function is identical to slapi_value_new_value(). + * \see slapi_value_new_value() + * \see slapi_value_free() + */ Slapi_Value *slapi_value_dup(const Slapi_Value *v); + +/** + * Sets the flags in a \c Slapi_Value structure. + * + * Valid flags are: + * \arg #SLAPI_ATTR_FLAG_NORMALIZED + * + * \param v Pointer to the \c Slapi_Value structure for which to + * set the flags. + * \param flags The flags you want to set. + * \warning The flags support bit-wise operations. + * \see slapi_values_set_flags() + * \see slapi_value_get_flags() + */ void slapi_value_set_flags(Slapi_Value *v, unsigned long flags); + +/** + * Sets the flags in an array of \c Slapi_Value structures. + * + * Valid flags are: + * \arg #SLAPI_ATTR_FLAG_NORMALIZED + * + * \param vs Pointer to the \c Slapi_Value array for which you + * want to set the flags. + * \param flags The flags you want to set. + * \warning The flags support bit-wise operations. + * \see slapi_value_set_flags() + * \see slapi_value_get_flags() + */ void slapi_values_set_flags(Slapi_Value **vs, unsigned long flags); + +/** + * Retrieves the flags from a \c Slapi_Value structure. + * + * \param v Pointer to the \c Slapi_Value structure from which the + * flags are to be retrieved. + * \return The flags that are set in the value. + * \see slapi_value_set_flags() + * \see slapi_values_set_flags() + */ unsigned long slapi_value_get_flags(Slapi_Value *v); + +/** + * Frees a \c Slapi_Value structure from memory. + * + * The contents of the value will be freed along with the \c Slapi_Value + * structure itself. The pointer will also be set to \c NULL. + * + * \param value Address of the pointer to the \c Slapi_Value structure + * you wish to free. + * \see slapi_value_new() + */ void slapi_value_free(Slapi_Value **value); + +/** + * Gets the \c berval structure of the value. + * + * \param value Pointer to the \c Slapi_Value of which you wish + * to get the \c berval. + * \return A pointer to the \c berval structure contained in the + * \c Slapi_Value. + * \warning The returned pointer point to the actual \c berval structure + * inside of the value, not a copy. + * \warning You should not free the returned \c berval structure unless + * you plan to replace it by calling \c slapi_value_set_berval(). + * \see slapi_value_set_berval() + */ const struct berval *slapi_value_get_berval( const Slapi_Value *value ); + +/** + * Sets the value of a \c Slapi_Value structure from a \c berval structure. + * + * The value is duplicated from the passed in \c berval structure. + * + * \param value Pointer to the \c Slapi_Value structure in which to + * set the value. + * \param bval Pointer to the \c berval value to be copied. + * \return Pointer to the \c Slapi_Value structure passed in as \c value. + * \return NULL if the passed in value was \c NULL. + * \warning If the pointer to the \c Slapi_Value structure is \c NULL, + * nothing is done, and the function returns \c NULL. + * \warning If the \c Slapi_Value structure already contains a value, it + * is freed from memory before the new one is set. + * \warning When you are no longer using the \c Slapi_Value structure, you + * should free it from memory by valling \c slapi_value_free(). + * \see slapi_value_free() + * \see slapi_value_get_berval() + */ Slapi_Value *slapi_value_set_berval( Slapi_Value *value, const struct berval *bval ); + +/** + * Sets the value of a \c Slapi_Value structure from another \c Slapi_Value structure. + * + * The value is duplicated from the supplied \c Slapi_value structure. + * + * \param value Pointer to the \c Slapi_Value structure in which to set + * the value. + * \param vfrom Pointer to the \c Slapi_Value structure from which to + * get the value. + * \return Pointer to the \c Slapi_Value structure passed as the \c value paramter. + * \return \c NULL if the \c value parameter was \c NULL. + * \warning The \c vfrom parameter must not be \c NULL. + * \warning If the pointer to the \c Slapi_Value structure is \c NULL, + * nothing is done, and the function returns \c NULL. + * \warning If the \c Slapi_Value structure already contains a value, it + * is freed from memory before the new one is set. + * \warning When you are no longer using the \c Slapi_Value structure, you + * should free it from memory by valling \c slapi_value_free(). + * \see slapi_value_free() + */ Slapi_Value *slapi_value_set_value( Slapi_Value *value, const Slapi_Value *vfrom); + +/** + * Sets the value of a \c Slapi_Value structure. + * + * The value is a duplicate of the data pointed to by \c val and the + * length \c len. + * + * \param value Pointer to the \c Slapi_Value structure in which to set + * the value. + * \param val Pointer to the value. + * \param len Length of the value. + * \return Pointer to the \c Slapi_Value structure with the value set. + * \return \c NULL if the supplied \c Slapi_Value is \c NULL. + * \warning If the pointer to the \c Slapi_Value structure is \c NULL, + * nothing is done, and the function returns \c NULL. + * \warning If the \c Slapi_Value structure already contains a value, it + * is freed from memory before the new one is set. + * \warning When you are no longer using the \c Slapi_Value structure, you + * should free it from memory by valling \c slapi_value_free(). + * \see slapi_value_free() + */ Slapi_Value *slapi_value_set( Slapi_Value *value, void *val, unsigned long len); + +/** + * Sets the value of a \c Slapi_Value structure from a string. + * + * The value is duplicated from a supplied string. + * + * \param value Pointer to the \c Slapi_Value structure in which to set + * the value. + * \param strVal The string containing the value to set. + * \return \c 0 if the value is set. + * \return \c -1 if the pointer to the \c Slapi_Value is \c NULL. + * \warning If the pointer to the \c Slapi_Value structure is \c NULL, + * nothing is done, and the function returns \c -1. + * \warning If the \c Slapi_Value structure already contains a value, it + * is freed from memory before the new one is set. + * \warning When you are no longer using the \c Slapi_Value structure, you + * should free it from memory by valling \c slapi_value_free(). + * \see slapi_value_free() + * \see slapi_value_set_string_passin() + */ int slapi_value_set_string(Slapi_Value *value, const char *strVal); + +/** + * Sets the value of a \c Slapi_Value structure from a string. + * + * The supplied string is used as the value within the \c Slapi_Value + * structure. + * + * \param value Pointer to the \c Slapi_Value structure in which to set + * the value. + * \param strVal The string containing the value to set. + * \return \c 0 if the value is set. + * \return \c -1 if the pointer to the \c Slapi_Value is \c NULL. + * \warning Do not free the passed in string pointer to by \c strVal. + * Responsibility for the memory used by the string is handed + * over to the \c Slapi_Value structure. + * \warning When you are no longer using the \c Slapi_Value structure, you + * should free it from memory by valling \c slapi_value_free(). + * \see slapi_value_free() + * \see slapi_value_set_string() + */ int slapi_value_set_string_passin(Slapi_Value *value, char *strVal); + +/** + * Sets the value of a \c Slapi_Value structure from an integer. + * + * \param value Pointer to the \c Slapi_Value structure in which to set + * the value. + * \param intVal The integer containing the value to set. + * \return \c 0 if the value is set. + * \return \c -1 if the pointer to the \c Slapi_Value is \c NULL. + * \warning If the pointer to the \c Slapi_Value structure is \c NULL, + * nothing is done, and the function returns \c -1. + * \warning If the \c Slapi_Value structure already contains a value, it + * is freed from memory before the new one is set. + * \warning When you are no longer using the \c Slapi_Value structure, you + * should free it from memory by valling \c slapi_value_free(). + * \see slapi_value_free() + */ int slapi_value_set_int(Slapi_Value *value, int intVal); + +/** + * Retrieves the value of a \c Slapi_Value structure as a string. + * + * \param value Pointer to the value you wish to get as a string. + * \return A string containing the value. + * \return \c NULL if there is no value. + * \warning The returned string is the actual value, not a copy. You + * should not free the returned string unless you plan to + * replace it by calling slapi_value_set_string(). + * \see slapi_value_set_string() + */ const char*slapi_value_get_string(const Slapi_Value *value); + +/** + * Retrieves the value of a \c Slapi_Value structure as an integer. + * + * \param value Pointer to the value you wish to get as an integer. + * \return An integer that corresponds to the value stored in the + * \c Slapi_Value structure. + * \return \c 0 if there is no value. + * \see slapi_value_get_uint() + * \see slapi_value_get_long() + * \see slapi_value_get_ulong() + * \see slapi_value_get_longlong() + * \see slapi_value_get_ulonglong() + */ int slapi_value_get_int(const Slapi_Value *value); + +/** + * Retrieves the value of a \c Slapi_Value structure as an unsigned integer. + * + * \param value Pointer to the value you wish to get as an unsigned integer. + * \return An unsigned integer that corresponds to the value stored in + * the \c Slapi_Value structure. + * \return \c 0 if there is no value. + * \see slapi_value_get_int() + * \see slapi_value_get_long() + * \see slapi_value_get_ulong() + * \see slapi_value_get_longlong() + * \see slapi_value_get_ulonglong() + */ unsigned int slapi_value_get_uint(const Slapi_Value *value); + +/** + * Retrieves the value of a \c Slapi_Value structure as a long integer. + * + * \param value Pointer to the value you wish to get as a long integer. + * \return A long integer that corresponds to the value stored in the + * \c Slapi_Value structure. + * \return \c 0 if there is no value. + * \see slapi_value_get_int() + * \see slapi_value_get_uint() + * \see slapi_value_get_ulong() + * \see slapi_value_get_longlong() + * \see slapi_value_get_ulonglong() + */ long slapi_value_get_long(const Slapi_Value *value); + +/** + * Retrieves the value of a \c Slapi_Value structure as an unsigned long integer. + * + * \param value Pointer to the value you wish to get as an unsigned long integer. + * \return An unsigned long integer that corresponds to the value stored in the + * \c Slapi_Value structure. + * \return \c 0 if there is no value. + * \see slapi_value_get_int() + * \see slapi_value_get_uint() + * \see slapi_value_get_long() + * \see slapi_value_get_longlong() + * \see slapi_value_get_ulonglong() + */ unsigned long slapi_value_get_ulong(const Slapi_Value *value); + +/** + * Retrieves the value of a \c Slapi_Value structure as a long long integer. + * + * \param value Pointer to the value you wish to get as a long long integer. + * \return A long long integer that corresponds to the value stored in the + * \c Slapi_Value structure. + * \return \c 0 if there is no value. + * \see slapi_value_get_int() + * \see slapi_value_get_uint() + * \see slapi_value_get_long() + * \see slapi_value_get_ulong() + * \see slapi_value_get_ulonglong() + */ long long slapi_value_get_longlong(const Slapi_Value *value); + +/** + * Retrieves the value of a \c Slapi_Value structure as an unsigned long long integer. + * + * \param value Pointer to the value you wish to get as an unsigned long long integer. + * \return An unsigned long long integer that corresponds to the value stored in the + * \c Slapi_Value structure. + * \return \c 0 if there is no value. + * \see slapi_value_get_int() + * \see slapi_value_get_uint() + * \see slapi_value_get_long() + * \see slapi_value_get_ulong() + * \see slapi_value_get_longlong() + */ unsigned long long slapi_value_get_ulonglong(const Slapi_Value *value); + +/** + * Gets the length of a value contained in a \c Slapi_Value structure. + * + * \param value Pointer to the value of which you wish to get the length. + * \return The length of the value. + * \return \c 0 if there is no value. + */ size_t slapi_value_get_length(const Slapi_Value *value); + +/** + * Compares two \c Slapi_Value structures + * + * The matching rule associated with the supplied attribute \c a is used + * to compare the two values. + * + * \param a A pointer to an attribute used to determine how the + * two values will be compared. + * \param v1 Pointer to the \c Slapi_Value structure containing the first + * value to compare. + * \param v2 Pointer to the \c Slapi_Value structure containing the second + * value to compare. + * \return \c 0 if the two values are equal. + * \return \c -1 if \c v1 is smaller than \c v2. + * \return \c 1 if \c v1 is greater than \c v2. + */ int slapi_value_compare(const Slapi_Attr *a,const Slapi_Value *v1,const Slapi_Value *v2); /* * Valueset functions. */ + +/** + * Flag that indicates that the value should be used by reference. + * + * \see slapi_valueset_add_value_ext() + */ #define SLAPI_VALUE_FLAG_PASSIN 0x1 #define SLAPI_VALUE_FLAG_IGNOREERROR 0x2 #define SLAPI_VALUE_FLAG_PRESERVECSNSET 0x4 #define SLAPI_VALUE_FLAG_USENEWVALUE 0x8 /* see valueset_remove_valuearray */ +/** + * Creates an empty \c Slapi_ValueSet structure. + * + * \return Pointer to the newly allocated \c Slapi_ValueSet structure. + * \warning If no space can be allocated (for example, if no more virtual + * memory exists), the \c ns-slapd program terminates. + * \warning When you are no longer using the valueset, you should free it + * from memory by calling \c slapi_valueset_free(). + * \see slapi_valueset_free() + */ Slapi_ValueSet *slapi_valueset_new( void ); + +/** + * Free a \c Slapi_ValueSet structure from memory. + * + * Call this function when you are done working with the structure. + * All members of the valueset will be freed as well if they are not + * \c NULL. + * + * \param vs Pointer to the \c Slapi_ValueSet to free. + * \see slapi_valueset_done() + */ void slapi_valueset_free(Slapi_ValueSet *vs); + +/** + * Initializes a \c Slapi_ValueSet structure. + * + * All values inside of the structure will be cleared (set to \c 0). + * The values will not be freed by this function. To free the values + * first, call \c slapi_valueset_done(). + * + * \param vs Pointer to the \c Slapi_ValueSet to initialize. + * \warning When you are no longer using the \c Slapi_ValueSet structure, + * you should free it from memory by calling \c slapi_valueset_free(). + * \see slapi_valueset_done() + * \see slapi_valueset_free() + */ void slapi_valueset_init(Slapi_ValueSet *vs); + +/** + * Frees the values contained in a \c Slapi_ValueSet structure. + * + * \param vs Pointer to the \c Slapi_ValueSet structure from which + * you want to free its values. + * \warning Use this function when you are no longer using the values + * but you want to re-use the \c Slapi_ValueSet structure for + * a new set of values. + * \see slapi_valueset_init() + */ void slapi_valueset_done(Slapi_ValueSet *vs); + +/** + * Adds a value to a \c Slapi_ValueSet structure. + * + * \param vs Pointer to the \c Slapi_ValueSet structure to which to + * add the value. + * \param addval Pointer to the \c Slapi_Value structure to add to + * the \c Slapi_ValueSet. + * \warning The value is duplicated from the \c Slapi_Value structure, + * which can be freed frmo memory without altering the + * \c Slapi_ValueSet structure. + * \warning This function does not verify if the value is already present + * in the \c Slapi_ValueSet structure. You can manually check + * this using \c slapi_valueset_first_value() and + * \c slapi_valueset_next_value(). + * \see slapi_valueset_first_value() + * \see slapi_valueset_next_value() + */ void slapi_valueset_add_value(Slapi_ValueSet *vs, const Slapi_Value *addval); + +/** + * Adds a value to a \c Slapi_ValueSet structure with optional flags. + * + * This function is similar to \c slapi_valueset_add_value(), but it + * allows optional flags to be specified to allow the new value to be + * used by reference. + * + * \param vs Pointer to the \c Slapi_ValueSet structure to which to + * add the value. + * \param addval Pointer to the \c Slapi_Value structure to add to + * the \c Slapi_ValueSet. + * \param flags If #SLAPI_VALUE_FLAG_PASSIN bit is set in the flags, + * the function will take over the ownership of the new value + * to be added without duplicating it. + * \warning This function does not verify if the value is already present + * in the \c Slapi_ValueSet structure. You can manually check + * this using \c slapi_valueset_first_value() and + * \c slapi_valueset_next_value(). + * \see slapi_valueset_add_value() + * \see slapi_valueset_first_value() + * \see slapi_valueset_next_value() + */ void slapi_valueset_add_value_ext(Slapi_ValueSet *vs, Slapi_Value *addval, unsigned long flags); + +/** + * Gets the first value in a \c Slapi_ValueSet structure. + * + * This function can be used with \c slapi_valueset_next_value() to + * iterate through all values in a \c Slapi_ValueSet structure. + * + * \param vs Pointer to the \c Slapi_ValueSet structure from which + * you wish to get the value. + * \param v Address of the pointer to the \c Slapi_Value structure + * for the returned value. + * \return The index of the value in the Slapi_ValueSet structure. + * \return \c -1 if there was no value. + * \warning This function gives a pointer to the actual value within + * the \c Slapi_ValueSet structure. You should not free it + * from memory. + * \warning You will need to pass this index to slapi_valueset_next_value() + * if you wish to iterate through all values in the valueset. + * \see slapi_valueset_next_value(). + */ int slapi_valueset_first_value( Slapi_ValueSet *vs, Slapi_Value **v ); + +/** + * Gets the next value in a \c Slapi_ValueSet structure. + * + * This is part of a pair of iterator functions. It should be + * called after first calling \c slapi_valueset_first_value(). + * + * \param vs Pointer to the \c Slapi_ValueSet structure from which + * you wish to get the value. + * \param index Value returned by the previous call to \c slapi_valueset_first_value() + * or \c slapi_valueset_next_value(). + * \param v Address of the pointer to the \c Slapi_Value structure + * for the returned value. + * \return The index of the value in the Slapi_ValueSet structure. + * \return \c -1 if there was no value. + * \warning This function gives a pointer to the actual value within + * the \c Slapi_ValueSet structure. You should not free it + * from memory. + * \warning You will need to pass this index to slapi_valueset_next_value() + * if you wish to iterate through all values in the valueset. + * \see slapi_valueset_first_value() + */ int slapi_valueset_next_value( Slapi_ValueSet *vs, int index, Slapi_Value **v); + +/** + * Returns the number of values contained in a \c Slapi_ValueSet structure. + * + * \param vs Pointer to the \c Slapi_ValueSet structure of which + * you wish to get the count. + * \return The number of values contained in the \c Slapi_ValueSet structure. + */ int slapi_valueset_count( const Slapi_ValueSet *vs); + +/** + * Initializes a \c Slapi_ValueSet with copies of the values of a \c Slapi_Mod structure. + * + * \param vs Pointer to the \c Slapi_ValueSet structure into which + * you wish to copy the values. + * \param smod Pointer to the \c Slapi_Mod structure from which you + * want to copy the values. + * \warning This function does not verify that the \c Slapi_ValueSet + * structure already contains values, so it is your responsibility + * to verify that there are no values prior to calling this function. + * If you do not verify this, the allocated memory space will leak. + * You can free existing values by calling slapi_valueset_done(). + * \see slapi_valueset_done() + */ void slapi_valueset_set_from_smod(Slapi_ValueSet *vs, Slapi_Mod *smod); + +/** + * Initializes a \c Slapi_ValueSet with copies of the values of another \c Slapi_ValueSet. + * + * \param vs1 Pointer to the \c Slapi_ValueSet structure into which + * you wish to copy the values. + * \param vs2 Pointer to the \c Slapi_ValueSet structure from which + * you want to copy the values. + * \warning This function does not verify that the \c Slapi_ValueSet + * structure already contains values, so it is your responsibility + * to verify that there are no values prior to calling this function. + * If you do not verify this, the allocated memory space will leak. + * You can free existing values by calling slapi_valueset_done(). + * \see slapi_valueset_done() + */ void slapi_valueset_set_valueset(Slapi_ValueSet *vs1, const Slapi_ValueSet *vs2); + +/** + * Finds a requested value in a valueset. + * + * The syntax of a supplied attribute will be used to compare the values. + * This function can be used to check for duplicate values in a valueset. + * + * \param a Pointer to the attribute. This is used to determine the + * syntax of the values and how to match them. + * \param vs Pointer to the \c Slapi_ValueSet structure from which + * you wish to find the value. + * \param v Pointer to the \c Slapi_Value structure containing the + * value that you wish to find. + * \return Pointer to the value in the valueset if the value was found. + * \return \c NULL if the value was not found. + * \warning The returned pointer points to the actual value in the + * \c Slapi_ValueSet structure. It should not be freed. + */ Slapi_Value *slapi_valueset_find(const Slapi_Attr *a, const Slapi_ValueSet *vs, const Slapi_Value *v); +/* TODO - Pickup Doxygen work here */ /* * operation routines */
0
e6eab21920a0374eb356da3d1f041312c6857ecd
389ds/389-ds-base
Ticket #47523 - Set up replcation/agreement before initializing the sub suffix, the sub suffix is not found by ldapsearch Bug description: If a replication is configured against a backend before initializing the backend with a suffix entry, an RUV entry is inserted first with the entryid 1. The RUV entry's entryrdn is added to the entryrdn index with a suffix entry which is a parent entry of the RUV entry having a temporary entryid 0, which was to be replaced with the real entryid when the real suffix entry is added. But the replacement code was not executed. Fix description: When a real suffix is added to the entryrdn index, it returns DB_KEYEXIST, which used to be ignored by resetting 0 (== SUCCESS). This patch returns DB_KEYEXIST to the caller and let _entryrdn_insert_key use the info to replace the temporary entryid with the real one. The error code is ignored by the other callers. https://fedorahosted.org/389/ticket/47523 Reviewed by nkinder (Thanks!).
commit e6eab21920a0374eb356da3d1f041312c6857ecd Author: Noriko Hosoi <[email protected]> Date: Thu Sep 26 09:18:11 2013 -0700 Ticket #47523 - Set up replcation/agreement before initializing the sub suffix, the sub suffix is not found by ldapsearch Bug description: If a replication is configured against a backend before initializing the backend with a suffix entry, an RUV entry is inserted first with the entryid 1. The RUV entry's entryrdn is added to the entryrdn index with a suffix entry which is a parent entry of the RUV entry having a temporary entryid 0, which was to be replaced with the real entryid when the real suffix entry is added. But the replacement code was not executed. Fix description: When a real suffix is added to the entryrdn index, it returns DB_KEYEXIST, which used to be ignored by resetting 0 (== SUCCESS). This patch returns DB_KEYEXIST to the caller and let _entryrdn_insert_key use the info to replace the temporary entryid with the real one. The error code is ignored by the other callers. https://fedorahosted.org/389/ticket/47523 Reviewed by nkinder (Thanks!). diff --git a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c index 22940cce5..d381166ed 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c @@ -748,7 +748,7 @@ entryrdn_rename_subtree(backend *be, renamedata.data = (void *)newelem; renamedata.flags = DB_DBT_USERMEM; rc = _entryrdn_put_data(cursor, &key, &renamedata, RDN_INDEX_SELF, db_txn); - if (rc) { + if (rc && (DB_KEYEXIST != rc)) { /* failed && ignore already exists */ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG, "entryrdn_rename_subtree: Adding %s failed; " "%s(%d)\n", keybuf, dblayer_strerror(rc), rc); @@ -769,7 +769,7 @@ entryrdn_rename_subtree(backend *be, renamedata.flags = DB_DBT_USERMEM; rc = _entryrdn_put_data(cursor, &key, &renamedata, RDN_INDEX_CHILD, db_txn); - if (rc) { + if (rc && (DB_KEYEXIST != rc)) { /* failed && ignore already exists */ goto bail; } } @@ -814,7 +814,7 @@ entryrdn_rename_subtree(backend *be, renamedata.data = (void *)newsupelem; } rc = _entryrdn_put_data(cursor, &key, &renamedata, RDN_INDEX_PARENT, db_txn); - if (rc) { + if (rc && (DB_KEYEXIST != rc)) { /* failed && ignore already exists */ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG, "entryrdn_rename_subtree: Adding " "%s failed; %s(%d)\n", @@ -849,7 +849,7 @@ entryrdn_rename_subtree(backend *be, renamedata.data = (void *)newelem; renamedata.flags = DB_DBT_USERMEM; rc = _entryrdn_put_data(cursor, &key, &renamedata, RDN_INDEX_SELF, db_txn); - if (rc) { + if (rc && (DB_KEYEXIST != rc)) { /* failed && ignore already exists */ slapi_log_error(ENTRYRDN_LOGLEVEL(rc), ENTRYRDN_TAG, "entryrdn_rename_subtree: Adding %s failed; " "%s(%d)\n", keybuf, dblayer_strerror(rc), rc); @@ -902,7 +902,7 @@ entryrdn_rename_subtree(backend *be, renamedata.flags = DB_DBT_USERMEM; } rc = _entryrdn_put_data(cursor, &key, &renamedata, RDN_INDEX_CHILD, db_txn); - if (rc) { + if (rc && (DB_KEYEXIST != rc)) { /* failed && ignore already exists */ goto bail; } } @@ -1955,12 +1955,11 @@ _entryrdn_put_data(DBC *cursor, DBT *key, DBT *data, char type, DB_TXN *db_txn) rc = cursor->c_put(cursor, key, data, DB_NODUPDATA); if (rc) { if (DB_KEYEXIST == rc) { - /* this is okay */ + /* this is okay, but need to return DB_KEYEXIST to caller */ slapi_log_error(SLAPI_LOG_BACKLDBM, ENTRYRDN_TAG, "_entryrdn_put_data: The same key (%s) and the " "data exists in index\n", (char *)key->data); - rc = 0; break; } else { char *keyword = NULL; @@ -2109,7 +2108,7 @@ _entryrdn_insert_key_elems(backend *be, /* adding RDN to the child key */ rc = _entryrdn_put_data(cursor, key, &adddata, RDN_INDEX_CHILD, db_txn); keybuf = key->data; - if (rc) { /* failed */ + if (rc && (DB_KEYEXIST != rc)) { /* failed && ignore already exists */ goto bail; } @@ -2125,7 +2124,7 @@ _entryrdn_insert_key_elems(backend *be, key->flags = DB_DBT_USERMEM; rc = _entryrdn_put_data(cursor, key, &adddata, RDN_INDEX_SELF, db_txn); - if (rc) { /* failed */ + if (rc && (DB_KEYEXIST != rc)) { /* failed && ignore already exists */ goto bail; } @@ -2145,6 +2144,9 @@ _entryrdn_insert_key_elems(backend *be, adddata.flags = DB_DBT_USERMEM; /* adding RDN to the self key */ rc = _entryrdn_put_data(cursor, key, &adddata, RDN_INDEX_PARENT, db_txn); + if (DB_KEYEXIST == rc) { /* failed && ignore already exists */ + rc = 0; + } /* Succeeded or failed, it's done. */ bail: slapi_ch_free_string(&keybuf); @@ -2268,7 +2270,7 @@ _entryrdn_replace_suffix_id(DBC *cursor, DBT *key, DBT *adddata, /* Add it back */ rc = _entryrdn_put_data(cursor, &realkey, &moddata, RDN_INDEX_CHILD, db_txn); - if (rc) { + if (rc && (DB_KEYEXIST != rc)) { /* failed && ignore already exists */ goto bail0; } if (curr_childnum + 1 == childnum) { @@ -2531,7 +2533,7 @@ _entryrdn_insert_key(backend *be, slapi_ch_free_string(&dn); goto bail; } - elem = _entryrdn_new_rdn_elem(be, 0 /*fake id*/, tmpsrdn, &len); + elem = _entryrdn_new_rdn_elem(be, TMPID, tmpsrdn, &len); if (NULL == elem) { char *dn = NULL; slapi_rdn_get_dn(tmpsrdn, &dn); @@ -2551,12 +2553,13 @@ _entryrdn_insert_key(backend *be, rc = _entryrdn_get_elem(cursor, &key, &data, nrdn, &elem); if (rc) { const char *myrdn = slapi_rdn_get_nrdn(srdn); - const char *ep = NULL; + const char **ep = NULL; int isexception = 0; /* Check the RDN is in the exception list */ - for (ep = *rdn_exceptions; ep && *ep; ep++) { - if (!strcmp(ep, myrdn)) { + for (ep = rdn_exceptions; ep && *ep; ep++) { + if (!strcmp(*ep, myrdn)) { isexception = 1; + break; } } @@ -2636,7 +2639,7 @@ _entryrdn_insert_key(backend *be, goto bail; } } - elem = _entryrdn_new_rdn_elem(be, 0 /*fake id*/, tmpsrdn, &len); + elem = _entryrdn_new_rdn_elem(be, TMPID, tmpsrdn, &len); if (NULL == elem) { char *dn = NULL; slapi_rdn_get_dn(tmpsrdn, &dn); @@ -2891,7 +2894,7 @@ _entryrdn_delete_key(backend *be, slapi_ch_free_string(&dn); goto bail; } - elem = _entryrdn_new_rdn_elem(be, 0 /*fake id*/, tmpsrdn, &len); + elem = _entryrdn_new_rdn_elem(be, TMPID, tmpsrdn, &len); if (NULL == elem) { char *dn = NULL; slapi_rdn_get_dn(tmpsrdn, &dn); @@ -3134,7 +3137,7 @@ _entryrdn_index_read(backend *be, slapi_ch_free_string(&dn); goto bail; } - *elem = _entryrdn_new_rdn_elem(be, 0 /*fake id*/, tmpsrdn, &len); + *elem = _entryrdn_new_rdn_elem(be, TMPID, tmpsrdn, &len); if (NULL == *elem) { char *dn = NULL; slapi_rdn_get_dn(tmpsrdn, &dn); @@ -3212,7 +3215,7 @@ _entryrdn_index_read(backend *be, goto bail; } } - tmpelem = _entryrdn_new_rdn_elem(be, 0 /*fake id*/, tmpsrdn, &len); + tmpelem = _entryrdn_new_rdn_elem(be, TMPID, tmpsrdn, &len); if (NULL == tmpelem) { char *dn = NULL; slapi_rdn_get_dn(tmpsrdn, &dn);
0
a7a11d6bd8e81bd1b13098848f4d0a39d9912eeb
389ds/389-ds-base
Resolves: bug 248820 Bug Description: quick install failed when login userid doesn't match install user's id Reviewed by: me Fix Description: getlogin returns the _login_ ID which is the initial login id (from utmp). We want the username of the effective user ID, so I just needed to change getLogin to do that. Platforms tested: RHEL4 Flag Day: no Doc impact: no
commit a7a11d6bd8e81bd1b13098848f4d0a39d9912eeb Author: Rich Megginson <[email protected]> Date: Thu Jul 19 00:23:40 2007 +0000 Resolves: bug 248820 Bug Description: quick install failed when login userid doesn't match install user's id Reviewed by: me Fix Description: getlogin returns the _login_ ID which is the initial login id (from utmp). We want the username of the effective user ID, so I just needed to change getLogin to do that. Platforms tested: RHEL4 Flag Day: no Doc impact: no diff --git a/ldap/admin/src/scripts/Util.pm.in b/ldap/admin/src/scripts/Util.pm.in index a4d50d8ac..b6e3e0eae 100644 --- a/ldap/admin/src/scripts/Util.pm.in +++ b/ldap/admin/src/scripts/Util.pm.in @@ -111,8 +111,11 @@ sub isValidServerID { return $servid =~ /^[$validchars]+$/o; } +# we want the name of the effective user id of this process e.g. if someone did +# an su root, we want getLogin to return "root" not the originating id (getlogin) +# in perl, $> is the effective numeric user id - we need to turn it into a string sub getLogin { - return getlogin || (getpwuid($>))[0] || $ENV{USER} || die "Error: could not determine the current user ID: $!"; + return (getpwuid($>))[0] || $ENV{USER} || die "Error: could not determine the current user ID: $!"; } sub isValidUser {
0
15ddba9d71bf6b7ad34be01267e8adaa269e16fd
389ds/389-ds-base
Issue 49122 - Fix rpm build Bug Description: Bytecompiling fails with python3.5 during rpm build on Fedora. Fix Description: Change print statement to print function. https://pagure.io/389-ds-base/issue/49122 Reviewed by: mreynolds (Thanks!)
commit 15ddba9d71bf6b7ad34be01267e8adaa269e16fd Author: Viktor Ashirov <[email protected]> Date: Thu Mar 2 11:14:18 2017 +0100 Issue 49122 - Fix rpm build Bug Description: Bytecompiling fails with python3.5 during rpm build on Fedora. Fix Description: Change print statement to print function. https://pagure.io/389-ds-base/issue/49122 Reviewed by: mreynolds (Thanks!) diff --git a/dirsrvtests/tests/tickets/ticket49122_test.py b/dirsrvtests/tests/tickets/ticket49122_test.py index bd553f2e4..ff1e8d1d0 100644 --- a/dirsrvtests/tests/tickets/ticket49122_test.py +++ b/dirsrvtests/tests/tickets/ticket49122_test.py @@ -52,7 +52,7 @@ def test_ticket49122(topo): if DEBUGGING: # Add debugging steps(if any)... - print "Attach gdb" + print("Attach gdb") time.sleep(20) # Search for the role
0
e5b83f596a2cfd813d9d4c6cb38435d338cf19e6
389ds/389-ds-base
Ticket 47704 - invalid sizelimits in aci group evaluation Bug Description: aci group evaluation fails because of sizelimit exceeded but it is exceeded because it is -1476887876 or another negative integer becasue operation parameter are a union based on operation types and so for otehr than search the value is dependent on the operation params Fix Description: treat any negative integer like -1 (unlimited). A better fix would be to introduce a specific configuration param or to abondon the limit in group evaluation at all. But this could introduce backward compatibility problems and will be handled in ticket 47703 for newer versions https://fedorahosted.org/389/ticket/47704 Reviewed by: Rich, thanks
commit e5b83f596a2cfd813d9d4c6cb38435d338cf19e6 Author: Ludwig Krispenz <[email protected]> Date: Tue Feb 18 11:40:16 2014 +0100 Ticket 47704 - invalid sizelimits in aci group evaluation Bug Description: aci group evaluation fails because of sizelimit exceeded but it is exceeded because it is -1476887876 or another negative integer becasue operation parameter are a union based on operation types and so for otehr than search the value is dependent on the operation params Fix Description: treat any negative integer like -1 (unlimited). A better fix would be to introduce a specific configuration param or to abondon the limit in group evaluation at all. But this could introduce backward compatibility problems and will be handled in ticket 47703 for newer versions https://fedorahosted.org/389/ticket/47704 Reviewed by: Rich, thanks diff --git a/ldap/servers/plugins/acl/acl_ext.c b/ldap/servers/plugins/acl/acl_ext.c index a1ff0739a..91135b79b 100644 --- a/ldap/servers/plugins/acl/acl_ext.c +++ b/ldap/servers/plugins/acl/acl_ext.c @@ -881,6 +881,12 @@ acl_init_aclpb ( Slapi_PBlock *pb, Acl_PBlock *aclpb, const char *ndn, int copy_ slapi_pblock_get( pb, SLAPI_SEARCH_SIZELIMIT, &aclpb->aclpb_max_member_sizelimit ); if ( aclpb->aclpb_max_member_sizelimit == 0 ) { aclpb->aclpb_max_member_sizelimit = SLAPD_DEFAULT_LOOKTHROUGHLIMIT; + } else if ( aclpb->aclpb_max_member_sizelimit < -1 ) { + /* handle the case of a negtive size limit either set or due + * to bug bz1065971. The member size limit should be dropped, + * but for backward compatibility to the best we can + */ + aclpb->aclpb_max_member_sizelimit = -1; } slapi_pblock_get( pb, SLAPI_OPERATION_TYPE, &aclpb->aclpb_optype );
0
164a9591db34bdd86b2bc0ddd79549c69ce4b08d
389ds/389-ds-base
Ticket 49706 - Finish UI patternfly convertions Description: A few modals were not converted to PF, and other minor issues with JS and updating tables https://pagure.io/389-ds-base/issue/49706 Reviewed by: ?
commit 164a9591db34bdd86b2bc0ddd79549c69ce4b08d Author: Mark Reynolds <[email protected]> Date: Tue May 22 17:14:00 2018 -0400 Ticket 49706 - Finish UI patternfly convertions Description: A few modals were not converted to PF, and other minor issues with JS and updating tables https://pagure.io/389-ds-base/issue/49706 Reviewed by: ? diff --git a/src/cockpit/389-console/backend.html b/src/cockpit/389-console/backend.html index 5cff298a9..91e2784c5 100644 --- a/src/cockpit/389-console/backend.html +++ b/src/cockpit/389-console/backend.html @@ -410,6 +410,21 @@ "the available memory space for the DN cache. The DN cache is similar to the entry cache for a database, only its table stores only the entry ID and the entry DN (nsslapd-dncachememsize)."> DN Cache Size (bytes)</label><input class="ds-input" type="text" id="nsslapd-dncachememsize" size="20"/> </div> + + </div> + <div class="ds-divider"></div> + <div class="ds-inline"> + <div> + <input type="checkbox" class="ds-config-checkbox" id="nsslapd-readonly-suffix"><label + for="nsslapd-readonly-suffix" class="ds-label" title="Put database in Read-Only mode (nsslapd-readonly)."> Database Read-Only Mode</label> + </div> + <div> + <input type="checkbox" class="ds-config-checkbox" id="nsslapd-require-index" checked><label + for="nsslapd-require-index" class="ds-label" title="Block unindexed searches on this suffix (nsslapd-require-index)."> Block Unindexed Searches</label> + </div> + </div> + </div> + <div> <hr> <table id="referral-table" class="display ds-referral-table" cellspacing="0" width="100%"> @@ -422,29 +437,17 @@ <tbody id="referral-tbody"> <tr> <td>ldaps://localhost.localdomain.lab.testing.domain.com:636</td> - <td><button class="btn btn-default delete-referral-btn" type="button"><span class="glyphicon glyphicon-trash"></span> Delete</button></td> + <td class='ds-center'><button class="btn btn-default del-ref-btn" type="button"><span class="glyphicon glyphicon-trash"></span> Delete</button></td> </tr> <tr> <td>ldaps://example.fedora.org:636</td> - <td><button class="btn btn-default delete-referral-btn" type="button"><span class="glyphicon glyphicon-trash"></span> Delete</button></td> + <td class='ds-center'><button class="btn btn-default del-ref-btn" type="button"><span class="glyphicon glyphicon-trash"></span> Delete</button></td> </tr> </tbody> </table> <button class="btn btn-default" data-toggle="modal" data-target="#create-ref-form" id="create-ref-btn" type="button">Create Referral</button> <p></p> </div> - </div> - <div class="ds-inline"> - <div> - <input type="checkbox" class="ds-config-checkbox" id="nsslapd-readonly-suffix"><label - for="nsslapd-readonly-suffix" class="ds-label" title="Put database in Read-Only mode (nsslapd-readonly)."> Database Read-Only Mode</label> - </div> - <div> - <input type="checkbox" class="ds-config-checkbox" id="nsslapd-require-index" checked><label - for="nsslapd-require-index" class="ds-label" title="Block unindexed searches on this suffix (nsslapd-require-index)."> Block Unindexed Searches</label> - </div> - </div> - </div> <button class="accordion ds-accordion" id="db-system-index-accordion" type="button">&#9658 Show System Indexes </button> diff --git a/src/cockpit/389-console/banner.html b/src/cockpit/389-console/banner.html index 68ae1a951..14d866fb5 100644 --- a/src/cockpit/389-console/banner.html +++ b/src/cockpit/389-console/banner.html @@ -1,5 +1,5 @@ 389 Directory Server Management <div class="dropdown ds-server-action"> <select class="btn btn-default dropdown ds-dropdown-server" id="select-server"> - </select></div><div class="dropdown ds-float-right"><button class="btn btn-default dropdown-toggle ds-action-btn" + </select></div><div class="dropdown ds-float-right"><button class="btn btn-primary dropdown-toggle ds-action-btn" type="button" id="server-list-menu" data-toggle="dropdown">Actions<span class="caret"></span> </button><ul class="dropdown-menu pull-right" role="menu"> <li role=""><a role="menuitem" id="start-server-btn" href="#">Start Instance</a></li> diff --git a/src/cockpit/389-console/css/ds.css b/src/cockpit/389-console/css/ds.css index fefd56567..5717bbeae 100644 --- a/src/cockpit/389-console/css/ds.css +++ b/src/cockpit/389-console/css/ds.css @@ -165,7 +165,7 @@ .ds-oc-must-buttons { padding 0 !important; padding-left: 3px; - margin-top: 5px; + margin-top: 70px; margin-bottom: 75px; margin-left: 5px; margin-right: 9px; @@ -204,7 +204,7 @@ height: 30px; width: 250px !important; text-align: left; - border-radius: 5px; + /* border-radius: 5px; */ } .ds-passwd-dropdown { @@ -1036,7 +1036,7 @@ Zbutton:focus { .ds-may-must-list { width: 232px !important; - height: 160px !important; + height: 150px !important; margin: 0 !important; padding: 0 !important; } @@ -1110,7 +1110,7 @@ option { .ds-action-btn { margin-left: 10px; margin-right: 0px; - border-radius: 5px !important; + /* border-radius: 5px !important; */ padding: 0px 10px 0px 10px !important; min-height: 30px !important; } @@ -1350,3 +1350,7 @@ option { margin-left: 10px; margin-top: -2px; } + +.ds-suffix-cfg-div { + min-width: 500px; +} diff --git a/src/cockpit/389-console/fonts/OpenSans-Bold-webfont.woff2 b/src/cockpit/389-console/fonts/OpenSans-Bold-webfont.woff2 new file mode 100644 index 000000000..34aac6f3c Binary files /dev/null and b/src/cockpit/389-console/fonts/OpenSans-Bold-webfont.woff2 differ diff --git a/src/cockpit/389-console/fonts/OpenSans-Italic-webfont.woff2 b/src/cockpit/389-console/fonts/OpenSans-Italic-webfont.woff2 new file mode 100644 index 000000000..9a96c63fa Binary files /dev/null and b/src/cockpit/389-console/fonts/OpenSans-Italic-webfont.woff2 differ diff --git a/src/cockpit/389-console/fonts/PatternFlyIcons-webfont.ttf b/src/cockpit/389-console/fonts/PatternFlyIcons-webfont.ttf new file mode 100644 index 000000000..1ed274b25 Binary files /dev/null and b/src/cockpit/389-console/fonts/PatternFlyIcons-webfont.ttf differ diff --git a/src/cockpit/389-console/fonts/fontawesome-webfont.woff2 b/src/cockpit/389-console/fonts/fontawesome-webfont.woff2 new file mode 100644 index 000000000..4d13fc604 Binary files /dev/null and b/src/cockpit/389-console/fonts/fontawesome-webfont.woff2 differ diff --git a/src/cockpit/389-console/fonts/glyphicons-halflings-regular.woff2 b/src/cockpit/389-console/fonts/glyphicons-halflings-regular.woff2 new file mode 100644 index 000000000..64539b54c Binary files /dev/null and b/src/cockpit/389-console/fonts/glyphicons-halflings-regular.woff2 differ diff --git a/src/cockpit/389-console/index.html b/src/cockpit/389-console/index.html index 50e3d2799..236ccb8d9 100644 --- a/src/cockpit/389-console/index.html +++ b/src/cockpit/389-console/index.html @@ -33,7 +33,7 @@ <script src="js/ds.js"></script> </head> -<body hidden>node_modules/datatables/media/js/jquery.dataTables.min.js +<body hidden> <div class="ds-nav-bar"> <div class="ds-logo"> <h2 class="ds-logo-style" id="main-banner"></h2> @@ -127,8 +127,8 @@ <b class="caret"></b> </a> <ul class="dropdown-menu ds-nav-item"> - <li><a href="#0"class="ds-nav-choice" id="std-schema-btn" parent-id="schema-tab">Standard Schema</a></li> - <li><a href="#0"class="ds-nav-choice" id="custom-schema-btn" parent-id="schema-tab">Custom Schema</a></li> + <li><a href="#0"class="ds-nav-choice" id="objectclass-btn" parent-id="schema-tab">Objectclasses</a></li> + <li><a href="#0"class="ds-nav-choice" id="attribute-btn" parent-id="schema-tab">Attributes</a></li> <li><a href="#0" class="ds-nav-choice" id="schema-mr-btn" parent-id="schema-tab">Matching Rules</a></li> </ul> </li> diff --git a/src/cockpit/389-console/js/backend.js b/src/cockpit/389-console/js/backend.js index 5d591c1ca..66255a07b 100644 --- a/src/cockpit/389-console/js/backend.js +++ b/src/cockpit/389-console/js/backend.js @@ -1,5 +1,5 @@ var prev_tree_node = null; -var ref_del_html = "<button class=\"btn btn-default delete-referral-btn\" type=\"button\">Delete Referral</button>"; +var ref_del_html = "<button class=\"btn btn-default del-ref-btn\" type=\"button\"><span class='glyphicon glyphicon-trash'></span> Delete</button>"; var attr_encrypt_del_html = "<button class=\"btn btn-default attr-encrypt-delete-btn\" type=\"button\">Remove Attribute</button></td>"; var index_btn_html = '<div class="dropdown"> ' + @@ -309,16 +309,19 @@ $(document).ready( function() { "language": { "emptyTable": "No Referrals" }, - "columnDefs": [ { - "targets": 1, - "orderable": false - } ] + "columnDefs": [ + { + "targets": 1, + "orderable": false, + }, + { + "targets": 1, + "className": "ds-center" + } + ] }); - - - $('#system-index-table').DataTable( { "paging": true, "bAutoWidth": false, @@ -481,6 +484,21 @@ $(document).ready( function() { } }); + $(document).on('click', '.del-ref-btn', function(e) { + e.preventDefault(); + var data = ref_table.row( $(this).parents('tr') ).data(); + var del_ref_name = data[0]; + var ref_row = $(this); // Store element for callback + bootpopup.confirm("Are you sure you want to delete referral: " + del_ref_name, "Confirmation", function (yes) { + if (yes) { + // TODO Delete mapping from DS + + // Update html table + ref_table.row( ref_row.parents('tr') ).remove().draw( false ); + } + }); + }); + $("#backend-config-save-btn").on("click", function () { var role = $("input[name=cache-role]:checked").val(); if (role == "manual-cache") { @@ -695,7 +713,6 @@ $(document).ready( function() { var attr_encrypt_algo = $("#nsencryptionalgorithm").val(); // TODO - add encrypted attr to DS -console.log("Mark Save encrypted attribute"); // Update table on success attr_encrypt_table.row.add( [ encrypt_attr_name, @@ -761,16 +778,16 @@ console.log("Mark Save encrypted attribute"); }); $("#create-ref-save").on("click", function() { - var ref = get_encoded_ref(); // Do the actual save in DS // Update html var tr_row = ref_table.row.add( [ ref, ref_del_html - ] ).draw( false ); + ] ); $( tr_row ).addClass('ds-nowrap-td'); - + $( tr_row ).find("td:nth-child(1))").addClass('ds-center'); + tr_row.draw(false); $("#create-ref-form").modal('toggle'); }); diff --git a/src/cockpit/389-console/js/replication.js b/src/cockpit/389-console/js/replication.js index e65d83f94..0e2b1dd9a 100644 --- a/src/cockpit/389-console/js/replication.js +++ b/src/cockpit/389-console/js/replication.js @@ -103,13 +103,17 @@ function clear_repl_mgr_form () { $("#add-repl-mgr-passwd").hide(); } -function check_repl_binddn_list () { - if( $("#nsds5replicabinddngroup").val() == "" && $("#repl-managers-list").has('option').length < 1) { - $("#repl-managers-list").css('border-color', 'red'); - } else { - $("#repl-managers-list").css('border-color', binddn_list_color); - } -} + +function add_repl_mgr(dn){ + $("#repl-mgr-table tbody").append( + "<tr>"+ + "<td class='ds-td'>" + dn +"</td>"+ + "<td class='ds-center'>"+ + "<button type='button' class='btn btn-default ds-table-btn del-repl-mgr'>" + + "<span class='glyphicon glyphicon-trash'></span> Remove</button></td>" + + "</tr>"); +}; + $(document).ready( function() { $("#replication-content").load("replication.html", function () { @@ -120,8 +124,6 @@ $(document).ready( function() { // Load existing replication config (if any), set role, etc - // Check repl managers list and if empty give it a red border - check_repl_binddn_list(); $("#schedule-settings").hide(); $("#repl-config-btn").on("click", function() { @@ -361,6 +363,17 @@ $(document).ready( function() { clear_agmt_wizard(); }); + $(document).on('click', '.del-repl-mgr', function(e) { + e.preventDefault(); + var row = $(this).parent().parent(); //tr + var repl_dn = row.children("td:nth-child(1)"); + bootpopup.confirm("Are you sure you want to delete replication manager: " + repl_dn.html(), "Confirmation", function (yes) { + if (yes) { + row.remove(); + } + }); + }); + // Delete agreement $(document).on('click', '.agmt-del-btn', function(e) { e.preventDefault(); @@ -378,6 +391,7 @@ $(document).ready( function() { }); }); + // Edit Agreement $(document).on('click', '.agmt-edit-btn', function(e) { e.preventDefault(); @@ -732,14 +746,12 @@ $(document).ready( function() { // Do the actual save in DS // Update html - $("#add-repl-mgr-form").css('display', 'none'); - if (repl_dn != '') { - if ( $('#repl-managers-list option[value="' + repl_dn + '"]').val() === undefined) { - // It's not a duplicate - $('#repl-managers-list').append($("<option>").val(repl_dn).text(repl_dn)); - check_repl_binddn_list(); - } - } + + add_repl_mgr(repl_dn); + + + $("#add-repl-mgr-form").modal('toggle'); + }); diff --git a/src/cockpit/389-console/js/schema.js b/src/cockpit/389-console/js/schema.js index 1fd00b8e6..75b7f04fc 100644 --- a/src/cockpit/389-console/js/schema.js +++ b/src/cockpit/389-console/js/schema.js @@ -1,6 +1,6 @@ var attr_btn_html = '<div class="dropdown">' + - '<button class="btn btn-default dropdown-toggle ds-agmt-dropdown-button" type="button" id="" data-toggle="dropdown">' + + '<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">' + ' Choose Action...' + '<span class="caret"></span>' + '</button>' + @@ -12,11 +12,11 @@ var attr_btn_html = var oc_btn_html = '<div class="dropdown">' + - '<button class="btn btn-default dropdown-toggle ds-agmt-dropdown-button" type="button" id="oc-action-btn" data-toggle="dropdown">' + + '<button class="btn btn-default dropdown-toggle" type="button"data-toggle="dropdown">' + ' Choose Action...' + '<span class="caret"></span>' + '</button>' + - '<ul class="dropdown-menu ds-agmt-dropdown" role="menu" aria-labelledby="oc-action-btn">' + + '<ul class="dropdown-menu ds-agmt-dropdown" role="menu">' + '<li role=""><a role="menuitem" tabindex="0" class="oc-edit-btn" href="#">Edit Objectclass</a></li>' + '<li role=""><a role="menuitem" tabindex="1" class="oc-del-btn" href="#">Delete Objectclass</a></li>' + '</ul>' + @@ -36,7 +36,6 @@ function clear_oc_form() { function clear_attr_form() { // Clear input fields and reset dropboxes - $(".ds-accordion-panel").css('display','none'); $("#add-edit-attr-header").html('Add Attribute'); $("#attr-name").attr('disabled', false); $("#attr-name").val(""); @@ -57,36 +56,14 @@ $(document).ready( function() { // TODO Get attributes, Objectclasses, syntaxes, and matching rules: populate tables and forms // Setup the tables: standard, custom, and Matching Rules - $('#standard-oc-table').DataTable({ - "paging": true, - "bAutoWidth": false, - "dom": '<"pull-left"f><"pull-right"l>tip', // Moves the search box to the left - "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]], - "language": { - "emptyTable": "No objectclasses available", - "search": "Search Objectclasses" - }, - }); - $('#standard-attr-table').DataTable( { - "paging": true, - "bAutoWidth": false, - "dom": '<"pull-left"f><"pull-right"l>tip', // Moves the search box to the left - "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]], - "language": { - "emptyTable": "No attributes available", - "search": "Search Attributes" - }, - }); - - - var custom_oc_table = $('#custom-oc-table').DataTable ({ + var oc_table = $('#oc-table').DataTable ({ "paging": true, "bAutoWidth": false, "dom": '<"pull-left"f><"pull-right"l>tip', "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]], "language": { - "emptyTable": "No custom objectclasses defined", + "emptyTable": "No objectclasses defined", "search": "Search Objectclasses" }, "columnDefs": [ { @@ -94,13 +71,13 @@ $(document).ready( function() { "orderable": false } ] }); - var custom_at_table = $('#custom-attr-table').DataTable({ + var at_table = $('#attr-table').DataTable({ "paging": true, "bAutoWidth": false, "dom": '<"pull-left"f><"pull-right"l>tip', // Moves the search box to the left "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]], "language": { - "emptyTable": "No custom attributes defined", + "emptyTable": "No attributes defined", "search": "Search Attributes" }, "columnDefs": [ { @@ -125,15 +102,15 @@ $(document).ready( function() { // Sort schema list awhile sort_list( $("#schema-list") ); - $("#std-schema-btn").on("click", function() { + $("#objectclass-btn").on("click", function() { $(".all-pages").hide(); $("#schema-content").show(); - $("#std-schema-page").show(); + $("#objectclass-page").show(); }); - $("#custom-schema-btn").on("click", function() { + $("#attribute-btn").on("click", function() { $(".all-pages").hide(); $("#schema-content").show(); - $("#custom-schema-page").show(); + $("#attribute-page").show(); }); $("#schema-mr-btn").on("click", function() { $(".all-pages").hide(); @@ -141,21 +118,6 @@ $(document).ready( function() { $("#schema-mr").show(); }); - // Accordions - $(".ds-accordion-panel").css('display','none'); - var attr_opts_acc = document.getElementsByClassName("attr-opts-accordion"); - for (var i = 0; i < attr_opts_acc.length; i++) { - attr_opts_acc[i].onclick = function() { - this.classList.toggle("active"); - var panel = this.nextElementSibling; - if (panel.style.display == "block") { - panel.style.display = "none"; - } else { - panel.style.display = "block"; - } - } - } - // // Modals/Forms // @@ -167,24 +129,21 @@ $(document).ready( function() { */ $("#add-oc-button").on("click", function() { clear_oc_form(); - $("#add-edit-oc-form").css('display', 'block'); - }); - - $("#add-edit-oc-close").on("click", function() { - $("#add-edit-oc-form").css('display', 'none'); }); - $("#add-edit-oc-cancel").on("click", function() { - $("#add-edit-oc-form").css('display', 'none'); - }); - $("#add-edit-oc-save").on("click", function() { - - // Do the actual save in DS + $("#save-oc-button").on("click", function() { + var edit = false; + var oc_name = $("#oc-name").val(); + if ( $("#add-edit-oc-header").text().indexOf("Edit Objectclass") != -1){ + edit = true; + } + // TODO - Do the actual save in DS // Update html // If save successful close down form, otherwise keep form up and return - $("#add-edit-oc-form").css('display', 'none'); + $("#add-edit-oc-form").modal('toggle'); + $("#oc-name").attr('disabled', false); @@ -192,9 +151,15 @@ $(document).ready( function() { var oc_required_list = $('#oc-required-list option').map(function() { return $(this).val(); }).get().join(', '); var oc_allowed_list = $('#oc-allowed-list option').map(function() { return $(this).val(); }).get().join(', '); - // Update html table - var oc_name = $("#oc-name").val(); - custom_oc_table.row.add( [ + // Add or edit? + + // Update html table (if edit: delete old then add new) + if ( edit ) { + var selector = $('tr:contains(' + oc_name + ')'); + oc_table.row(selector).remove().draw(false); + } + + oc_table.row.add( [ oc_name, $("#oc-oid").val(), $("#oc-parent").val(), @@ -261,15 +226,10 @@ $(document).ready( function() { */ $("#create-attr-button").on("click", function() { clear_attr_form(); - $("#add-edit-attr-form").css('display', 'block'); + }) - $("#attr-close").on("click", function() { - $("#add-edit-attr-form").css('display', 'none'); - }); - $("#attr-cancel").on("click", function() { - $("#add-edit-attr-form").css('display', 'none'); - }); - $("#attr-save").on("click", function() { + + $("#save-attr-button").on("click", function() { var attr_name = $("#attr-name").val(); var multiple = "no"; var eq_mr= $('#attr-eq-mr-select').val(); @@ -279,15 +239,25 @@ $(document).ready( function() { if ( $("#attr-multivalued").is(":checked") ) { multiple = "yes"; }; + var edit = false; + if ( $("#add-edit-attr-header").text().indexOf("Edit Attribute") != -1){ + edit = true; + } // Do the actual save in DS - + // if save in DS successful close down form, otherwise keep form visible and return ^^^ - $("#add-edit-attr-form").css('display', 'none'); + $("#add-edit-attr-form").modal('toggle'); $("#attr-name").attr('disabled', false); - // Create attribute row to dataTable with correct edit button id - custom_at_table.row.add( [ + // Update html table (if edit: delete old then add new) + if ( edit ) { + var selector = $('tr:contains(' + attr_name + ')'); + at_table.row(selector).remove().draw(false); + } + + // Create attribute row to dataTable + at_table.row.add( [ attr_name, $("#attr-oid").val(), $("#attr-syntax").val(), @@ -302,7 +272,7 @@ $(document).ready( function() { $(document).on('click', '.attr-edit-btn', function(e) { e.preventDefault(); clear_attr_form(); - var data = custom_at_table.row( $(this).parents('tr') ).data(); + var data = at_table.row( $(this).parents('tr') ).data(); var edit_attr_name = data[0]; var edit_attr_oid = ""; var edit_attr_desc = ""; @@ -312,13 +282,12 @@ $(document).ready( function() { var edit_attr_eq_mr = ""; var edit_attr_order_mr = ""; var edit_attr_sub_mr = ""; - - console.log("In edit attr,,,"); + $("#add-edit-attr-header").html('Edit Attribute: ' + edit_attr_name); $("#attr-name").val(edit_attr_name); $("#attr-name").attr('disabled', true); - $("#add-edit-attr-form").css('display', 'block'); + $("#add-edit-attr-form").modal('toggle'); // TODO Get fresh copy of attr to fill in edit form @@ -327,7 +296,7 @@ $(document).ready( function() { $(document).on('click', '.attr-del-btn', function(e) { e.preventDefault(); - var data = custom_at_table.row( $(this).parents('tr') ).data(); + var data = at_table.row( $(this).parents('tr') ).data(); var del_attr_name = data[0]; var at_row = $(this); bootpopup.confirm("Are you sure you want to delete attribute: " + del_attr_name, "Confirmation", function (yes) { @@ -335,7 +304,7 @@ $(document).ready( function() { // TODO Delete attr from DS // Update html table - custom_at_table.row( at_row.parents('tr') ).remove().draw( false ); + at_table.row( at_row.parents('tr') ).remove().draw( false ); } }); }); @@ -343,7 +312,7 @@ $(document).ready( function() { $(document).on('click', '.oc-edit-btn', function(e) { e.preventDefault(); clear_oc_form(); - var data = custom_oc_table.row( $(this).parents('tr') ).data(); + var data = oc_table.row( $(this).parents('tr') ).data(); var edit_oc_name = data[0]; var edit_oc_oid = ""; var edit_oc_desc = ""; @@ -358,13 +327,13 @@ $(document).ready( function() { // TODO Get fresh copy of objectclass for edit form // Update modal html header and fields and show() - $("#add-edit-oc-form").css('display', 'block'); + $("#add-edit-oc-form").modal('toggle'); - } ); + }); $(document).on('click', '.oc-del-btn', function(e) { e.preventDefault(); - var data = custom_oc_table.row( $(this).parents('tr') ).data(); + var data = oc_table.row( $(this).parents('tr') ).data(); var del_oc_name = data[0]; var oc_row = $(this); @@ -373,7 +342,7 @@ $(document).ready( function() { // TODO Delete attr from DS // Update html table - custom_oc_table.row( oc_row.parents('tr') ).remove().draw( false ); + oc_table.row( oc_row.parents('tr') ).remove().draw( false ); } }); diff --git a/src/cockpit/389-console/js/servers.js b/src/cockpit/389-console/js/servers.js index bbeff8892..dd2c745d0 100644 --- a/src/cockpit/389-console/js/servers.js +++ b/src/cockpit/389-console/js/servers.js @@ -965,7 +965,7 @@ $(document).ready( function() { // Open form - $("#local-pwp-form").css('display', 'block'); + $("#local-pwp-form").modal('toggle'); }); }); diff --git a/src/cockpit/389-console/monitor.html b/src/cockpit/389-console/monitor.html index 69c180681..ccb52fc7a 100644 --- a/src/cockpit/389-console/monitor.html +++ b/src/cockpit/389-console/monitor.html @@ -334,6 +334,7 @@ </span> </div> </div> + <p></p> <hr class="ds-hr"> <div class="ds-inline"> <div> diff --git a/src/cockpit/389-console/replication.html b/src/cockpit/389-console/replication.html index 992ddb7bc..e26e59f62 100644 --- a/src/cockpit/389-console/replication.html +++ b/src/cockpit/389-console/replication.html @@ -26,8 +26,10 @@ Replica ID</label><input class="ds-input" type="text" id="nsds5replicaid" size="15"/> </div> <p></p> + <div> - <table class="table table-bordered ds-mgr-table" title="Specifies entries that can perform replication updates on this server. Also known as supplier DN, update DN, or Replication Manager"> + <table class="table table-bordered ds-mgr-table" id="repl-mgr-table" + title="Specifies entries that can perform replication updates on this server. Also known as supplier DN, update DN, or Replication Manager"> <thead> <tr> <th>Replication Managers</th> @@ -38,7 +40,7 @@ <tr> <td class="ds-td">cn=replication manager,cn=config</td> <td class="ds-center"> - <button type="button" class="btn btn-default ds-table-btn"> + <button type="button" class="btn btn-default ds-table-btn del-repl-mgr"> <span class="glyphicon glyphicon-trash"></span> Remove </button></td> </tr> diff --git a/src/cockpit/389-console/rhds-banner.html b/src/cockpit/389-console/rhds-banner.html index c856e4a09..5496081ed 100644 --- a/src/cockpit/389-console/rhds-banner.html +++ b/src/cockpit/389-console/rhds-banner.html @@ -1,5 +1,5 @@ Red Hat Directory Server Management <div class="dropdown ds-server-action"> <select class="btn btn-default dropdown ds-dropdown-server" id="select-server"> - </select></div><div class="dropdown ds-float-right"><button class="btn btn-default dropdown-toggle ds-action-btn" + </select></div><div class="dropdown ds-float-right"><button class="btn btn-primary dropdown-toggle ds-action-btn" type="button" id="server-list-menu" data-toggle="dropdown">Actions<span class="caret"></span> </button><ul class="dropdown-menu pull-right" role="menu"> <li role=""><a role="menuitem" id="start-server-btn" href="#">Start Instance</a></li> diff --git a/src/cockpit/389-console/schema.html b/src/cockpit/389-console/schema.html index 192a54f0d..e810be93f 100644 --- a/src/cockpit/389-console/schema.html +++ b/src/cockpit/389-console/schema.html @@ -1,82 +1,9 @@ <div id="schema-content"> - <div id="std-schema-page" class="all-pages" hidden> - <h3 class="ds-config-header">Standard Objectclasses</h3> - <table id="standard-oc-table" class="display ds-table" cellspacing="0" width="100%"> - <thead> - <tr class="ds-table-header"> - <th>Objectclass Name</th> - <th>OID</th> - <th>Parent</th> - <th>Required Attributes</th> - <th>Allowed Attributes</th> - </tr> - </thead> - <tbody id="standard-body"> - <tr> - <td>person</td> - <td>1.0.34.54.7.2.3.4.3.2</td> - <td>top</td> - <td>cn givenname sn</td> - <td>description uid</td> - </tr> - <tr> - <td>demoPerson</td> - <td>1.0.34.54.7.2.3.4.3.2</td> - <td>top</td> - <td>cn givenname sn</td> - <td>uid</td> - </tr> - <tr> - <td>person</td> - <td>1.0.34.54.7.2.3.4.3.2</td> - <td>top</td> - <td>cn givenname sn uid userpassword mail</td> - <td>description homedir memberOf someOtherAttribute longdescprition certificateVocationList</td> - </tr> - </tbody> - </table> - <hr> - <h3 class="ds-config-header">Standard Attributes</h3> - <table id="standard-attr-table" class="display ds-table" cellspacing="0" width="100%"> - <thead> - <tr class="ds-table-header"> - <th>Attribute Name</th> - <th>OID</th> - <th>Syntax</th> - <th>Multivalued</th> - <th title="Equality matching rules">Equality Rules</th> - <th title="Ordering matching rules">Ordering Rules</th> - <th title="Substring matching rules">Substring Rules</th> - </tr> - </thead> - <tbody id="standard-attr-body"> - <tr> - <td>ssn</td> - <td>1.1.1.1.1.1.1.1</td> - <td>DirectoryString</td> - <td>no</td> - <td></td> - <td></td> - <td></td> - </tr> - <tr> - <td>ssn</td> - <td>1.1.1.1.1.1.1.1</td> - <td>DirectoryString</td> - <td>no</td> - <td></td> - <td></td> - <td></td> - </tr> - </tbody> - </table> - </div> - - <div id="custom-schema-page" class="all-pages" hidden> - <h3 class="ds-config-header">Custom Objectclasses</h3> - <table id="custom-oc-table" class="display ds-repl-table" cellspacing="0" width="100%"> + <div id="objectclass-page" class="all-pages" hidden> + <h3 class="ds-config-header">Objectclasses</h3> + <table id="oc-table" class="display ds-repl-table" cellspacing="0" width="100%"> <thead> <tr class="ds-table-header"> <th>Objectclass Name</th> @@ -87,7 +14,7 @@ <th>Action</th> </tr> </thead> - <tbody id="custom-body"> + <tbody> <tr> <td>uiPerson</td> <td>1.1.1.1.1.1.1.1.1.1</td> @@ -96,11 +23,11 @@ <td>sn uid givenname description userpassword longDescription certificateRevocationList more</td> <td> <div class="dropdown"> - <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown"> + <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown"> Choose Action... <span class="caret"></span> </button> - <ul class="dropdown-menu ds-agmt-dropdown" role="menu" aria-labelledby="dropdownMenu1"> + <ul class="dropdown-menu ds-agmt-dropdown" role="menu"> <li role=""><a role="menuitem" tabindex="0" class="oc-edit-btn" href="#">Edit Objectclass</a></li> <li role=""><a role="menuitem" tabindex="1" class="oc-del-btn" href="#">Delete Objectclass</a></li> </ul> @@ -116,11 +43,11 @@ <td>sn member</td> <td> <div class="dropdown"> - <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown"> + <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown"> Choose Action... <span class="caret"></span> </button> - <ul class="dropdown-menu ds-agmt-dropdown" role="menu" aria-labelledby="dropdownMenu2"> + <ul class="dropdown-menu ds-agmt-dropdown" role="menu"> <li role=""><a role="menuitem" tabindex="0" class="oc-edit-btn" href="#">Edit Objectclass</a></li> <li role=""><a role="menuitem" tabindex="1" class="oc-del-btn" href="#">Delete Objectclass</a></li> </ul> @@ -135,7 +62,7 @@ <td>sn uid description</td> <td> <div class="dropdown"> - <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown"> + <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown"> Choose Action... <span class="caret"></span> </button> @@ -148,10 +75,12 @@ </tr> </tbody> </table> - <button id="add-oc-button" name="create-oc" class="btn btn-primary ds-button">Create Objectclass</button> - <hr> - <h3 class="ds-config-header">Custom Attributes</h3> - <table id="custom-attr-table" class="display ds-repl-table" cellspacing="0" width="100%"> + <button id="add-oc-button" name="create-oc" data-toggle="modal" data-target="#add-edit-oc-form" class="btn btn-primary ds-button">Create Objectclass</button> + </div> + + <div id="attribute-page" class="all-pages" hidden> + <h3 class="ds-config-header">Attributes</h3> + <table id="attr-table" class="display ds-repl-table" cellspacing="0" width="100%"> <thead> <tr class="ds-table-header"> <th>Attribute Name</th> @@ -164,7 +93,7 @@ <th>Action</th> </tr> </thead> - <tbody id="custom-attr-body"> + <tbody> <td>ssn</td> <td>1.1.1.1.1.1.1.2</td> <td>DirectoryString</td> @@ -186,7 +115,7 @@ </td> </tbody> </table> - <button id="create-attr-button" class="btn btn-primary ds-button">Create Attribute</button> + <button id="create-attr-button" data-toggle="modal" data-target="#add-edit-attr-form" class="btn btn-primary ds-button">Create Attribute</button> </div> <div id="schema-mr" class="all-pages" hidden> @@ -222,167 +151,164 @@ <!-- Modals/Popups/Wizards --> - - <!-- Add/Edit Objectclass. we'll use this for our add and edit - JS will change the header --> - <div id="add-edit-oc-form" class="modal"> - <form class="modal-content animate" action="#schema-tab"> - <div class="container"> - <h2><b id="add-edit-oc-header">Add Objectclass</b> <span class="close" id="add-edit-oc-close">&times;</span></h2> - <hr class="ds-hr"> - <p></p> - <label for="oc-name" class="ds-label-sm" title="The objectclass name"><b - >Objectclass Name</b></label><input class="ds-input-lrg" type="text" id="oc-name" size="40" required /> - <label for="oc-oid" class="ds-label-sm" title="Objectclass OID (optional)"><b - >OID (optional)</b></label><input class="ds-input-lrg" value="" type="text" id="oc-oid" size="40"/> - <label for="oc-parent" class="ds-label-sm" title="The parent objectclass"><b>Parent Objectclass</b></label><select - class="btn btn-default dropdown ds-oc-dropdown" id="oc-parent"> - <option>Top</option> - <option>Person</option> - <option>Organizationalunit</option> - <option>Dynamically loaded at startup...</option> - <option>Top</option> - <option>Person</option> - <option>Organizationalunit</option> - <option>Dynamically loaded at startup...</option> - <option>Top</option> - <option>Person</option> - <option>Organizationalunit</option> - <option>Dynamically loaded at startup...</option> - <option>Top</option> - <option>Person</option> - <option>Organizationalunit</option> - <option>Dynamically loaded at startup...</option> - <option>Top</option> - <option>Person</option> - <option>Organizationalunit</option> - <option>Dynamically loaded at startupZZZZZZ</option> - <option>Top</option> - <option>Person</option> - <option>Organizationalunit</option> - <option>Dynamically loaded at startup...</option> - <option>Top</option> - <option>Person</option> - <option>Organizationalunit</option> - <option>Dynamically loaded at startup...</option> - <option>Top</option> - <option>Person</option> - <option>Organizationalunit</option> - <option>Dynamically loaded at startup...</option> - <option>Top</option> - <option>Person</option> - <option>Organizationalunit</option> - <option>Dynamically loaded at startup...</option> - <option>Top</option> - <option>Person</option> - <option>Organizationalunit</option> - <option>Dynamically loaded at startupZZZZZZ</option> - </select> - <p></p> - <p></p> - <div class="ds-container"> - <div name="available-attrs"> - <label class="ds-config-label" for="schema-list" title="The available attributes to choose from."><b>Available Attributes</b></label> - <select id="schema-list" class="ds-oc-form-list" name="availattrs" multiple> - <option value="alias">alias</option> - <option value="cn">cn</option> - <option value="uid">uid</option> - <option value="sn">sn</option> - <option value="ou">ou</option> - <option value="displayName">displayName</option> - <option value="legalname">legalname</option> - </select> - </div> - - <div name="add-remove-buttons"> - <div name="must buttons" class="btn-group ds-oc-must-buttons"> - <input type="button" class="ds-oc-add-del-btn" id="oc-must-add-button" value="Add &nbsp; &#9658; &#9658; &#9658; "/> - <input type="button" class="ds-oc-add-del-btn" id="oc-must-remove-button" value="&#9668; &#9668; &#9668; &nbsp; Remove"/> - </div> - <p></p> - <div name="may buttons" class="btn-group ds-oc-may-buttons"> - <input type="button" class="ds-oc-add-del-btn" id="oc-may-add-button" value="Add &nbsp; &#9658; &#9658; &#9658;"/> - <input type="button" class="ds-oc-add-del-btn" id="oc-may-remove-button" value="&#9668; &#9668; &#9668; &nbsp; Remove"/> + <!-- Add/edit Attribute modal --> + <div class="modal fade" id="add-edit-attr-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="add-edit-attr-header" aria-hidden="true"> + <div class="modal-dialog ds-modal"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close"> + <span class="pficon pficon-close"></span> + </button> + <h4 class="modal-title" id="add-edit-attr-header">Add Attribute</h4> + </div> + <div class="modal-body"> + <form class="form-horizontal"> + <div class="ds-inline"> + <div> + <label for="attr-name" class="ds-config-label" title="The attribute name"><b + >Attribute Name</b></label><input class="ds-input-lrg" type="text" id="attr-name" size="40" required /> + </div> + <div> + <label for="attr-syntax" class="ds-config-label" title="The attribute syntax"><b>Attribute Syntax</b></label><select + class="btn btn-default dropdown ds-oc-dropdown" id="attr-syntax"> + </select> + </div> + <div> + <input type="checkbox" class="ds-config-checkbox" id="attr-multivalued"><label + for="attr-multivalued" class="ds-label"> Attribute Multi-Valued </label> + </div> + <div> + <label for="attr-desc" class="ds-config-label" title="The attribute description"><b + >Attribute Description</b></label><input class="ds-input-lrg" type="text" id="attr-desc" size="40"/> + </div> + <div> + <label for="attr-oid" class="ds-config-label" title="The attribute name"><b + >Attribute OID</b></label><input class="ds-input-lrg" type="text" id="attr-oid" size="40"/> + </div> + <div> + <label for="attr-alias" class="ds-config-label" title="The attribute alias list separated by commas"><b + >Attribute Alias</b></label><input class="ds-input-lrg" type="text" id="attr-alias" size="40"/> + </div> + <div> + <label for="attr-eq-mr-select" class="ds-config-label"><b>Equality Matching Rule</b></label><select + class="btn btn-default dropdown ds-oc-dropdown" id="attr-eq-mr-select"> + </select> + </div> + <div> + <label for="attr-order-mr-select" class="ds-config-label"><b>Ordering Matching Rule</b></label><select + class="btn btn-default dropdown ds-oc-dropdown" id="attr-order-mr-select"> + </select> + </div> + <div> + <label for="attr-sub-mr-select" class="ds-config-label"><b>Substring Matching Rule</b></label><select + class="btn btn-default dropdown ds-oc-dropdown" id="attr-sub-mr-select"> + </select> + </div> </div> - </div> - - <div name="may-must-lists"> - <label class="ds-config-label" for="oc-required-list" title= - "Attributes required by the objectclass"><b>Required Attributes</b></label> - <select id="oc-required-list" class="ds-may-must-list" name="availattrs" multiple> - <option value="uid">uid</option> - <option value="cn">cn</option> - </select> - <p></p> - <label class="ds-config-label" for="oc-allowed-list" title= - "Attributes allowed by the objectclass"><b>Allowed Attributes</b></label> - <select id="oc-allowed-list" class="ds-may-must-list" name="availattrs" multiple> - <option value="alias">alias</option> - <option value="sn">sn</option> - </select> - </div> + </form> </div> - <p></p> - <hr class="ds-hr"> - <div class="clearfix ds-container"> - <div class="ds-panel-left"> - <button type="button" id="add-edit-oc-cancel" class="ds-button-left">Cancel</button> - </div> - <div class="ds-panel-right"> - <button type="button" id="add-edit-oc-save" class="ds-button-right">Save</button> - </div> + <div class="modal-footer ds-modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> + <button type="button" class="btn btn-primary" id="save-attr-button" data-dismiss="modal">Save</button> </div> </div> - </form> + </div> </div> - <div id="add-edit-attr-form" class="modal"> - <form class="modal-content animate" action="#schema-tab"> - <div class="container"> - <h2><b id="add-edit-attr-header">Add Attribute</b> <span class="close" id="attr-close">&times;</span> </h2> - <hr class="ds-hr"> - <p></p> - <label for="attr-name" class="ds-config-label" title="The attribute name"><b - >Attribute Name</b></label><input class="ds-input-lrg" type="text" id="attr-name" size="40" required /> - <!-- ldapsearch -b cn=schema objectclass=subschema ldapsyntaxes TODO LIB389 --> - <label for="attr-syntax" class="ds-config-label" title="The attribute syntax"><b>Attribute Syntax</b></label><select - class="btn btn-default dropdown ds-oc-dropdown" id="attr-syntax"> - </select> - <input type="checkbox" class="ds-config-checkbox" id="attr-multivalued"><label - for="attr-multivalued" class="ds-label"> Attribute Multi-Valued </label> - <p></p> - <input type="button" class="accordion ds-accordion-spacing ds-agmt-wiz-button attr-opts-accordion" id="attr-opts-accordion" value="Optional Settings &#9660;"/> - <div class="ds-accordion-panel"> - <label for="attr-desc" class="ds-config-label" title="The attribute description"><b - >Attribute Description</b></label><input class="ds-input-lrg" type="text" id="attr-desc" size="40"/> - <label for="attr-oid" class="ds-config-label" title="The attribute name"><b - >Attribute OID</b></label><input class="ds-input-lrg" type="text" id="attr-oid" size="40"/> - <label for="attr-alias" class="ds-config-label" title="The attribute alias list separated by commas"><b - >Attribute Alias</b></label><input class="ds-input-lrg" type="text" id="attr-alias" size="40"/> - - <label for="attr-eq-mr-select" class="ds-config-label"><b>Equality Matching Rule</b></label><select - class="btn btn-default dropdown ds-oc-dropdown" id="attr-eq-mr-select"> - </select> - <label for="attr-order-mr-select" class="ds-config-label"><b>Ordering Matching Rule</b></label><select - class="btn btn-default dropdown ds-oc-dropdown" id="attr-order-mr-select"> - </select> - <label for="attr-sub-mr-select" class="ds-config-label"><b>Substring Matching Rule</b></label><select - class="btn btn-default dropdown ds-oc-dropdown" id="attr-sub-mr-select"> - </select> + + <!-- Add/Edit Objectclass --> + <div class="modal fade" id="add-edit-oc-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="add-edit-oc-header" aria-hidden="true"> + <div class="modal-dialog ds-modal"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close"> + <span class="pficon pficon-close"></span> + </button> + <h4 class="modal-title" id="add-edit-oc-header">Add Objectclass</h4> </div> + <div class="modal-body"> + <form class="form-horizontal"> + <div class="ds-inline"> + <div> + <label for="oc-name" class="ds-label-sm" title="The objectclass name"><b + >Objectclass Name</b></label><input class="ds-input-lrg" type="text" id="oc-name" size="40" required /> + </div> + <div> + <label for="oc-oid" class="ds-label-sm" title="Objectclass OID (optional)"><b + >OID (optional)</b></label><input class="ds-input-lrg" value="" type="text" id="oc-oid" size="40"/> + </div> + <div> + <label for="oc-parent" class="ds-label-sm" title="The parent objectclass"><b>Parent Objectclass</b></label><select + class="btn btn-default dropdown ds-oc-dropdown" id="oc-parent"> + <option>Top</option> + <option>Person</option> + <option>Organizationalunit</option> + <option>Dynamically loaded at startup...</option> + <option>Top</option> + <option>Person</option> + <option>Organizationalunit</option> + <option>Dynamically loaded at startup...</option> + <option>Top</option> + <option>Person</option> + <option>Organizationalunit</option> + <option>Dynamically loaded at startup...</option> + <option>Top</option> + <option>Person</option> + <option>Organizationalunit</option> + </select> + </div> + <hr> + <div class="ds-container"> + <div name="available-attrs"> + <label class="ds-config-label" for="schema-list" title="The available attributes to choose from."><b>Available Attributes</b></label> + <select id="schema-list" class="ds-oc-form-list" name="availattrs" multiple> + <option value="alias">alias</option> + <option value="cn">cn</option> + <option value="uid">uid</option> + <option value="sn">sn</option> + <option value="ou">ou</option> + <option value="displayName">displayName</option> + <option value="legalname">legalname</option> + </select> + </div> - <p></p> - <hr class="ds-hr"> - <div class="clearfix ds-container"> - <div class="ds-panel-left"> - <button type="button" id="attr-cancel" class="ds-button-left">Cancel</button> - </div> - <div class="ds-panel-right"> - <button type="button" id="attr-save" class="ds-button-right">Save</button> - </div> + <div name="add-remove-buttons"> + <div name="must buttons" class="btn-group ds-oc-must-buttons"> + <input type="button" class="ds-oc-add-del-btn" id="oc-must-add-button" value="Add &nbsp; &#9658; &#9658; &#9658; "/> + <input type="button" class="ds-oc-add-del-btn" id="oc-must-remove-button" value="&#9668; &#9668; &#9668; &nbsp; Remove"/> + </div> + <p></p> + <div name="may buttons" class="btn-group ds-oc-may-buttons"> + <input type="button" class="ds-oc-add-del-btn" id="oc-may-add-button" value="Add &nbsp; &#9658; &#9658; &#9658;"/> + <input type="button" class="ds-oc-add-del-btn" id="oc-may-remove-button" value="&#9668; &#9668; &#9668; &nbsp; Remove"/> + </div> + </div> + + <div name="may-must-lists"> + <label class="ds-config-label" for="oc-required-list" title= + "Attributes required by the objectclass"><b>Required Attributes</b></label> + <select id="oc-required-list" class="ds-may-must-list" name="availattrs" multiple> + <option value="uid">uid</option> + <option value="cn">cn</option> + </select> + <p></p> + <label class="ds-config-label" for="oc-allowed-list" title= + "Attributes allowed by the objectclass"><b>Allowed Attributes</b></label> + <select id="oc-allowed-list" class="ds-may-must-list" name="availattrs" multiple> + <option value="alias">alias</option> + <option value="sn">sn</option> + </select> + </div> + </div> + </div> + </form> + </div> + <div class="modal-footer ds-modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> + <button type="button" class="btn btn-primary" id="save-oc-button" data-dismiss="modal">Save</button> </div> </div> - </form> + </div> </div> - </div> diff --git a/src/cockpit/389-console/servers.html b/src/cockpit/389-console/servers.html index 057f4f315..d86a2868a 100644 --- a/src/cockpit/389-console/servers.html +++ b/src/cockpit/389-console/servers.html @@ -1242,12 +1242,12 @@ </div> </div> </form> - </div> - <div class="modal-footer ds-modal-footer"> - <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> - <button type="button" class="btn btn-primary" id="local-pwp-save">Save</button> </div> </div> + <div class="modal-footer ds-modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> + <button type="button" class="btn btn-primary" id="local-pwp-save">Save</button> + </div> </div> </div>
0
85eb9216d5d4163139a90432084452cf81c8444e
389ds/389-ds-base
Bug 611850 - fix coverity Defect Type: Error handling issues https://bugzilla.redhat.com/show_bug.cgi?id=611850 Resolves: bug 611850 Bug Description: fix coverity Defect Type: Error handling issues Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: Check the error return from the functions. In some cases, I was able to figure out that the calling function should perform additional error handling (return early, goto error label), but in general the code just logs an appropriate error message and continues. I was able to get rid of some more libacl code. I removed an unused variable from modify.c Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
commit 85eb9216d5d4163139a90432084452cf81c8444e Author: Rich Megginson <[email protected]> Date: Tue Jul 6 16:47:45 2010 -0600 Bug 611850 - fix coverity Defect Type: Error handling issues https://bugzilla.redhat.com/show_bug.cgi?id=611850 Resolves: bug 611850 Bug Description: fix coverity Defect Type: Error handling issues Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: Check the error return from the functions. In some cases, I was able to figure out that the calling function should perform additional error handling (return early, goto error label), but in general the code just logs an appropriate error message and continues. I was able to get rid of some more libacl code. I removed an unused variable from modify.c Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no diff --git a/include/libaccess/aclproto.h b/include/libaccess/aclproto.h index 68ef3d80c..f1371cfc6 100644 --- a/include/libaccess/aclproto.h +++ b/include/libaccess/aclproto.h @@ -151,7 +151,6 @@ NSAPI_PUBLIC int ACL_Init(void); NSAPI_PUBLIC int ACL_InitPostMagnus(void); NSAPI_PUBLIC int ACL_LateInitPostMagnus(void); NSAPI_PUBLIC void ACL_ListHashUpdate(ACLListHandle_t **acllistp); -NSAPI_PUBLIC void ACL_GetPathAcls(char *path, ACLListHandle_t **acllist_p, char *prefix, ACLListHandle_t *masterlist); NSAPI_PUBLIC int ACL_ReadDbMapFile(NSErr_t *errp, const char *map_file, int default_only); NSAPI_PUBLIC int ACL_MethodNamesGet(NSErr_t *errp, char ***names, int *count); diff --git a/ldap/servers/plugins/chainingdb/cb_controls.c b/ldap/servers/plugins/chainingdb/cb_controls.c index ca64595c3..142284a92 100644 --- a/ldap/servers/plugins/chainingdb/cb_controls.c +++ b/ldap/servers/plugins/chainingdb/cb_controls.c @@ -224,12 +224,15 @@ int cb_update_controls( Slapi_PBlock * pb, if (!strcmp(reqControls[cCount]->ldctl_oid,CB_LDAP_CONTROL_CHAIN_SERVER)) { /* Max hop count reached ? */ - /* Checked realier by a call to cb_forward_operation() */ + /* Checked earlier by a call to cb_forward_operation() */ BerElement *ber = NULL; ber = ber_init(&(reqControls[cCount]->ldctl_value)); - ber_scanf(ber,"i",&hops); + if (LBER_ERROR == ber_scanf(ber,"i",&hops)) { + slapi_log_error( SLAPI_LOG_PLUGIN,CB_PLUGIN_SUBSYSTEM, + "Unable to get number of hops from the chaining control\n"); + } ber_free(ber,1); useloop=1; diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c index b4ec5e454..56cc97112 100644 --- a/ldap/servers/plugins/replication/cl5_api.c +++ b/ldap/servers/plugins/replication/cl5_api.c @@ -1475,7 +1475,11 @@ int cl5ConfigTrimming (int maxEntries, const char *maxAge) /* make sure changelog is not closed while trimming configuration is updated.*/ - _cl5AddThread (); + if (CL5_SUCCESS != _cl5AddThread ()) { + slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl, + "cl5ConfigTrimming: could not start changelog trimming thread\n"); + return CL5_BAD_STATE; + } PR_Lock (s_cl5Desc.dbTrim.lock); diff --git a/ldap/servers/plugins/replication/windows_connection.c b/ldap/servers/plugins/replication/windows_connection.c index 8aabfdbba..2e24bfed9 100644 --- a/ldap/servers/plugins/replication/windows_connection.c +++ b/ldap/servers/plugins/replication/windows_connection.c @@ -885,7 +885,10 @@ Slapi_Entry * windows_conn_get_search_result(Repl_Connection *conn) LDAPControl **returned_controls = NULL; int code = 0; /* Purify says this is a leak : */ - ldap_parse_result( conn->ld, res, &code, NULL, NULL, NULL, &returned_controls, 0 ); + if (LDAP_SUCCESS != (rc = ldap_parse_result( conn->ld, res, &code, NULL, NULL, NULL, &returned_controls, 0 ))) { + slapi_log_error(SLAPI_LOG_FATAL, windows_repl_plugin_name, + "error reading search result in windows_conn_get_search_result, rc=%d:%s\n", rc, ldap_err2string(rc)); + } if (returned_controls) { windows_private_update_dirsync_control(conn->agmt, returned_controls); @@ -1818,7 +1821,20 @@ windows_check_user_password(Repl_Connection *conn, Slapi_DN *sdn, char *password /* Attempt to do a bind on the existing connection * using the dn and password that were passed in. */ msgid = do_simple_bind(conn, conn->ld, (char *) binddn, password); - ldap_result(conn->ld, msgid, LDAP_MSG_ALL, NULL, &res); + rc = ldap_result(conn->ld, msgid, LDAP_MSG_ALL, NULL, &res); + if (0 > rc) { /* error */ + rc = slapi_ldap_get_lderrno(conn->ld, NULL, NULL); + slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, + "Error reading bind response for id " + "[%s]: error %d (%s)\n", + binddn ? binddn : "(anon)", + rc, ldap_err2string(rc)); + } else if (rc == 0) { /* timeout */ + slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, + "Error: timeout reading " + "bind response for [%s]\n", + binddn ? binddn : "(anon)"); + } ldap_parse_result( conn->ld, res, &rc, NULL, NULL, NULL, NULL, 1 /* Free res */); /* rebind as the DN specified in the sync agreement */ diff --git a/ldap/servers/slapd/back-ldbm/archive.c b/ldap/servers/slapd/back-ldbm/archive.c index 1f3587a77..542745393 100644 --- a/ldap/servers/slapd/back-ldbm/archive.c +++ b/ldap/servers/slapd/back-ldbm/archive.c @@ -235,7 +235,15 @@ int ldbm_back_archive2ldbm( Slapi_PBlock *pb ) if (0 != return_value) { /* error case (607331) * just to go back to the previous state if possible */ - dblayer_start(li, DBLAYER_NORMAL_MODE); + if ((return_value = dblayer_start(li, DBLAYER_NORMAL_MODE))) { + LDAPDebug1Arg(LDAP_DEBUG_ANY, + "archive2db: Unable to to start database in [%s]\n", li->li_directory); + if (task) { + slapi_task_log_notice(task, "Failed to start the database in " + "%s", li->li_directory); + } + goto out; + } } /* bring all backends back online */ for (inst_obj = objset_first_obj(li->li_instance_set); inst_obj; @@ -441,7 +449,23 @@ err: dir_bak, directory); } ldbm_delete_dirs(directory); - PR_Rename(dir_bak, directory); + if (PR_SUCCESS != PR_Rename(dir_bak, directory)) { + PRErrorCode prerr = PR_GetError(); + LDAPDebug(LDAP_DEBUG_ANY, + "db2archive: Failed to rename \"%s\" to \"%s\".\n", + dir_bak, directory, 0); + LDAPDebug(LDAP_DEBUG_ANY, + SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", + prerr, slapd_pr_strerror(prerr), 0); + if (task) { + slapi_task_log_notice(task, + "Failed to rename \"%s\" to \"%s\".", + dir_bak, directory); + slapi_task_log_notice(task, + SLAPI_COMPONENT_NAME_NSPR " error %d (%s)", + prerr, slapd_pr_strerror(prerr)); + } + } } out: /* close the database down again */ diff --git a/ldap/servers/slapd/back-ldbm/misc.c b/ldap/servers/slapd/back-ldbm/misc.c index ad7128de7..2bcdd9d92 100644 --- a/ldap/servers/slapd/back-ldbm/misc.c +++ b/ldap/servers/slapd/back-ldbm/misc.c @@ -245,7 +245,10 @@ allinstance_set_busy(struct ldbminfo *li) for (inst_obj = objset_first_obj(li->li_instance_set); inst_obj; inst_obj = objset_next_obj(li->li_instance_set, inst_obj)) { inst = (ldbm_instance *)object_get_data(inst_obj); - instance_set_busy(inst); + if (instance_set_busy(inst)) { + LDAPDebug1Arg(LDAP_DEBUG_TRACE, "could not set instance [%s] as busy, probably already busy\n", + inst->inst_name); + } } if (inst_obj) object_release(inst_obj); diff --git a/ldap/servers/slapd/eventq.c b/ldap/servers/slapd/eventq.c index 6870ecc26..c5fa12004 100644 --- a/ldap/servers/slapd/eventq.c +++ b/ldap/servers/slapd/eventq.c @@ -435,7 +435,9 @@ void eq_init() { if (!eq_initialized) { - PR_CallOnce(&init_once, eq_create); + if (PR_SUCCESS != PR_CallOnce(&init_once, eq_create)) { + slapi_log_error(SLAPI_LOG_FATAL, NULL, "eq_init - eq_create failed\n"); + } } } diff --git a/ldap/servers/slapd/modify.c b/ldap/servers/slapd/modify.c index 3f78b0193..55308a309 100644 --- a/ldap/servers/slapd/modify.c +++ b/ldap/servers/slapd/modify.c @@ -573,7 +573,6 @@ static void op_shared_modify (Slapi_PBlock *pb, int pw_change, char *old_pw) Slapi_Backend *be = NULL; Slapi_Entry *pse; Slapi_Entry *referral; - Slapi_Entry *ecopy = NULL; Slapi_Entry *e = NULL; char ebuf[BUFSIZ]; char *dn; diff --git a/ldap/servers/snmp/main.c b/ldap/servers/snmp/main.c index 04c4ee3f7..a216d34d3 100644 --- a/ldap/servers/snmp/main.c +++ b/ldap/servers/snmp/main.c @@ -411,7 +411,10 @@ load_config(char *conf_path) int vlen; #endif /* Check if this is the cn=config entry */ - ldif_parse_line(ldif_getline(&entryp), &attr, &val, &vlen); + if (ldif_parse_line(ldif_getline(&entryp), &attr, &val, &vlen)) { + printf("ldap-agent: error parsing ldif line from [%s]\n", serv_p->dse_ldif); + } + if ((strcmp(attr, "dn") == 0) && (strcmp(val, "cn=config") == 0)) { char *dse_line = NULL; diff --git a/lib/libaccess/aclcache.cpp b/lib/libaccess/aclcache.cpp index e474601a3..105888791 100644 --- a/lib/libaccess/aclcache.cpp +++ b/lib/libaccess/aclcache.cpp @@ -432,110 +432,6 @@ ACL_CacheEnterGet(char *uri, ACLListHandle_t **acllistp) return; } -/* ACL_AddAclName - * Adds the ACLs for just the terminal object specified in a pathname. - * INPUT - * path The filesystem pathname of the terminal object. - * acllistp The address of the list of ACLs found thus far. - * Could be NULL. If so, a new acllist will be allocated (if any - * acls are found). Otherwise the existing list will be added to. - * masterlist Usually acl_root_30. - */ -void -ACL_AddAclName(char *path, ACLListHandle_t **acllistp, ACLListHandle_t -*masterlist) -{ - ACLHandle_t *acl; - NSErr_t *errp = 0; - -#ifdef XP_WIN32 - acl = ACL_ListFind(errp, masterlist, path, ACL_CASE_INSENSITIVE); -#else - acl = ACL_ListFind(errp, masterlist, path, ACL_CASE_SENSITIVE); -#endif - if (!acl) - return; - - PR_ASSERT(ACL_AssertAcl(acl)); - - if (!*acllistp) - *acllistp = ACL_ListNew(errp); - ACL_ListAppend(NULL, *acllistp, acl, 0); - - PR_ASSERT(ACL_AssertAcllist(*acllistp)); - return; -} - - -/* ACL_GetPathAcls - * Adds the ACLs for all directories plus the terminal object along a given - * filesystem pathname. For each pathname component, look for the name, the - * name + "/", and the name + "/*". The last one is because the resource - * picker likes to postpend "/*" for directories. - * INPUT - * path The filesystem pathname of the terminal object. - * acllistp The address of the list of ACLs found thus far. - * Could be NULL. If so, a new acllist will be allocated (if any - * acls are found). Otherwise the existing list will be added to. - * prefix A string to be prepended to the path component when looking - * for a matching ACL tag. - */ -void -ACL_GetPathAcls(char *path, ACLListHandle_t **acllistp, char *prefix, -ACLListHandle_t *masterlist) -{ - char *slashp=path; - int slashidx; - char ppath[ACL_PATH_MAX]; - int prefixlen; - char *dst; - - PR_ASSERT(path); - PR_ASSERT(prefix); - - dst = strncpy(ppath, prefix, ACL_PATH_MAX); - if (dst >= (ppath+ACL_PATH_MAX-1)) { - ereport(LOG_SECURITY, "Abort - the path is too long for ACL_GetPathAcls to handle\n"); - abort(); - } - prefixlen = strlen(ppath); - - /* Handle the first "/". i.e. the root directory */ - if (*path == '/') { - ppath[prefixlen]='/'; - ppath[prefixlen+1]='\0'; - ACL_AddAclName(ppath, acllistp, masterlist); - strcat(ppath, "*"); - ACL_AddAclName(ppath, acllistp, masterlist); - slashp = path; - } - - do { - slashp = strchr(++slashp, '/'); - if (slashp) { - slashidx = slashp - path; - strncpy(&ppath[prefixlen], path, slashidx); - ppath[slashidx+prefixlen] = '\0'; - ACL_AddAclName(ppath, acllistp, masterlist); - /* Must also handle "/a/b/" in addition to "/a/b" */ - strcat(ppath, "/"); - ACL_AddAclName(ppath, acllistp, masterlist); - strcat(ppath, "*"); - ACL_AddAclName(ppath, acllistp, masterlist); - continue; - } - strcpy(&ppath[prefixlen], path); - ACL_AddAclName(ppath, acllistp, masterlist); - strcat(ppath, "/"); - ACL_AddAclName(ppath, acllistp, masterlist); - strcat(ppath, "*"); - ACL_AddAclName(ppath, acllistp, masterlist); - break; - } while (slashp); - -} - - static int get_is_owner_default (NSErr_t *errp, PList_t subject, PList_t resource, PList_t auth_info, PList_t global_auth, void *unused)
0
ff830604ef1667cfc4a86bffb99014c5acefc264
389ds/389-ds-base
Issue 4379 - Allow more than 1 empty AttributeDescription for ldapsearch, without the risk of denial of service Description: Added a test case to verify up to 10 empty values and a negative case to check max limit. Relates: https://github.com/389ds/389-ds-base/issues/4379 Reviewed by: @vashirov, @bsimonova, @droideck (Thanks!)
commit ff830604ef1667cfc4a86bffb99014c5acefc264 Author: Akshay Adhikari <[email protected]> Date: Tue May 18 19:40:32 2021 +0530 Issue 4379 - Allow more than 1 empty AttributeDescription for ldapsearch, without the risk of denial of service Description: Added a test case to verify up to 10 empty values and a negative case to check max limit. Relates: https://github.com/389ds/389-ds-base/issues/4379 Reviewed by: @vashirov, @bsimonova, @droideck (Thanks!) diff --git a/dirsrvtests/tests/suites/basic/basic_test.py b/dirsrvtests/tests/suites/basic/basic_test.py index 688ac3dab..1b88339b1 100644 --- a/dirsrvtests/tests/suites/basic/basic_test.py +++ b/dirsrvtests/tests/suites/basic/basic_test.py @@ -1314,6 +1314,33 @@ def test_critical_msg_on_empty_range_idl(topology_st): # Step 5 assert not topology_st.standalone.searchErrorsLog('CRIT - list_candidates - NULL idl was recieved from filter_candidates_ext.') [email protected] [email protected] [email protected]("case,value", [('positive', ['cn','','']), + ("positive", ['cn', '', '', '', '', '', '', '', '', '', '']), + ("negative", ['cn', '', '', '', '', '', '', '', '', '', '', ''])]) +def test_attr_description_limit(topology_st, case, value): + """Test that up to 10 empty attributeDescription is allowed + + :id: 5afd3dcd-1028-428d-822d-a489ecf4b67e + :customerscenario: True + :parametrized: yes + :setup: Standalone instance + :steps: + 1. Check that 2 empty values are allowed + 2. Check that 10 empty values are allowed + 3. Check that more than 10 empty values are allowed + :expectedresults: + 1. Should succeed + 2. Should succeed + 3. Should fail + """ + if case == 'positive': + DSLdapObjects(topology_st.standalone, basedn='').filter("(objectclass=*)", attrlist=value, scope=0) + else: + with pytest.raises(ldap.PROTOCOL_ERROR): + DSLdapObjects(topology_st.standalone, basedn='').filter("(objectclass=*)", attrlist=value, scope=0) + @pytest.mark.bz1647099 @pytest.mark.ds50026 @@ -1637,34 +1664,6 @@ def test_dscreate_with_different_rdn(dscreate_test_rdn_value): assert True [email protected] [email protected] [email protected]("case,value", [('positive', ['cn','','']), - ("positive", ['cn', '', '', '', '', '', '', '', '', '', '']), - ("negative", ['cn', '', '', '', '', '', '', '', '', '', '', ''])]) -def test_attr_description_limit(topology_st, case, value): - """Test that up to 10 empty attributeDescription is allowed - - :id: 5afd3dcd-1028-428d-822d-a489ecf4b67e - :customerscenario: True - :parametrized: yes - :setup: Standalone instance - :steps: - 1. Check that 2 empty values are allowed - 2. Check that 10 empty values are allowed - 3. Check that more than 10 empty values are allowed - :expectedresults: - 1. Should succeeds - 2. Should succeeds - 3. Should fail - """ - if case == 'positive': - DSLdapObjects(topology_st.standalone, basedn='').filter("(objectclass=*)", attrlist=value, scope=0) - else: - with pytest.raises(ldap.PROTOCOL_ERROR): - DSLdapObjects(topology_st.standalone, basedn='').filter("(objectclass=*)", attrlist=value, scope=0) - - if __name__ == '__main__': # Run isolated # -s for DEBUG mode
0
e2c42bced86bac235ac56ae98eed303f61ebd15e
389ds/389-ds-base
Ticket 47599 - Reduce lock scope in retro changelog plug-in Description: Use RW locks for protecting the change numbers. We still need to do the locking in retrocl_po.c as we need to serialize the actual updates. https://fedorahosted.org/389/ticket/47599 Reviewed by: richm(Thanks!!)
commit e2c42bced86bac235ac56ae98eed303f61ebd15e Author: Mark Reynolds <[email protected]> Date: Wed Nov 20 09:08:50 2013 -0500 Ticket 47599 - Reduce lock scope in retro changelog plug-in Description: Use RW locks for protecting the change numbers. We still need to do the locking in retrocl_po.c as we need to serialize the actual updates. https://fedorahosted.org/389/ticket/47599 Reviewed by: richm(Thanks!!) diff --git a/ldap/servers/plugins/retrocl/retrocl.c b/ldap/servers/plugins/retrocl/retrocl.c index 141cfd22f..6148c02cc 100644 --- a/ldap/servers/plugins/retrocl/retrocl.c +++ b/ldap/servers/plugins/retrocl/retrocl.c @@ -481,7 +481,8 @@ retrocl_plugin_init(Slapi_PBlock *pb) if (!is_betxn) { rc= slapi_register_plugin_ext("internalpostoperation", 1 /* Enabled */, "retrocl_internalpostop_init", retrocl_internalpostop_init, "Retrocl internal postoperation plugin", NULL, identity, precedence); } - + retrocl_cn_lock = slapi_new_rwlock(); + if(retrocl_cn_lock == NULL) return -1; retrocl_internal_lock = PR_NewLock(); if (retrocl_internal_lock == NULL) return -1; } diff --git a/ldap/servers/plugins/retrocl/retrocl.h b/ldap/servers/plugins/retrocl/retrocl.h index 214f3afb1..3f808e65e 100644 --- a/ldap/servers/plugins/retrocl/retrocl.h +++ b/ldap/servers/plugins/retrocl/retrocl.h @@ -131,6 +131,7 @@ extern const char *attr_nsuniqueid; extern const char *attr_isreplicated; extern PRLock *retrocl_internal_lock; +extern Slapi_RWLock *retrocl_cn_lock; /* Functions */ diff --git a/ldap/servers/plugins/retrocl/retrocl_cn.c b/ldap/servers/plugins/retrocl/retrocl_cn.c index d2b15a4b9..f816730e9 100644 --- a/ldap/servers/plugins/retrocl/retrocl_cn.c +++ b/ldap/servers/plugins/retrocl/retrocl_cn.c @@ -163,8 +163,9 @@ int retrocl_get_changenumbers(void) NULL,NULL,0,&cr,NULL,handle_cnum_result, handle_cnum_entry, NULL); - retrocl_first_cn = cr.cr_cnum; + slapi_rwlock_wrlock(retrocl_cn_lock); + retrocl_first_cn = cr.cr_cnum; slapi_ch_free(( void **) &cr.cr_time ); slapi_seq_callback(RETROCL_CHANGELOG_DN,SLAPI_SEQ_LAST, @@ -178,6 +179,8 @@ int retrocl_get_changenumbers(void) retrocl_first_cn, retrocl_internal_cn); + slapi_rwlock_unlock(retrocl_cn_lock); + slapi_ch_free(( void **) &cr.cr_time ); return 0; @@ -238,10 +241,10 @@ time_t retrocl_getchangetime( int type, int *err ) void retrocl_forget_changenumbers(void) { - PR_Lock(retrocl_internal_lock); + slapi_rwlock_wrlock(retrocl_cn_lock); retrocl_first_cn = 0; retrocl_internal_cn = 0; - PR_Unlock(retrocl_internal_lock); + slapi_rwlock_unlock(retrocl_cn_lock); } /* @@ -258,9 +261,11 @@ void retrocl_forget_changenumbers(void) changeNumber retrocl_get_first_changenumber(void) { changeNumber cn; - PR_Lock(retrocl_internal_lock); + + slapi_rwlock_rdlock(retrocl_cn_lock); cn = retrocl_first_cn; - PR_Unlock(retrocl_internal_lock); + slapi_rwlock_unlock(retrocl_cn_lock); + return cn; } @@ -277,9 +282,9 @@ changeNumber retrocl_get_first_changenumber(void) void retrocl_set_first_changenumber(changeNumber cn) { - PR_Lock(retrocl_internal_lock); + slapi_rwlock_wrlock(retrocl_cn_lock); retrocl_first_cn = cn; - PR_Unlock(retrocl_internal_lock); + slapi_rwlock_unlock(retrocl_cn_lock); } @@ -297,9 +302,11 @@ void retrocl_set_first_changenumber(changeNumber cn) changeNumber retrocl_get_last_changenumber(void) { changeNumber cn; - PR_Lock(retrocl_internal_lock); + + slapi_rwlock_rdlock(retrocl_cn_lock); cn = retrocl_internal_cn; - PR_Unlock(retrocl_internal_lock); + slapi_rwlock_unlock(retrocl_cn_lock); + return cn; } @@ -316,9 +323,11 @@ changeNumber retrocl_get_last_changenumber(void) void retrocl_commit_changenumber(void) { + slapi_rwlock_wrlock(retrocl_cn_lock); if ( retrocl_first_cn == 0) { retrocl_first_cn = retrocl_internal_cn; } + slapi_rwlock_unlock(retrocl_cn_lock); } /* @@ -333,8 +342,10 @@ void retrocl_commit_changenumber(void) */ void retrocl_release_changenumber(void) -{ +{ + slapi_rwlock_wrlock(retrocl_cn_lock); retrocl_internal_cn--; + slapi_rwlock_unlock(retrocl_cn_lock); } /* @@ -342,7 +353,7 @@ void retrocl_release_changenumber(void) * * Returns: 0/-1 * - * Arguments: none + * Arguments: none. The caller should have taken write lock for the change numbers * * Description: reads the last entry in the changelog to obtain * the last change number. @@ -355,6 +366,7 @@ int retrocl_update_lastchangenumber(void) if (retrocl_be_changelog == NULL) return -1; + slapi_rwlock_unlock(retrocl_cn_lock); cr.cr_cnum = 0; cr.cr_time = 0; slapi_seq_callback(RETROCL_CHANGELOG_DN,SLAPI_SEQ_LAST, @@ -362,7 +374,7 @@ int retrocl_update_lastchangenumber(void) NULL,NULL,0,&cr,NULL,handle_cnum_result, handle_cnum_entry, NULL); - + slapi_rwlock_wrlock(retrocl_cn_lock); retrocl_internal_cn = cr.cr_cnum; slapi_log_error(SLAPI_LOG_PLUGIN,"retrocl","Refetched last changenumber = %lu \n", retrocl_internal_cn); @@ -394,6 +406,8 @@ changeNumber retrocl_assign_changenumber(void) * validity of the internal assignment of retrocl_internal_cn * we had from the startup */ + slapi_rwlock_wrlock(retrocl_cn_lock); + if(retrocl_internal_cn <= retrocl_first_cn){ /* the numbers have become out of sync - retrocl_get_changenumbers * gets called only once during startup and it may have had a problem @@ -404,8 +418,10 @@ changeNumber retrocl_assign_changenumber(void) */ retrocl_update_lastchangenumber(); } - retrocl_internal_cn++; cn = retrocl_internal_cn; + + slapi_rwlock_unlock(retrocl_cn_lock); + return cn; } diff --git a/ldap/servers/plugins/retrocl/retrocl_po.c b/ldap/servers/plugins/retrocl/retrocl_po.c index 9c005b382..b3bfafe47 100644 --- a/ldap/servers/plugins/retrocl/retrocl_po.c +++ b/ldap/servers/plugins/retrocl/retrocl_po.c @@ -379,7 +379,7 @@ write_replog_db( retrocl_release_changenumber(); } else { /* Tell the change numbering system this one's committed to disk */ - retrocl_commit_changenumber( ); + retrocl_commit_changenumber(); } } else { slapi_log_error( SLAPI_LOG_FATAL, RETROCL_PLUGIN_NAME,
0
a355b30b213432b7e53035f46ec70c502aadfb36
389ds/389-ds-base
Bump version to 2.0.3
commit a355b30b213432b7e53035f46ec70c502aadfb36 Author: Mark Reynolds <[email protected]> Date: Fri Feb 12 15:28:16 2021 -0500 Bump version to 2.0.3 diff --git a/VERSION.sh b/VERSION.sh index af9e99c77..ea993ed58 100644 --- a/VERSION.sh +++ b/VERSION.sh @@ -10,7 +10,7 @@ vendor="389 Project" # PACKAGE_VERSION is constructed from these VERSION_MAJOR=2 VERSION_MINOR=0 -VERSION_MAINT=2 +VERSION_MAINT=3 # NOTE: VERSION_PREREL is automatically set for builds made out of a git tree VERSION_PREREL= VERSION_DATE=$(date -u +%Y%m%d)
0
30a5cdee0990e87e8a4d0d468fad6d47cd342670
389ds/389-ds-base
Issue 6665 - UI - Need to refresh log settings after saving Description: While do we reload the config from the parent component it is not resetting the child component as expected. Relates: https://github.com/389ds/389-ds-base/issues/6665 Reviewed by: spichugi(Thanks!)
commit 30a5cdee0990e87e8a4d0d468fad6d47cd342670 Author: Mark Reynolds <[email protected]> Date: Tue Mar 11 10:23:10 2025 -0400 Issue 6665 - UI - Need to refresh log settings after saving Description: While do we reload the config from the parent component it is not resetting the child component as expected. Relates: https://github.com/389ds/389-ds-base/issues/6665 Reviewed by: spichugi(Thanks!) diff --git a/src/cockpit/389-console/src/lib/server/accessLog.jsx b/src/cockpit/389-console/src/lib/server/accessLog.jsx index 250fe48ca..d2bf01ff6 100644 --- a/src/cockpit/389-console/src/lib/server/accessLog.jsx +++ b/src/cockpit/389-console/src/lib/server/accessLog.jsx @@ -303,32 +303,30 @@ export class ServerAccessLog extends React.Component { .spawn(cmd, { superuser: true, err: "message" }) .done(content => { this.props.reload(); + this.refreshConfig(1); this.props.addNotification( "success", _("Successfully updated Access Log settings") ); - this.setState({ - loading: false - }); }) .fail(err => { const errMsg = JSON.parse(err); this.props.reload(); + this.refreshConfig(1); this.props.addNotification( "error", cockpit.format(_("Error saving Access Log settings - $0"), errMsg.desc) ); - this.setState({ - loading: false - }); }); } - refreshConfig(refesh) { - this.setState({ - loading: true, - loaded: false, - }); + refreshConfig(loading) { + if (!loading) { + this.setState({ + loading: true, + loaded: false, + }); + } const cmd = [ "dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket", diff --git a/src/cockpit/389-console/src/lib/server/auditLog.jsx b/src/cockpit/389-console/src/lib/server/auditLog.jsx index 0a566bccb..606dde642 100644 --- a/src/cockpit/389-console/src/lib/server/auditLog.jsx +++ b/src/cockpit/389-console/src/lib/server/auditLog.jsx @@ -308,33 +308,30 @@ export class ServerAuditLog extends React.Component { .spawn(cmd, { superuser: true, err: "message" }) .done(content => { this.props.reload(); + this.refreshConfig(1); this.props.addNotification( "success", _("Successfully updated Audit Log settings") ); - this.setState({ - loading: false - }); - }) .fail(err => { const errMsg = JSON.parse(err); this.props.reload(); + this.refreshConfig(1); this.props.addNotification( "error", cockpit.format(_("Error saving Audit Log settings - $0"), errMsg.desc) ); - this.setState({ - loading: false, - }); }); } - refreshConfig() { - this.setState({ - loading: true, - loaded: false, - }); + refreshConfig(loading) { + if (!loading) { + this.setState({ + loading: true, + loaded: false, + }); + } const cmd = [ "dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket", diff --git a/src/cockpit/389-console/src/lib/server/auditfailLog.jsx b/src/cockpit/389-console/src/lib/server/auditfailLog.jsx index 0e5ae0a88..19785276a 100644 --- a/src/cockpit/389-console/src/lib/server/auditfailLog.jsx +++ b/src/cockpit/389-console/src/lib/server/auditfailLog.jsx @@ -244,32 +244,30 @@ export class ServerAuditFailLog extends React.Component { .spawn(cmd, { superuser: true, err: "message" }) .done(content => { this.props.reload(); + this.refreshConfig(1); this.props.addNotification( "success", _("Successfully updated Audit Fail Log settings") ); - this.setState({ - loading: false - }); }) .fail(err => { const errMsg = JSON.parse(err); this.props.reload(); + this.refreshConfig(1); this.props.addNotification( "error", cockpit.format(_("Error saving Audit Fail Log settings - $0"), errMsg.desc) ); - this.setState({ - loading: false - }); }); } - refreshConfig() { - this.setState({ - loading: true, - loaded: false, - }); + refreshConfig(loading) { + if (!loading) { + this.setState({ + loading: true, + loaded: false, + }); + } const cmd = [ "dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket", diff --git a/src/cockpit/389-console/src/lib/server/errorLog.jsx b/src/cockpit/389-console/src/lib/server/errorLog.jsx index 0922a80ff..0ad36e594 100644 --- a/src/cockpit/389-console/src/lib/server/errorLog.jsx +++ b/src/cockpit/389-console/src/lib/server/errorLog.jsx @@ -326,32 +326,30 @@ export class ServerErrorLog extends React.Component { .spawn(cmd, { superuser: true, err: "message" }) .done(content => { this.props.reload(); + this.handleRefreshConfig(1); this.props.addNotification( "success", _("Successfully updated Error Log settings") ); - this.setState({ - loading: false - }); }) .fail(err => { const errMsg = JSON.parse(err); this.props.reload(); + this.handleRefreshConfig(1); this.props.addNotification( "error", cockpit.format(_("Error saving Error Log settings - $0"), errMsg.desc) ); - this.setState({ - loading: false - }); }); } - handleRefreshConfig() { - this.setState({ - loading: true, - loaded: false, - }); + handleRefreshConfig(loading) { + if (!loading) { + this.setState({ + loading: true, + loaded: false, + }); + }; const cmd = [ "dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket", diff --git a/src/cockpit/389-console/src/lib/server/securityLog.jsx b/src/cockpit/389-console/src/lib/server/securityLog.jsx index 01adcca0c..77000a873 100644 --- a/src/cockpit/389-console/src/lib/server/securityLog.jsx +++ b/src/cockpit/389-console/src/lib/server/securityLog.jsx @@ -245,32 +245,30 @@ export class ServerSecurityLog extends React.Component { .spawn(cmd, { superuser: true, err: "message" }) .done(content => { this.props.reload(); + this.refreshConfig(1); this.props.addNotification( "success", _("Successfully updated Security Log settings") ); - this.setState({ - loading: false - }); }) .fail(err => { const errMsg = JSON.parse(err); this.props.reload(); + this.refreshConfig(1); this.props.addNotification( "error", cockpit.format(_("Error saving Security Log settings - $0"), errMsg.desc) ); - this.setState({ - loading: false - }); }); } - refreshConfig(refesh) { - this.setState({ - loading: true, - loaded: false, - }); + refreshConfig(loading) { + if (!loading) { + this.setState({ + loading: true, + loaded: false, + }); + } const cmd = [ "dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
0
ce5079cf2029b380efd95f2f6e17b98df22927e5
389ds/389-ds-base
Resolves: 212038 Make configure create program wrapper scripts.
commit ce5079cf2029b380efd95f2f6e17b98df22927e5 Author: Nathan Kinder <[email protected]> Date: Tue Oct 24 21:11:07 2006 +0000 Resolves: 212038 Make configure create program wrapper scripts. diff --git a/Makefile.am b/Makefile.am index b7476950b..b71886644 100644 --- a/Makefile.am +++ b/Makefile.am @@ -44,13 +44,13 @@ dberrstrs.h: Makefile #------------------------ # Install Paths #------------------------ -bindir = @prefix@/usr/bin -configdir = @sysconfdir@/$(PACKAGE)/config -datadir = @prefix@/usr/share/$(PACKAGE)/data -propertydir = @sysconfdir@/$(PACKAGE)/property -schemadir = @sysconfdir@/$(PACKAGE)/schema -serverdir = @prefix@/usr/lib/$(PACKAGE) -serverplugindir = @prefix@/usr/lib/$(PACKAGE)/plugins +bindir = @prefix@@bindir@ +configdir = @sysconfdir@@configdir@ +datadir = @prefix@@datadir@ +propertydir = @sysconfdir@@propertydir@ +schemadir = @sysconfdir@@schemadir@ +serverdir = @prefix@@serverdir@ +serverplugindir = @prefix@@serverplugindir@ #------------------------ # Build Products @@ -113,7 +113,19 @@ schema_DATA = $(srcdir)/ldap/schema/00core.ldif \ $(srcdir)/ldap/schema/60pam-plugin.ldif \ $(srcdir)/ldap/schema/99user.ldif -bin_SCRIPTS = $(srcdir)/ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl +bin_SCRIPTS = $(srcdir)/ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl \ + wrappers/infadd \ + wrappers/ldclt \ + wrappers/rsearch + +server_SCRIPTS = wrappers/dbscan \ + wrappers/dsktune \ + wrappers/ds_newinst \ + wrappers/ldap-agent \ + wrappers/ldif \ + wrappers/migratecred \ + wrappers/mmldif \ + wrappers/pwdhash #//////////////////////////////////////////////////////////////// diff --git a/Makefile.in b/Makefile.in index 237ad887e..cbbd9aea0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -51,8 +51,18 @@ bin_PROGRAMS = infadd-bin$(EXEEXT) ldclt-bin$(EXEEXT) \ noinst_PROGRAMS = makstrdb$(EXEEXT) @SOLARIS_TRUE@am__append_1 = ldap/servers/slapd/tools/ldclt/opCheck.c DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(top_srcdir)/configure compile \ - config.guess config.sub depcomp install-sh ltmain.sh missing + $(srcdir)/Makefile.in $(top_srcdir)/configure \ + $(top_srcdir)/wrappers/dbscan.in \ + $(top_srcdir)/wrappers/ds_newinst.in \ + $(top_srcdir)/wrappers/dsktune.in \ + $(top_srcdir)/wrappers/infadd.in \ + $(top_srcdir)/wrappers/ldap-agent.in \ + $(top_srcdir)/wrappers/ldclt.in $(top_srcdir)/wrappers/ldif.in \ + $(top_srcdir)/wrappers/migratecred.in \ + $(top_srcdir)/wrappers/mmldif.in \ + $(top_srcdir)/wrappers/pwdhash.in \ + $(top_srcdir)/wrappers/rsearch.in compile config.guess \ + config.sub depcomp install-sh ltmain.sh missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/nspr.m4 $(top_srcdir)/m4/nss.m4 \ @@ -65,7 +75,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = wrappers/dbscan wrappers/dsktune \ + wrappers/ds_newinst wrappers/infadd wrappers/ldap-agent \ + wrappers/ldclt wrappers/ldif wrappers/migratecred \ + wrappers/mmldif wrappers/pwdhash wrappers/rsearch LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libavl_a_AR = $(AR) $(ARFLAGS) @@ -94,8 +107,9 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(serverdir)" \ "$(DESTDIR)$(serverplugindir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(configdir)" "$(DESTDIR)$(datadir)" \ - "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(schemadir)" + "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(configdir)" \ + "$(DESTDIR)$(datadir)" "$(DESTDIR)$(propertydir)" \ + "$(DESTDIR)$(schemadir)" serverLTLIBRARIES_INSTALL = $(INSTALL) serverpluginLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(server_LTLIBRARIES) $(serverplugin_LTLIBRARIES) @@ -664,7 +678,8 @@ rsearch_bin_OBJECTS = $(am_rsearch_bin_OBJECTS) rsearch_bin_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) binSCRIPT_INSTALL = $(INSTALL_SCRIPT) -SCRIPTS = $(bin_SCRIPTS) +serverSCRIPT_INSTALL = $(INSTALL_SCRIPT) +SCRIPTS = $(bin_SCRIPTS) $(server_SCRIPTS) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -830,16 +845,18 @@ am__untar = @am__untar@ #------------------------ # Install Paths #------------------------ -bindir = @prefix@/usr/bin +bindir = @prefix@@bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ -datadir = @prefix@/usr/share/$(PACKAGE)/data +configdir = @sysconfdir@@configdir@ +datadir = @prefix@@datadir@ db_inc = @db_inc@ db_incdir = @db_incdir@ db_lib = @db_lib@ +db_libdir = @db_libdir@ debug_defs = @debug_defs@ exec_prefix = @exec_prefix@ host = @host@ @@ -855,6 +872,7 @@ infodir = @infodir@ install_sh = @install_sh@ ldapsdk_inc = @ldapsdk_inc@ ldapsdk_lib = @ldapsdk_lib@ +ldapsdk_libdir = @ldapsdk_libdir@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ @@ -862,18 +880,26 @@ mandir = @mandir@ mkdir_p = @mkdir_p@ netsnmp_inc = @netsnmp_inc@ netsnmp_lib = @netsnmp_lib@ +netsnmp_libdir = @netsnmp_libdir@ netsnmp_link = @netsnmp_link@ nspr_inc = @nspr_inc@ nspr_lib = @nspr_lib@ +nspr_libdir = @nspr_libdir@ nss_inc = @nss_inc@ nss_lib = @nss_lib@ +nss_libdir = @nss_libdir@ oldincludedir = @oldincludedir@ platform_defs = @platform_defs@ prefix = @prefix@ program_transform_name = @program_transform_name@ +propertydir = @sysconfdir@@propertydir@ sasl_inc = @sasl_inc@ sasl_lib = @sasl_lib@ +sasl_libdir = @sasl_libdir@ sbindir = @sbindir@ +schemadir = @sysconfdir@@schemadir@ +serverdir = @prefix@@serverdir@ +serverplugindir = @prefix@@serverplugindir@ sharedstatedir = @sharedstatedir@ svrcore_inc = @svrcore_inc@ svrcore_lib = @svrcore_lib@ @@ -916,11 +942,6 @@ PAM_LINK = -lpam #------------------------ BUILT_SOURCES = dirver.h dberrstrs.h CLEANFILES = dirver.h dberrstrs.h ns-slapd.properties -configdir = @sysconfdir@/$(PACKAGE)/config -propertydir = @sysconfdir@/$(PACKAGE)/property -schemadir = @sysconfdir@/$(PACKAGE)/schema -serverdir = @prefix@/usr/lib/$(PACKAGE) -serverplugindir = @prefix@/usr/lib/$(PACKAGE)/plugins server_LTLIBRARIES = libslapd.la libback-ldbm.la libds_admin.la libns-dshttpd.la serverplugin_LTLIBRARIES = libacl-plugin.la libattr-unique-plugin.la libchainingdb-plugin.la \ libcos-plugin.la libdes-plugin.la libdistrib-plugin.la \ @@ -970,7 +991,20 @@ schema_DATA = $(srcdir)/ldap/schema/00core.ldif \ $(srcdir)/ldap/schema/60pam-plugin.ldif \ $(srcdir)/ldap/schema/99user.ldif -bin_SCRIPTS = $(srcdir)/ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl +bin_SCRIPTS = $(srcdir)/ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl \ + wrappers/infadd \ + wrappers/ldclt \ + wrappers/rsearch + +server_SCRIPTS = wrappers/dbscan \ + wrappers/dsktune \ + wrappers/ds_newinst \ + wrappers/ldap-agent \ + wrappers/ldif \ + wrappers/migratecred \ + wrappers/mmldif \ + wrappers/pwdhash + #//////////////////////////////////////////////////////////////// # @@ -1708,6 +1742,28 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +wrappers/dbscan: $(top_builddir)/config.status $(top_srcdir)/wrappers/dbscan.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +wrappers/dsktune: $(top_builddir)/config.status $(top_srcdir)/wrappers/dsktune.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +wrappers/ds_newinst: $(top_builddir)/config.status $(top_srcdir)/wrappers/ds_newinst.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +wrappers/infadd: $(top_builddir)/config.status $(top_srcdir)/wrappers/infadd.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +wrappers/ldap-agent: $(top_builddir)/config.status $(top_srcdir)/wrappers/ldap-agent.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +wrappers/ldclt: $(top_builddir)/config.status $(top_srcdir)/wrappers/ldclt.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +wrappers/ldif: $(top_builddir)/config.status $(top_srcdir)/wrappers/ldif.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +wrappers/migratecred: $(top_builddir)/config.status $(top_srcdir)/wrappers/migratecred.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +wrappers/mmldif: $(top_builddir)/config.status $(top_srcdir)/wrappers/mmldif.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +wrappers/pwdhash: $(top_builddir)/config.status $(top_srcdir)/wrappers/pwdhash.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +wrappers/rsearch: $(top_builddir)/config.status $(top_srcdir)/wrappers/rsearch.in + cd $(top_builddir) && $(SHELL) ./config.status $@ clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -3444,6 +3500,25 @@ uninstall-binSCRIPTS: echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done +install-serverSCRIPTS: $(server_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(serverdir)" || $(mkdir_p) "$(DESTDIR)$(serverdir)" + @list='$(server_SCRIPTS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(serverSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(serverdir)/$$f'"; \ + $(serverSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(serverdir)/$$f"; \ + else :; fi; \ + done + +uninstall-serverSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(server_SCRIPTS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f '$(DESTDIR)$(serverdir)/$$f'"; \ + rm -f "$(DESTDIR)$(serverdir)/$$f"; \ + done mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -8488,7 +8563,7 @@ distclean-tags: distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) - $(mkdir_p) $(distdir)/m4 + $(mkdir_p) $(distdir)/m4 $(distdir)/wrappers @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ @@ -8618,7 +8693,7 @@ check: $(BUILT_SOURCES) all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) \ $(DATA) installdirs: - for dir in "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(serverplugindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(datadir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(schemadir)"; do \ + for dir in "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(serverplugindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(datadir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(schemadir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -8745,7 +8820,7 @@ info-am: install-data-am: install-configDATA install-dataDATA \ install-nodist_propertyDATA install-schemaDATA \ install-serverLTLIBRARIES install-serverPROGRAMS \ - install-serverpluginLTLIBRARIES + install-serverSCRIPTS install-serverpluginLTLIBRARIES install-exec-am: install-binPROGRAMS install-binSCRIPTS @@ -8779,7 +8854,7 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-configDATA uninstall-dataDATA uninstall-info-am \ uninstall-nodist_propertyDATA uninstall-schemaDATA \ uninstall-serverLTLIBRARIES uninstall-serverPROGRAMS \ - uninstall-serverpluginLTLIBRARIES + uninstall-serverSCRIPTS uninstall-serverpluginLTLIBRARIES .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool \ @@ -8795,15 +8870,16 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ install-exec-am install-info install-info-am install-man \ install-nodist_propertyDATA install-schemaDATA \ install-serverLTLIBRARIES install-serverPROGRAMS \ - install-serverpluginLTLIBRARIES install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-binSCRIPTS uninstall-configDATA uninstall-dataDATA \ - uninstall-info-am uninstall-nodist_propertyDATA \ - uninstall-schemaDATA uninstall-serverLTLIBRARIES \ - uninstall-serverPROGRAMS uninstall-serverpluginLTLIBRARIES + install-serverSCRIPTS install-serverpluginLTLIBRARIES \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-binSCRIPTS \ + uninstall-configDATA uninstall-dataDATA uninstall-info-am \ + uninstall-nodist_propertyDATA uninstall-schemaDATA \ + uninstall-serverLTLIBRARIES uninstall-serverPROGRAMS \ + uninstall-serverSCRIPTS uninstall-serverpluginLTLIBRARIES dirver.h: Makefile diff --git a/configure b/configure index de3148243..ec3f91745 100755 --- a/configure +++ b/configure @@ -464,8 +464,8 @@ ac_includes_default="\ # include <unistd.h> #endif" -ac_default_prefix="/opt/\$(PACKAGE)" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS platform_defs SOLARIS_TRUE SOLARIS_FALSE debug_defs PKG_CONFIG ICU_CONFIG NETSNMP_CONFIG nspr_inc nspr_lib nss_inc nss_lib ldapsdk_inc ldapsdk_lib db_inc db_incdir db_lib sasl_inc sasl_lib svrcore_inc svrcore_lib icu_lib icu_inc icu_bin netsnmp_inc netsnmp_lib netsnmp_link WINNT_TRUE WINNT_FALSE LTLIBOBJS' +ac_default_prefix=/opt/fedora-ds +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS platform_defs SOLARIS_TRUE SOLARIS_FALSE debug_defs PKG_CONFIG ICU_CONFIG NETSNMP_CONFIG nspr_inc nspr_lib nspr_libdir nss_inc nss_lib nss_libdir ldapsdk_inc ldapsdk_lib ldapsdk_libdir db_inc db_incdir db_lib db_libdir sasl_inc sasl_lib sasl_libdir svrcore_inc svrcore_lib icu_lib icu_inc icu_bin netsnmp_inc netsnmp_lib netsnmp_libdir netsnmp_link configdir propertydir schemadir serverdir serverplugindir WINNT_TRUE WINNT_FALSE LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1046,7 +1046,6 @@ Optional Packages: both] --with-tags[=TAGS] include additional configurations [automatic] - --with-brand=PATH Specify branding (fedora or redhat) --with-nspr=PATH Netscape Portable Runtime (NSPR) directory --with-nspr-inc=PATH Netscape Portable Runtime (NSPR) include file directory --with-nspr-lib=PATH Netscape Portable Runtime (NSPR) library directory @@ -4252,7 +4251,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4255 "configure"' > conftest.$ac_ext + echo '#line 4254 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5360,7 +5359,7 @@ fi # Provide some information about the compiler. -echo "$as_me:5363:" \ +echo "$as_me:5362:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 @@ -6394,11 +6393,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6397: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6396: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6401: \$? = $ac_status" >&5 + echo "$as_me:6400: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6627,11 +6626,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6630: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6629: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6634: \$? = $ac_status" >&5 + echo "$as_me:6633: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6687,11 +6686,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6690: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6689: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6694: \$? = $ac_status" >&5 + echo "$as_me:6693: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8021,7 +8020,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 8024 "configure"' > conftest.$ac_ext + echo '#line 8023 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -8892,7 +8891,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 8895 "configure" +#line 8894 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -8990,7 +8989,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 8993 "configure" +#line 8992 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11169,11 +11168,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11172: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11171: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11176: \$? = $ac_status" >&5 + echo "$as_me:11175: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -11229,11 +11228,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11232: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11231: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:11236: \$? = $ac_status" >&5 + echo "$as_me:11235: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -11740,7 +11739,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 11743 "configure"' > conftest.$ac_ext + echo '#line 11742 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -12611,7 +12610,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 12614 "configure" +#line 12613 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12709,7 +12708,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 12712 "configure" +#line 12711 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13536,11 +13535,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13539: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13538: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13543: \$? = $ac_status" >&5 + echo "$as_me:13542: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13596,11 +13595,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13599: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13598: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13603: \$? = $ac_status" >&5 + echo "$as_me:13602: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14910,7 +14909,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 14913 "configure"' > conftest.$ac_ext + echo '#line 14912 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -15651,11 +15650,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15654: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15653: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15658: \$? = $ac_status" >&5 + echo "$as_me:15657: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15884,11 +15883,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15887: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15886: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15891: \$? = $ac_status" >&5 + echo "$as_me:15890: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15944,11 +15943,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15947: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15946: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15951: \$? = $ac_status" >&5 + echo "$as_me:15950: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17278,7 +17277,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 17281 "configure"' > conftest.$ac_ext + echo '#line 17280 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -18149,7 +18148,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 18152 "configure" +#line 18151 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18247,7 +18246,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 18250 "configure" +#line 18249 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -23400,26 +23399,6 @@ echo "${ECHO_T}no" >&6 fi; -BRAND=fedora -echo "$as_me:$LINENO: checking for --with-brand" >&5 -echo $ECHO_N "checking for --with-brand... $ECHO_C" >&6 - -# Check whether --with-brand or --without-brand was given. -if test "${with_brand+set}" = set; then - withval="$with_brand" - - if test "$withval" - then - echo "$as_me:$LINENO: result: using $withval" >&5 -echo "${ECHO_T}using $withval" >&6 - BRAND="$withval" - fi - -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi; -PKGNAME=$BRAND-ds # Check for library dependencies @@ -23461,6 +23440,7 @@ echo "${ECHO_T}using $withval" >&6 NSPRDIR=$withval nspr_inc="-I$NSPRDIR/include" nspr_lib="-L$NSPRDIR/lib" + nspr_libdir="$NSPRDIR/lib" else echo { { echo "$as_me:$LINENO: error: $withval not found" >&5 @@ -23511,6 +23491,7 @@ if test "${with_nspr_lib+set}" = set; then echo "$as_me:$LINENO: result: using $withval" >&5 echo "${ECHO_T}using $withval" >&6 nspr_lib="-L$withval" + nspr_libdir="$withval" else echo { { echo "$as_me:$LINENO: error: $withval not found" >&5 @@ -23526,7 +23507,7 @@ fi; # if NSPR is not found yet, try pkg-config # last resort -if test -z "$nspr_inc" -o -z "$nspr_lib"; then +if test -z "$nspr_inc" -o -z "$nspr_lib" -o -z "$nspr_libdir"; then echo "$as_me:$LINENO: checking for nspr with pkg-config" >&5 echo $ECHO_N "checking for nspr with pkg-config... $ECHO_C" >&6 # Extract the first word of "pkg-config", so it can be a program name with args. @@ -23572,11 +23553,13 @@ fi if $PKG_CONFIG --exists nspr; then nspr_inc=`$PKG_CONFIG --cflags-only-I nspr` nspr_lib=`$PKG_CONFIG --libs-only-L nspr` + nspr_libdir=`$PKG_CONFIG --libs-only-L nspr | sed -e s/-L// | sed -e s/\ *$//` echo "$as_me:$LINENO: result: using system NSPR" >&5 echo "${ECHO_T}using system NSPR" >&6 elif $PKG_CONFIG --exists dirsec-nspr; then nspr_inc=`$PKG_CONFIG --cflags-only-I dirsec-nspr` nspr_lib=`$PKG_CONFIG --libs-only-L dirsec-nspr` + nspr_libdir=`$PKG_CONFIG --libs-only-L dirsec-nspr | sed -e s/-L// | sed -e s/\ *$//` echo "$as_me:$LINENO: result: using system dirsec NSPR" >&5 echo "${ECHO_T}using system dirsec NSPR" >&6 else @@ -23625,6 +23608,7 @@ echo "${ECHO_T}using $withval" >&6 NSSDIR=$withval nss_inc="-I$NSSDIR/include" nss_lib="-L$NSSDIR/lib" + nss_libdir="$NSSDIR/lib" else echo { { echo "$as_me:$LINENO: error: $withval not found" >&5 @@ -23675,6 +23659,7 @@ if test "${with_nss_lib+set}" = set; then echo "$as_me:$LINENO: result: using $withval" >&5 echo "${ECHO_T}using $withval" >&6 nss_lib="-L$withval" + nss_libdir="$withval" else echo { { echo "$as_me:$LINENO: error: $withval not found" >&5 @@ -23690,7 +23675,7 @@ fi; # if NSS is not found yet, try pkg-config # last resort -if test -z "$nss_inc" -o -z "$nss_lib"; then +if test -z "$nss_inc" -o -z "$nss_lib" -o -z "$nss_libdir"; then echo "$as_me:$LINENO: checking for nss with pkg-config" >&5 echo $ECHO_N "checking for nss with pkg-config... $ECHO_C" >&6 # Extract the first word of "pkg-config", so it can be a program name with args. @@ -23736,11 +23721,13 @@ fi if $PKG_CONFIG --exists nss; then nss_inc=`$PKG_CONFIG --cflags-only-I nss` nss_lib=`$PKG_CONFIG --libs-only-L nss` + nss_libdir=`$PKG_CONFIG --libs-only-L nss | sed -e s/-L// | sed -e s/\ *$//` echo "$as_me:$LINENO: result: using system NSS" >&5 echo "${ECHO_T}using system NSS" >&6 elif $PKG_CONFIG --exists dirsec-nss; then nss_inc=`$PKG_CONFIG --cflags-only-I dirsec-nss` nss_lib=`$PKG_CONFIG --libs-only-L dirsec-nss` + nss_libdir=`$PKG_CONFIG --libs-only-L dirsec-nss | sed -e s/-L// | sed -e s/\ *$//` echo "$as_me:$LINENO: result: using system dirsec NSS" >&5 echo "${ECHO_T}using system dirsec NSS" >&6 else @@ -23789,6 +23776,7 @@ echo "${ECHO_T}using $withval" >&6 LDAPSDKDIR=$withval ldapsdk_inc="-I$LDAPSDKDIR/include" ldapsdk_lib="-L$LDAPSDKDIR/lib" + ldapsdk_libdir="$LDAPSDKDIR/lib" else echo { { echo "$as_me:$LINENO: error: $withval not found" >&5 @@ -23839,6 +23827,7 @@ if test "${with_ldapsdk_lib+set}" = set; then echo "$as_me:$LINENO: result: using $withval" >&5 echo "${ECHO_T}using $withval" >&6 ldapsdk_lib="-L$withval" + ldapsdk_libdir="$withval" else echo { { echo "$as_me:$LINENO: error: $withval not found" >&5 @@ -23854,7 +23843,7 @@ fi; # if LDAPSDK is not found yet, try pkg-config # last resort -if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib"; then +if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib" -o -z "$ldapsdk_libdir"; then echo "$as_me:$LINENO: checking for mozldap with pkg-config" >&5 echo $ECHO_N "checking for mozldap with pkg-config... $ECHO_C" >&6 # Extract the first word of "pkg-config", so it can be a program name with args. @@ -23900,6 +23889,7 @@ fi if $PKG_CONFIG --exists mozldap6; then ldapsdk_inc=`$PKG_CONFIG --cflags-only-I mozldap6` ldapsdk_lib=`$PKG_CONFIG --libs-only-L mozldap6` + ldapsdk_libdir=`$PKG_CONFIG --libs-only-L mozldap6 | sed -e s/-L// | sed -e s/\ *$//` echo "$as_me:$LINENO: result: using system mozldap6" >&5 echo "${ECHO_T}using system mozldap6" >&6 else @@ -24029,6 +24019,7 @@ echo "$as_me: error: db.h not found" >&2;} echo "${ECHO_T}using $withval" >&6 DBDIR=$withval db_lib="-L$DBDIR/lib" + db_libdir="$DBDIR/lib" db_incdir="$DBDIR/include" if ! test -e "$db_incdir/db.h" ; then { { echo "$as_me:$LINENO: error: $withval include dir not found" >&5 @@ -24109,6 +24100,7 @@ echo "$as_me: error: sasl.h not found" >&2;} fi sasl_lib="-L$withval/lib" + sasl_libdir="$withval/lib" else echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 @@ -24156,6 +24148,7 @@ if test "${with_sasl_lib+set}" = set; then echo "$as_me:$LINENO: result: using $withval" >&5 echo "${ECHO_T}using $withval" >&6 sasl_lib="-L$withval" + sasl_libdir="$withval" else echo { { echo "$as_me:$LINENO: error: $withval not found" >&5 @@ -24787,6 +24780,7 @@ echo "$as_me: error: net-snmp-config.h not found" >&2;} fi netsnmp_lib="-L$withval/lib" + netsnmp_libdir="$withval/lib" else echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 @@ -24835,6 +24829,7 @@ if test "${with_netsnmp_lib+set}" = set; then echo "$as_me:$LINENO: result: using $withval" >&5 echo "${ECHO_T}using $withval" >&6 netsnmp_lib="-L$withval" + netsnmp_libdir="$withval" else echo { { echo "$as_me:$LINENO: error: $withval not found" >&5 @@ -24945,6 +24940,28 @@ fi + + + + + + +# installation paths +bindir=/usr/bin +configdir=/fedora-ds/config +datadir=/usr/share/fedora-ds/data +propertydir=/fedora-ds/property +schemadir=/fedora-ds/schema +serverdir=/usr/lib/fedora-ds +serverplugindir=/usr/lib/fedora-ds/plugins + + + + + + + + # WINNT should be true if building on Windows system not using # cygnus, mingw, or the like and using cmd.exe as the shell @@ -24960,6 +24977,28 @@ fi ac_config_files="$ac_config_files Makefile" + ac_config_files="$ac_config_files wrappers/dbscan" + + ac_config_files="$ac_config_files wrappers/dsktune" + + ac_config_files="$ac_config_files wrappers/ds_newinst" + + ac_config_files="$ac_config_files wrappers/infadd" + + ac_config_files="$ac_config_files wrappers/ldap-agent" + + ac_config_files="$ac_config_files wrappers/ldclt" + + ac_config_files="$ac_config_files wrappers/ldif" + + ac_config_files="$ac_config_files wrappers/migratecred" + + ac_config_files="$ac_config_files wrappers/mmldif" + + ac_config_files="$ac_config_files wrappers/pwdhash" + + ac_config_files="$ac_config_files wrappers/rsearch" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -25557,6 +25596,17 @@ do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "wrappers/dbscan" ) CONFIG_FILES="$CONFIG_FILES wrappers/dbscan" ;; + "wrappers/dsktune" ) CONFIG_FILES="$CONFIG_FILES wrappers/dsktune" ;; + "wrappers/ds_newinst" ) CONFIG_FILES="$CONFIG_FILES wrappers/ds_newinst" ;; + "wrappers/infadd" ) CONFIG_FILES="$CONFIG_FILES wrappers/infadd" ;; + "wrappers/ldap-agent" ) CONFIG_FILES="$CONFIG_FILES wrappers/ldap-agent" ;; + "wrappers/ldclt" ) CONFIG_FILES="$CONFIG_FILES wrappers/ldclt" ;; + "wrappers/ldif" ) CONFIG_FILES="$CONFIG_FILES wrappers/ldif" ;; + "wrappers/migratecred" ) CONFIG_FILES="$CONFIG_FILES wrappers/migratecred" ;; + "wrappers/mmldif" ) CONFIG_FILES="$CONFIG_FILES wrappers/mmldif" ;; + "wrappers/pwdhash" ) CONFIG_FILES="$CONFIG_FILES wrappers/pwdhash" ;; + "wrappers/rsearch" ) CONFIG_FILES="$CONFIG_FILES wrappers/rsearch" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} @@ -25717,15 +25767,20 @@ s,@ICU_CONFIG@,$ICU_CONFIG,;t t s,@NETSNMP_CONFIG@,$NETSNMP_CONFIG,;t t s,@nspr_inc@,$nspr_inc,;t t s,@nspr_lib@,$nspr_lib,;t t +s,@nspr_libdir@,$nspr_libdir,;t t s,@nss_inc@,$nss_inc,;t t s,@nss_lib@,$nss_lib,;t t +s,@nss_libdir@,$nss_libdir,;t t s,@ldapsdk_inc@,$ldapsdk_inc,;t t s,@ldapsdk_lib@,$ldapsdk_lib,;t t +s,@ldapsdk_libdir@,$ldapsdk_libdir,;t t s,@db_inc@,$db_inc,;t t s,@db_incdir@,$db_incdir,;t t s,@db_lib@,$db_lib,;t t +s,@db_libdir@,$db_libdir,;t t s,@sasl_inc@,$sasl_inc,;t t s,@sasl_lib@,$sasl_lib,;t t +s,@sasl_libdir@,$sasl_libdir,;t t s,@svrcore_inc@,$svrcore_inc,;t t s,@svrcore_lib@,$svrcore_lib,;t t s,@icu_lib@,$icu_lib,;t t @@ -25733,7 +25788,13 @@ s,@icu_inc@,$icu_inc,;t t s,@icu_bin@,$icu_bin,;t t s,@netsnmp_inc@,$netsnmp_inc,;t t s,@netsnmp_lib@,$netsnmp_lib,;t t +s,@netsnmp_libdir@,$netsnmp_libdir,;t t s,@netsnmp_link@,$netsnmp_link,;t t +s,@configdir@,$configdir,;t t +s,@propertydir@,$propertydir,;t t +s,@schemadir@,$schemadir,;t t +s,@serverdir@,$serverdir,;t t +s,@serverplugindir@,$serverplugindir,;t t s,@WINNT_TRUE@,$WINNT_TRUE,;t t s,@WINNT_FALSE@,$WINNT_FALSE,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t diff --git a/configure.ac b/configure.ac index 1e3f5ecc4..1e63e72f2 100644 --- a/configure.ac +++ b/configure.ac @@ -82,19 +82,7 @@ AC_ARG_ENABLE(debug, [ --enable-debug Enable debug features], ]) AC_SUBST([debug_defs]) -BRAND=fedora -AC_MSG_CHECKING(for --with-brand) -AC_ARG_WITH(brand, [ --with-brand=PATH Specify branding (fedora or redhat)], -[ - if test "$withval" - then - AC_MSG_RESULT([using $withval]) - BRAND="$withval" - fi -], -AC_MSG_RESULT(no)) -PKGNAME=$BRAND-ds -AC_PREFIX_DEFAULT("/opt/\$(PACKAGE)") +AC_PREFIX_DEFAULT([/opt/fedora-ds]) # Check for library dependencies m4_include(m4/nspr.m4) @@ -109,15 +97,20 @@ m4_include(m4/netsnmp.m4) # write out paths for binary components AC_SUBST(nspr_inc) AC_SUBST(nspr_lib) +AC_SUBST(nspr_libdir) AC_SUBST(nss_inc) AC_SUBST(nss_lib) +AC_SUBST(nss_libdir) AC_SUBST(ldapsdk_inc) AC_SUBST(ldapsdk_lib) +AC_SUBST(ldapsdk_libdir) AC_SUBST(db_inc) AC_SUBST(db_incdir) AC_SUBST(db_lib) +AC_SUBST(db_libdir) AC_SUBST(sasl_inc) AC_SUBST(sasl_lib) +AC_SUBST(sasl_libdir) AC_SUBST(svrcore_inc) AC_SUBST(svrcore_lib) AC_SUBST(icu_lib) @@ -125,11 +118,39 @@ AC_SUBST(icu_inc) AC_SUBST(icu_bin) AC_SUBST(netsnmp_inc) AC_SUBST(netsnmp_lib) +AC_SUBST(netsnmp_libdir) AC_SUBST(netsnmp_link) +# installation paths +bindir=/usr/bin +configdir=/fedora-ds/config +datadir=/usr/share/fedora-ds/data +propertydir=/fedora-ds/property +schemadir=/fedora-ds/schema +serverdir=/usr/lib/fedora-ds +serverplugindir=/usr/lib/fedora-ds/plugins +AC_SUBST(bindir) +AC_SUBST(configdir) +AC_SUBST(datadir) +AC_SUBST(propertydir) +AC_SUBST(schemadir) +AC_SUBST(serverdir) +AC_SUBST(serverplugindir) + # WINNT should be true if building on Windows system not using # cygnus, mingw, or the like and using cmd.exe as the shell AM_CONDITIONAL([WINNT], false) AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([wrappers/dbscan]) +AC_CONFIG_FILES([wrappers/dsktune]) +AC_CONFIG_FILES([wrappers/ds_newinst]) +AC_CONFIG_FILES([wrappers/infadd]) +AC_CONFIG_FILES([wrappers/ldap-agent]) +AC_CONFIG_FILES([wrappers/ldclt]) +AC_CONFIG_FILES([wrappers/ldif]) +AC_CONFIG_FILES([wrappers/migratecred]) +AC_CONFIG_FILES([wrappers/mmldif]) +AC_CONFIG_FILES([wrappers/pwdhash]) +AC_CONFIG_FILES([wrappers/rsearch]) AC_OUTPUT diff --git a/m4/db.m4 b/m4/db.m4 index 376aed750..8d520c542 100644 --- a/m4/db.m4 +++ b/m4/db.m4 @@ -38,6 +38,7 @@ AC_ARG_WITH(db, [ --with-db=PATH Berkeley DB directory], dnl - check the user provided location DBDIR=$withval db_lib="-L$DBDIR/lib" + db_libdir="$DBDIR/lib" db_incdir="$DBDIR/include" if ! test -e "$db_incdir/db.h" ; then AC_MSG_ERROR([$withval include dir not found]) diff --git a/m4/mozldap.m4 b/m4/mozldap.m4 index c93619872..8007ad270 100644 --- a/m4/mozldap.m4 +++ b/m4/mozldap.m4 @@ -30,6 +30,7 @@ AC_ARG_WITH(ldapsdk, [ --with-ldapsdk=PATH Mozilla LDAP SDK directory], LDAPSDKDIR=$withval ldapsdk_inc="-I$LDAPSDKDIR/include" ldapsdk_lib="-L$LDAPSDKDIR/lib" + ldapsdk_libdir="$LDAPSDKDIR/lib" else echo AC_MSG_ERROR([$withval not found]) @@ -60,6 +61,7 @@ AC_ARG_WITH(ldapsdk-lib, [ --with-ldapsdk-lib=PATH Mozilla LDAP SDK library then AC_MSG_RESULT([using $withval]) ldapsdk_lib="-L$withval" + ldapsdk_libdir="$withval" else echo AC_MSG_ERROR([$withval not found]) @@ -70,13 +72,14 @@ AC_MSG_RESULT(no)) # if LDAPSDK is not found yet, try pkg-config # last resort -if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib"; then +if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib" -o -z "$ldapsdk_libdir"; then AC_MSG_CHECKING(for mozldap with pkg-config) AC_PATH_PROG(PKG_CONFIG, pkg-config) if test -n "$PKG_CONFIG"; then if $PKG_CONFIG --exists mozldap6; then ldapsdk_inc=`$PKG_CONFIG --cflags-only-I mozldap6` ldapsdk_lib=`$PKG_CONFIG --libs-only-L mozldap6` + ldapsdk_libdir=`$PKG_CONFIG --libs-only-L mozldap6 | sed -e s/-L// | sed -e s/\ *$//` AC_MSG_RESULT([using system mozldap6]) else AC_MSG_ERROR([LDAPSDK not found, specify with --with-ldapsdk[-inc|-lib].]) diff --git a/m4/netsnmp.m4 b/m4/netsnmp.m4 index 787801d51..d8f32f444 100644 --- a/m4/netsnmp.m4 +++ b/m4/netsnmp.m4 @@ -35,6 +35,7 @@ AC_ARG_WITH(netsnmp, [ --with-netsnmp=PATH Net-SNMP directory], fi netsnmp_lib="-L$withval/lib" + netsnmp_libdir="$withval/lib" else AC_MSG_RESULT(yes) AC_MSG_ERROR([$withval not found]) @@ -64,6 +65,7 @@ AC_ARG_WITH(netsnmp-lib, [ --with-netsnmp-lib=PATH Net-SNMP library directo then AC_MSG_RESULT([using $withval]) netsnmp_lib="-L$withval" + netsnmp_libdir="$withval" else echo AC_MSG_ERROR([$withval not found]) diff --git a/m4/nspr.m4 b/m4/nspr.m4 index 81230f66d..72eee27fd 100644 --- a/m4/nspr.m4 +++ b/m4/nspr.m4 @@ -30,6 +30,7 @@ AC_ARG_WITH(nspr, [ --with-nspr=PATH Netscape Portable Runtime (NSPR) di NSPRDIR=$withval nspr_inc="-I$NSPRDIR/include" nspr_lib="-L$NSPRDIR/lib" + nspr_libdir="$NSPRDIR/lib" else echo AC_MSG_ERROR([$withval not found]) @@ -60,6 +61,7 @@ AC_ARG_WITH(nspr-lib, [ --with-nspr-lib=PATH Netscape Portable Runtime ( then AC_MSG_RESULT([using $withval]) nspr_lib="-L$withval" + nspr_libdir="$withval" else echo AC_MSG_ERROR([$withval not found]) @@ -70,17 +72,19 @@ AC_MSG_RESULT(no)) # if NSPR is not found yet, try pkg-config # last resort -if test -z "$nspr_inc" -o -z "$nspr_lib"; then +if test -z "$nspr_inc" -o -z "$nspr_lib" -o -z "$nspr_libdir"; then AC_MSG_CHECKING(for nspr with pkg-config) AC_PATH_PROG(PKG_CONFIG, pkg-config) if test -n "$PKG_CONFIG"; then if $PKG_CONFIG --exists nspr; then nspr_inc=`$PKG_CONFIG --cflags-only-I nspr` nspr_lib=`$PKG_CONFIG --libs-only-L nspr` + nspr_libdir=`$PKG_CONFIG --libs-only-L nspr | sed -e s/-L// | sed -e s/\ *$//` AC_MSG_RESULT([using system NSPR]) elif $PKG_CONFIG --exists dirsec-nspr; then nspr_inc=`$PKG_CONFIG --cflags-only-I dirsec-nspr` nspr_lib=`$PKG_CONFIG --libs-only-L dirsec-nspr` + nspr_libdir=`$PKG_CONFIG --libs-only-L dirsec-nspr | sed -e s/-L// | sed -e s/\ *$//` AC_MSG_RESULT([using system dirsec NSPR]) else AC_MSG_ERROR([NSPR not found, specify with --with-nspr.]) diff --git a/m4/nss.m4 b/m4/nss.m4 index a1bf803da..b4e1e9931 100644 --- a/m4/nss.m4 +++ b/m4/nss.m4 @@ -30,6 +30,7 @@ AC_ARG_WITH(nss, [ --with-nss=PATH Network Security Services (NSS) dire NSSDIR=$withval nss_inc="-I$NSSDIR/include" nss_lib="-L$NSSDIR/lib" + nss_libdir="$NSSDIR/lib" else echo AC_MSG_ERROR([$withval not found]) @@ -60,6 +61,7 @@ AC_ARG_WITH(nss-lib, [ --with-nss-lib=PATH Network Security Services (N then AC_MSG_RESULT([using $withval]) nss_lib="-L$withval" + nss_libdir="$withval" else echo AC_MSG_ERROR([$withval not found]) @@ -70,17 +72,19 @@ AC_MSG_RESULT(no)) # if NSS is not found yet, try pkg-config # last resort -if test -z "$nss_inc" -o -z "$nss_lib"; then +if test -z "$nss_inc" -o -z "$nss_lib" -o -z "$nss_libdir"; then AC_MSG_CHECKING(for nss with pkg-config) AC_PATH_PROG(PKG_CONFIG, pkg-config) if test -n "$PKG_CONFIG"; then if $PKG_CONFIG --exists nss; then nss_inc=`$PKG_CONFIG --cflags-only-I nss` nss_lib=`$PKG_CONFIG --libs-only-L nss` + nss_libdir=`$PKG_CONFIG --libs-only-L nss | sed -e s/-L// | sed -e s/\ *$//` AC_MSG_RESULT([using system NSS]) elif $PKG_CONFIG --exists dirsec-nss; then nss_inc=`$PKG_CONFIG --cflags-only-I dirsec-nss` nss_lib=`$PKG_CONFIG --libs-only-L dirsec-nss` + nss_libdir=`$PKG_CONFIG --libs-only-L dirsec-nss | sed -e s/-L// | sed -e s/\ *$//` AC_MSG_RESULT([using system dirsec NSS]) else AC_MSG_ERROR([NSS not found, specify with --with-nss.]) diff --git a/m4/sasl.m4 b/m4/sasl.m4 index 73e86dcba..beb96a3ab 100644 --- a/m4/sasl.m4 +++ b/m4/sasl.m4 @@ -42,6 +42,7 @@ AC_ARG_WITH(sasl, fi sasl_lib="-L$withval/lib" + sasl_libdir="$withval/lib" else AC_MSG_RESULT(yes) AC_MSG_ERROR([sasl not found in $withval]) @@ -70,6 +71,7 @@ AC_ARG_WITH(sasl-lib, if test -d "$withval"; then AC_MSG_RESULT([using $withval]) sasl_lib="-L$withval" + sasl_libdir="$withval" else echo AC_MSG_ERROR([$withval not found]) diff --git a/wrappers/dbscan.in b/wrappers/dbscan.in new file mode 100755 index 000000000..5592a1b6e --- /dev/null +++ b/wrappers/dbscan.in @@ -0,0 +1,58 @@ +#!/bin/sh + +############################################################################### +## (1) Specify variables used by this script. ## +############################################################################### + +LIB_DIR=@nspr_libdir@:@db_libdir@ +BIN_DIR=@prefix@@serverdir@ +COMMAND=dbscan-bin + + +############################################################################### +## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## +## search order this command wrapper uses to find shared libraries. ## +############################################################################### + +LD_LIBRARY_PATH=${LIB_DIR} +export LD_LIBRARY_PATH + + +############################################################################### +## (3) Set the PATH environment variable to determine the search ## +## order this command wrapper uses to find binary executables. ## +## ## +## NOTE: Since the wrappers themselves are ALWAYS located in ## +## "/usr/bin", this directory will always be excluded ## +## from the search path. Since "/bin" is nothing more ## +## than a symbolic link to "/usr/bin" on Solaris, this ## +## directory will also always be excluded from the search ## +## path on this platform. ## +############################################################################### + +PATH=${BIN_DIR} +export PATH + + +############################################################################### +## (4) Execute the binary executable specified by this command wrapper ## +## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## +############################################################################### + +ORIGINAL_IFS=${IFS} +IFS=: + +for dir in ${PATH} +do + if [ -x ${dir}/${COMMAND} ] + then + IFS=${ORIGINAL_IFS} + ${dir}/${COMMAND} "$@" + exit $? + fi +done + +echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" + +exit 255 + diff --git a/wrappers/ds_newinst.in b/wrappers/ds_newinst.in new file mode 100755 index 000000000..760144a7e --- /dev/null +++ b/wrappers/ds_newinst.in @@ -0,0 +1,58 @@ +#!/bin/sh + +############################################################################### +## (1) Specify variables used by this script. ## +############################################################################### + +LIB_DIR=@nss_libdir@:@nspr_libdir@:@ldapsdk_libdir@:@sasl_libdir@:@prefix@@serverdir@ +BIN_DIR=@prefix@@serverdir@ +COMMAND=ds_newinst-bin + + +############################################################################### +## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## +## search order this command wrapper uses to find shared libraries. ## +############################################################################### + +LD_LIBRARY_PATH=${LIB_DIR} +export LD_LIBRARY_PATH + + +############################################################################### +## (3) Set the PATH environment variable to determine the search ## +## order this command wrapper uses to find binary executables. ## +## ## +## NOTE: Since the wrappers themselves are ALWAYS located in ## +## "/usr/bin", this directory will always be excluded ## +## from the search path. Since "/bin" is nothing more ## +## than a symbolic link to "/usr/bin" on Solaris, this ## +## directory will also always be excluded from the search ## +## path on this platform. ## +############################################################################### + +PATH=${BIN_DIR} +export PATH + + +############################################################################### +## (4) Execute the binary executable specified by this command wrapper ## +## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## +############################################################################### + +ORIGINAL_IFS=${IFS} +IFS=: + +for dir in ${PATH} +do + if [ -x ${dir}/${COMMAND} ] + then + IFS=${ORIGINAL_IFS} + ${dir}/${COMMAND} "$@" + exit $? + fi +done + +echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" + +exit 255 + diff --git a/wrappers/dsktune.in b/wrappers/dsktune.in new file mode 100755 index 000000000..bb0b6ba2e --- /dev/null +++ b/wrappers/dsktune.in @@ -0,0 +1,58 @@ +#!/bin/sh + +############################################################################### +## (1) Specify variables used by this script. ## +############################################################################### + +LIB_DIR= +BIN_DIR=@prefix@@serverdir@ +COMMAND=dsktune-bin + + +############################################################################### +## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## +## search order this command wrapper uses to find shared libraries. ## +############################################################################### + +LD_LIBRARY_PATH=${LIB_DIR} +export LD_LIBRARY_PATH + + +############################################################################### +## (3) Set the PATH environment variable to determine the search ## +## order this command wrapper uses to find binary executables. ## +## ## +## NOTE: Since the wrappers themselves are ALWAYS located in ## +## "/usr/bin", this directory will always be excluded ## +## from the search path. Since "/bin" is nothing more ## +## than a symbolic link to "/usr/bin" on Solaris, this ## +## directory will also always be excluded from the search ## +## path on this platform. ## +############################################################################### + +PATH=${BIN_DIR} +export PATH + + +############################################################################### +## (4) Execute the binary executable specified by this command wrapper ## +## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## +############################################################################### + +ORIGINAL_IFS=${IFS} +IFS=: + +for dir in ${PATH} +do + if [ -x ${dir}/${COMMAND} ] + then + IFS=${ORIGINAL_IFS} + ${dir}/${COMMAND} "$@" + exit $? + fi +done + +echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" + +exit 255 + diff --git a/wrappers/infadd.in b/wrappers/infadd.in new file mode 100755 index 000000000..dd6df8c49 --- /dev/null +++ b/wrappers/infadd.in @@ -0,0 +1,58 @@ +#!/bin/sh + +############################################################################### +## (1) Specify variables used by this script. ## +############################################################################### + +LIB_DIR=@nss_libdir@:@nspr_libdir@:@ldapsdk_libdir@:@sasl_libdir@ +BIN_DIR=@prefix@@bindir@ +COMMAND=infadd-bin + + +############################################################################### +## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## +## search order this command wrapper uses to find shared libraries. ## +############################################################################### + +LD_LIBRARY_PATH=${LIB_DIR} +export LD_LIBRARY_PATH + + +############################################################################### +## (3) Set the PATH environment variable to determine the search ## +## order this command wrapper uses to find binary executables. ## +## ## +## NOTE: Since the wrappers themselves are ALWAYS located in ## +## "/usr/bin", this directory will always be excluded ## +## from the search path. Since "/bin" is nothing more ## +## than a symbolic link to "/usr/bin" on Solaris, this ## +## directory will also always be excluded from the search ## +## path on this platform. ## +############################################################################### + +PATH=${BIN_DIR} +export PATH + + +############################################################################### +## (4) Execute the binary executable specified by this command wrapper ## +## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## +############################################################################### + +ORIGINAL_IFS=${IFS} +IFS=: + +for dir in ${PATH} +do + if [ -x ${dir}/${COMMAND} ] + then + IFS=${ORIGINAL_IFS} + ${dir}/${COMMAND} "$@" + exit $? + fi +done + +echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" + +exit 255 + diff --git a/wrappers/ldap-agent.in b/wrappers/ldap-agent.in new file mode 100755 index 000000000..3bd2ae112 --- /dev/null +++ b/wrappers/ldap-agent.in @@ -0,0 +1,58 @@ +#!/bin/sh + +############################################################################### +## (1) Specify variables used by this script. ## +############################################################################### + +LIB_DIR=@netsnmp_libdir@ +BIN_DIR=@prefix@@serverdir@ +COMMAND=ldap-agent-bin + + +############################################################################### +## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## +## search order this command wrapper uses to find shared libraries. ## +############################################################################### + +LD_LIBRARY_PATH=${LIB_DIR} +export LD_LIBRARY_PATH + + +############################################################################### +## (3) Set the PATH environment variable to determine the search ## +## order this command wrapper uses to find binary executables. ## +## ## +## NOTE: Since the wrappers themselves are ALWAYS located in ## +## "/usr/bin", this directory will always be excluded ## +## from the search path. Since "/bin" is nothing more ## +## than a symbolic link to "/usr/bin" on Solaris, this ## +## directory will also always be excluded from the search ## +## path on this platform. ## +############################################################################### + +PATH=${BIN_DIR} +export PATH + + +############################################################################### +## (4) Execute the binary executable specified by this command wrapper ## +## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## +############################################################################### + +ORIGINAL_IFS=${IFS} +IFS=: + +for dir in ${PATH} +do + if [ -x ${dir}/${COMMAND} ] + then + IFS=${ORIGINAL_IFS} + ${dir}/${COMMAND} "$@" + exit $? + fi +done + +echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" + +exit 255 + diff --git a/wrappers/ldclt.in b/wrappers/ldclt.in new file mode 100755 index 000000000..cbea22fe4 --- /dev/null +++ b/wrappers/ldclt.in @@ -0,0 +1,58 @@ +#!/bin/sh + +############################################################################### +## (1) Specify variables used by this script. ## +############################################################################### + +LIB_DIR=@nss_libdir@:@nspr_libdir@:@ldapsdk_libdir@:@sasl_libdir@ +BIN_DIR=@prefix@@bindir@ +COMMAND=ldclt-bin + + +############################################################################### +## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## +## search order this command wrapper uses to find shared libraries. ## +############################################################################### + +LD_LIBRARY_PATH=${LIB_DIR} +export LD_LIBRARY_PATH + + +############################################################################### +## (3) Set the PATH environment variable to determine the search ## +## order this command wrapper uses to find binary executables. ## +## ## +## NOTE: Since the wrappers themselves are ALWAYS located in ## +## "/usr/bin", this directory will always be excluded ## +## from the search path. Since "/bin" is nothing more ## +## than a symbolic link to "/usr/bin" on Solaris, this ## +## directory will also always be excluded from the search ## +## path on this platform. ## +############################################################################### + +PATH=${BIN_DIR} +export PATH + + +############################################################################### +## (4) Execute the binary executable specified by this command wrapper ## +## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## +############################################################################### + +ORIGINAL_IFS=${IFS} +IFS=: + +for dir in ${PATH} +do + if [ -x ${dir}/${COMMAND} ] + then + IFS=${ORIGINAL_IFS} + ${dir}/${COMMAND} "$@" + exit $? + fi +done + +echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" + +exit 255 + diff --git a/wrappers/ldif.in b/wrappers/ldif.in new file mode 100755 index 000000000..6f52692c1 --- /dev/null +++ b/wrappers/ldif.in @@ -0,0 +1,58 @@ +#!/bin/sh + +############################################################################### +## (1) Specify variables used by this script. ## +############################################################################### + +LIB_DIR=@nss_libdir@:@nspr_libdir@:@ldapsdk_libdir@:@sasl_libdir@ +BIN_DIR=@prefix@@serverdir@ +COMMAND=ldif-bin + + +############################################################################### +## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## +## search order this command wrapper uses to find shared libraries. ## +############################################################################### + +LD_LIBRARY_PATH=${LIB_DIR} +export LD_LIBRARY_PATH + + +############################################################################### +## (3) Set the PATH environment variable to determine the search ## +## order this command wrapper uses to find binary executables. ## +## ## +## NOTE: Since the wrappers themselves are ALWAYS located in ## +## "/usr/bin", this directory will always be excluded ## +## from the search path. Since "/bin" is nothing more ## +## than a symbolic link to "/usr/bin" on Solaris, this ## +## directory will also always be excluded from the search ## +## path on this platform. ## +############################################################################### + +PATH=${BIN_DIR} +export PATH + + +############################################################################### +## (4) Execute the binary executable specified by this command wrapper ## +## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## +############################################################################### + +ORIGINAL_IFS=${IFS} +IFS=: + +for dir in ${PATH} +do + if [ -x ${dir}/${COMMAND} ] + then + IFS=${ORIGINAL_IFS} + ${dir}/${COMMAND} "$@" + exit $? + fi +done + +echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" + +exit 255 + diff --git a/wrappers/migratecred.in b/wrappers/migratecred.in new file mode 100755 index 000000000..ca8e7bde6 --- /dev/null +++ b/wrappers/migratecred.in @@ -0,0 +1,58 @@ +#!/bin/sh + +############################################################################### +## (1) Specify variables used by this script. ## +############################################################################### + +LIB_DIR=@nss_libdir@:@nspr_libdir@:@ldapsdk_libdir@:@sasl_libdir@ +BIN_DIR=@prefix@@serverdir@ +COMMAND=migratecred-bin + + +############################################################################### +## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## +## search order this command wrapper uses to find shared libraries. ## +############################################################################### + +LD_LIBRARY_PATH=${LIB_DIR} +export LD_LIBRARY_PATH + + +############################################################################### +## (3) Set the PATH environment variable to determine the search ## +## order this command wrapper uses to find binary executables. ## +## ## +## NOTE: Since the wrappers themselves are ALWAYS located in ## +## "/usr/bin", this directory will always be excluded ## +## from the search path. Since "/bin" is nothing more ## +## than a symbolic link to "/usr/bin" on Solaris, this ## +## directory will also always be excluded from the search ## +## path on this platform. ## +############################################################################### + +PATH=${BIN_DIR} +export PATH + + +############################################################################### +## (4) Execute the binary executable specified by this command wrapper ## +## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## +############################################################################### + +ORIGINAL_IFS=${IFS} +IFS=: + +for dir in ${PATH} +do + if [ -x ${dir}/${COMMAND} ] + then + IFS=${ORIGINAL_IFS} + ${dir}/${COMMAND} "$@" + exit $? + fi +done + +echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" + +exit 255 + diff --git a/wrappers/mmldif.in b/wrappers/mmldif.in new file mode 100755 index 000000000..55df10b35 --- /dev/null +++ b/wrappers/mmldif.in @@ -0,0 +1,58 @@ +#!/bin/sh + +############################################################################### +## (1) Specify variables used by this script. ## +############################################################################### + +LIB_DIR=@nss_libdir@:@nspr_libdir@:@ldapsdk_libdir@:@sasl_libdir@ +BIN_DIR=@prefix@@serverdir@ +COMMAND=mmldif-bin + + +############################################################################### +## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## +## search order this command wrapper uses to find shared libraries. ## +############################################################################### + +LD_LIBRARY_PATH=${LIB_DIR} +export LD_LIBRARY_PATH + + +############################################################################### +## (3) Set the PATH environment variable to determine the search ## +## order this command wrapper uses to find binary executables. ## +## ## +## NOTE: Since the wrappers themselves are ALWAYS located in ## +## "/usr/bin", this directory will always be excluded ## +## from the search path. Since "/bin" is nothing more ## +## than a symbolic link to "/usr/bin" on Solaris, this ## +## directory will also always be excluded from the search ## +## path on this platform. ## +############################################################################### + +PATH=${BIN_DIR} +export PATH + + +############################################################################### +## (4) Execute the binary executable specified by this command wrapper ## +## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## +############################################################################### + +ORIGINAL_IFS=${IFS} +IFS=: + +for dir in ${PATH} +do + if [ -x ${dir}/${COMMAND} ] + then + IFS=${ORIGINAL_IFS} + ${dir}/${COMMAND} "$@" + exit $? + fi +done + +echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" + +exit 255 + diff --git a/wrappers/pwdhash.in b/wrappers/pwdhash.in new file mode 100755 index 000000000..b63945215 --- /dev/null +++ b/wrappers/pwdhash.in @@ -0,0 +1,58 @@ +#!/bin/sh + +############################################################################### +## (1) Specify variables used by this script. ## +############################################################################### + +LIB_DIR=@nss_libdir@:@nspr_libdir@:@ldapsdk_libdir@:@sasl_libdir@ +BIN_DIR=@prefix@@serverdir@ +COMMAND=pwdhash-bin + + +############################################################################### +## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## +## search order this command wrapper uses to find shared libraries. ## +############################################################################### + +LD_LIBRARY_PATH=${LIB_DIR} +export LD_LIBRARY_PATH + + +############################################################################### +## (3) Set the PATH environment variable to determine the search ## +## order this command wrapper uses to find binary executables. ## +## ## +## NOTE: Since the wrappers themselves are ALWAYS located in ## +## "/usr/bin", this directory will always be excluded ## +## from the search path. Since "/bin" is nothing more ## +## than a symbolic link to "/usr/bin" on Solaris, this ## +## directory will also always be excluded from the search ## +## path on this platform. ## +############################################################################### + +PATH=${BIN_DIR} +export PATH + + +############################################################################### +## (4) Execute the binary executable specified by this command wrapper ## +## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## +############################################################################### + +ORIGINAL_IFS=${IFS} +IFS=: + +for dir in ${PATH} +do + if [ -x ${dir}/${COMMAND} ] + then + IFS=${ORIGINAL_IFS} + ${dir}/${COMMAND} "$@" + exit $? + fi +done + +echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" + +exit 255 + diff --git a/wrappers/rsearch.in b/wrappers/rsearch.in new file mode 100755 index 000000000..fd776d4eb --- /dev/null +++ b/wrappers/rsearch.in @@ -0,0 +1,58 @@ +#!/bin/sh + +############################################################################### +## (1) Specify variables used by this script. ## +############################################################################### + +LIB_DIR=@nss_libdir@:@nspr_libdir@:@ldapsdk_libdir@:@sasl_libdir@ +BIN_DIR=@prefix@@bindir@ +COMMAND=rsearch-bin + + +############################################################################### +## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## +## search order this command wrapper uses to find shared libraries. ## +############################################################################### + +LD_LIBRARY_PATH=${LIB_DIR} +export LD_LIBRARY_PATH + + +############################################################################### +## (3) Set the PATH environment variable to determine the search ## +## order this command wrapper uses to find binary executables. ## +## ## +## NOTE: Since the wrappers themselves are ALWAYS located in ## +## "/usr/bin", this directory will always be excluded ## +## from the search path. Since "/bin" is nothing more ## +## than a symbolic link to "/usr/bin" on Solaris, this ## +## directory will also always be excluded from the search ## +## path on this platform. ## +############################################################################### + +PATH=${BIN_DIR} +export PATH + + +############################################################################### +## (4) Execute the binary executable specified by this command wrapper ## +## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## +############################################################################### + +ORIGINAL_IFS=${IFS} +IFS=: + +for dir in ${PATH} +do + if [ -x ${dir}/${COMMAND} ] + then + IFS=${ORIGINAL_IFS} + ${dir}/${COMMAND} "$@" + exit $? + fi +done + +echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" + +exit 255 +
0
219fd4b145462204521dc021290d7b1c5f5cde1b
389ds/389-ds-base
Issue 49928 - Refactor and improve schema CLI/lib389 part to DSLdapObject Description: First commit that refactors Schema object and removes SchemaLegacy usage from CLI. Add full CLI Schema functionality to lib389. It includes: list, query, add, edit, remove operations. https://pagure.io/389-ds-base/issue/49928 Reviewed by: mreynolds, wibrown (Thanks!)
commit 219fd4b145462204521dc021290d7b1c5f5cde1b Author: Simon Pichugin <[email protected]> Date: Thu Aug 30 15:34:33 2018 +0200 Issue 49928 - Refactor and improve schema CLI/lib389 part to DSLdapObject Description: First commit that refactors Schema object and removes SchemaLegacy usage from CLI. Add full CLI Schema functionality to lib389. It includes: list, query, add, edit, remove operations. https://pagure.io/389-ds-base/issue/49928 Reviewed by: mreynolds, wibrown (Thanks!) diff --git a/src/lib389/lib389/cli_conf/schema.py b/src/lib389/lib389/cli_conf/schema.py index 11dcc207c..68962c30f 100644 --- a/src/lib389/lib389/cli_conf/schema.py +++ b/src/lib389/lib389/cli_conf/schema.py @@ -10,67 +10,141 @@ from lib389.cli_base import _get_arg from lib389.schema import Schema -def list_attributetype(inst, basedn, log, args): +def _validate_dual_args(enable_arg, disable_arg): + if enable_arg and disable_arg: + raise ValueError('Only one of the flags should be specified: %s and %s' % (enable_arg, disable_arg)) + + if enable_arg: + return 1 + elif disable_arg: + return 0 + + +def list_attributetypes(inst, basedn, log, args): + log = log.getChild('list_attributetypes') + schema = Schema(inst) if args is not None and args.json: - print(inst.schema.get_attributetypes(json=True)) + print(schema.get_attributetypes(json=True)) else: - for attributetype in inst.schema.get_attributetypes(): - print(attributetype) + for attributetype in schema.get_attributetypes(): + log.info(attributetype) def list_objectclasses(inst, basedn, log, args): + log = log.getChild('list_objectclasses') + schema = Schema(inst) if args is not None and args.json: - print(inst.schema.get_objectclasses(json=True)) + print(schema.get_objectclasses(json=True)) else: - for oc in inst.schema.get_objectclasses(): - print(oc) + for oc in schema.get_objectclasses(): + log.info(oc) def list_matchingrules(inst, basedn, log, args): + log = log.getChild('list_matchingrules') + schema = Schema(inst) if args is not None and args.json: - print(inst.schema.get_matchingrules(json=True)) + print(schema.get_matchingrules(json=True)) else: - for mr in inst.schema.matchingrules(): - print(mr) + for mr in schema.get_matchingrules(): + log.info(mr) def query_attributetype(inst, basedn, log, args): + log = log.getChild('query_attributetype') + schema = Schema(inst) # Need the query type attr = _get_arg(args.attr, msg="Enter attribute to query") if args.json: - print(inst.schema.query_attributetype(attr, json=True)) + print(schema.query_attributetype(attr, json=args.json)) else: - attributetype, must, may = inst.schema.query_attributetype(attr) - print(attributetype) - print("") - print("MUST") + attributetype, must, may = schema.query_attributetype(attr, json=args.json) + log.info(attributetype) + log.info("") + log.info("MUST") for oc in must: - print(oc) - print("") - print("MAY") + log.info(oc) + log.info("") + log.info("MAY") for oc in may: - print(oc) + log.info(oc) def query_objectclass(inst, basedn, log, args): + log = log.getChild('query_objectclass') + schema = Schema(inst) # Need the query type oc = _get_arg(args.attr, msg="Enter objectclass to query") + result = schema.query_objectclass(oc, json=args.json) if args.json: - print(inst.schema.query_objectclass(oc, json=True)) + print(result) else: - print("Not done") + log.info(result) def query_matchingrule(inst, basedn, log, args): + log = log.getChild('query_matchingrule') + schema = Schema(inst) # Need the query type attr = _get_arg(args.attr, msg="Enter attribute to query") + result = schema.query_matchingrule(attr, json=args.json) if args.json: - print(inst.schema.query_matchingrule(attr, json=True)) + print(result) else: - print("Not done") + log.info(result) + + +def add_attributetype(inst, basedn, log, args): + log = log.getChild('add_attributetype') + schema = Schema(inst) + parameters = _get_parameters(args, 'attributetypes') + schema.add_attributetype(parameters) + log.info("Successfully added the attributeType") + + +def add_objectclass(inst, basedn, log, args): + log = log.getChild('add_objectclass') + schema = Schema(inst) + + parameters = _get_parameters(args, 'objectclasses') + schema.add_objectclass(parameters) + log.info("Successfully added the objectClass") + + +def edit_attributetype(inst, basedn, log, args): + log = log.getChild('edit_attributetype') + schema = Schema(inst) + parameters = _get_parameters(args, 'attributetypes') + schema.edit_attributetype(args.name, parameters) + log.info("Successfully changed the attributetype") + + +def remove_attributetype(inst, basedn, log, args): + log = log.getChild('remove_attributetype') + attr = _get_arg(args.name, msg="Enter attribute to remove") + schema = Schema(inst) + schema.remove_attributetype(attr) + log.info("Successfully removed the attributetype") + + +def edit_objectclass(inst, basedn, log, args): + log = log.getChild('edit_objectclass') + schema = Schema(inst) + parameters = _get_parameters(args, 'objectclasses') + schema.edit_objectclass(args.name, parameters) + log.info("Successfully changed the objectClass") + + +def remove_objectclass(inst, basedn, log, args): + log = log.getChild('remove_objectclass') + attr = _get_arg(args.name, msg="Enter objectClass to remove") + schema = Schema(inst) + schema.remove_objectclass(attr) + log.info("Successfully removed the objectClass") def reload_schema(inst, basedn, log, args): + log = log.getChild('reload_schema') schema = Schema(inst) log.info('Attempting to add task entry... This will fail if Schema Reload plug-in is not enabled.') task = schema.reload(args.schemadir) @@ -82,38 +156,152 @@ def reload_schema(inst, basedn, log, args): else: raise ValueError("Schema reload task failed, please check the errors log for more information") else: - log.info('Successfully added task entry ' + task.dn) + log.info('Successfully added task entry {}'.format(task.dn)) log.info("To verify that the schema reload operation was successful, please check the error logs.") +def _get_parameters(args, type): + if type not in ('attributetypes', 'objectclasses'): + raise ValueError("Wrong parser type: %s" % type) + + parameters = {'names': (args.name,), + 'oid': args.oid, + 'desc': args.desc, + 'obsolete': _validate_dual_args(args.obsolete, args.not_obsolete)} + + if type == 'attributetypes': + parameters.update({'single_value': _validate_dual_args(args.single_value, args.multi_value), + 'syntax': args.syntax, + 'syntax_len': None, # We need it for + 'x_ordered': None, # the correct ldap.schema.models work + 'no_user_mod': _validate_dual_args(args.no_user_mod, args.with_user_mod), + 'equality': args.equality, + 'substr': args.substr, + 'ordering': args.ordering, + 'x_origin': args.x_origin, + 'collective': _validate_dual_args(args.collective, args.not_collective), + 'usage': args.usage, + 'sup': args.sup}) + elif type == 'objectclasses': + parameters.update({'must': args.must, + 'may': args.may, + 'kind': args.kind, + 'sup': args.sup}) + + return parameters + + +def _add_parser_args(parser, type): + if type not in ('attributetypes', 'objectclasses'): + raise ValueError("Wrong parser type: %s" % type) + + parser.add_argument('name', help='NAME of the object') + parser.add_argument('--oid', help='OID assigned to the object') + parser.add_argument('--desc', help='Description text(DESC) of the object') + parser.add_argument('--obsolete', action='store_true', + help='True if the object is marked as OBSOLETE in the schema.' + 'Only one of the flags this or --not-obsolete should be specified') + parser.add_argument('--not-obsolete', action='store_true', + help='True if the OBSOLETE mark should be removed' + 'object is marked as OBSOLETE in the schema' + 'Only one of the flags this or --obsolete should be specified') + if type == 'attributetypes': + parser.add_argument('--syntax', required=True, + help='OID of the LDAP syntax assigned to the attribute') + parser.add_argument('--single-value', action='store_true', + help='True if the matching rule must have only one value' + 'Only one of the flags this or --multi-value should be specified') + parser.add_argument('--multi-value', action='store_true', + help='True if the matching rule may have multiple values (default)' + 'Only one of the flags this or --single-value should be specified') + parser.add_argument('--no-user-mod', action='store_true', + help='True if the attribute is not modifiable by a client application' + 'Only one of the flags this or --with-user-mod should be specified') + parser.add_argument('--with-user-mod', action='store_true', + help='True if the attribute is modifiable by a client application (default)' + 'Only one of the flags this or --no-user-mode should be specified') + parser.add_argument('--equality', + help='NAME or OID of the matching rule used for checking' + 'whether attribute values are equal') + parser.add_argument('--substr', + help='NAME or OID of the matching rule used for checking' + 'whether an attribute value contains another value') + parser.add_argument('--ordering', + help='NAME or OID of the matching rule used for checking' + 'whether attribute values are lesser - equal than') + parser.add_argument('--x-origin', + help='Provides information about where the attribute type is defined') + parser.add_argument('--collective', + help='True if the attribute is assigned their values by virtue in their membership in some collection' + 'Only one of the flags this or --not-collective should be specified') + parser.add_argument('--not-collective', + help='True if the attribute is not assigned their values by virtue in their membership in some collection (default)' + 'Only one of the flags this or --collective should be specified') + parser.add_argument('--usage', + help='The flag indicates how the attribute type is to be used.' + 'userApplications - user, directoryOperation - directory operational,' + 'distributedOperation - DSA-shared operational, dSAOperation - DSA - specific operational') + parser.add_argument('--sup', nargs='?', help='The list of NAMEs or OIDs of attribute types' + 'this attribute type is derived from') + elif type == 'objectclasses': + parser.add_argument('--must', nargs='+', help='NAMEs or OIDs of all attributes an entry of the object must have') + parser.add_argument('--may', nargs='+', help='NAMEs or OIDs of additional attributes an entry of the object may have') + parser.add_argument('--kind', help='Kind of an object. 0 = STRUCTURAL (default), 1 = ABSTRACT, 2 = AUXILIARY') + parser.add_argument('--sup', nargs='+', help='NAMEs or OIDs of object classes this object is derived from') + else: + raise ValueError("Wrong parser type: %s" % type) + + def create_parser(subparsers): schema_parser = subparsers.add_parser('schema', help='Query and manipulate schema') - subcommands = schema_parser.add_subparsers(help='schema') + schema_subcommands = schema_parser.add_subparsers(help='schema') - list_attributetype_parser = subcommands.add_parser('list_attributetype', help='List available attribute types on this system') - list_attributetype_parser.set_defaults(func=list_attributetype) + attributetypes_parser = schema_subcommands.add_parser('attributetypes', help='Work with attribute types on this system') + attributetypes_subcommands = attributetypes_parser.add_subparsers(help='schema') + at_list_parser = attributetypes_subcommands.add_parser('list', help='List available attribute types on this system') + at_list_parser.set_defaults(func=list_attributetypes) + at_query_parser = attributetypes_subcommands.add_parser('query', help='Query an attribute to determine object classes that may or must take it') + at_query_parser.set_defaults(func=query_attributetype) + at_query_parser.add_argument('attr', nargs='?', help='Attribute type to query') + at_add_parser = attributetypes_subcommands.add_parser('add', help='Add an attribute type to this system') + at_add_parser.set_defaults(func=add_attributetype) + _add_parser_args(at_add_parser, 'attributetypes') + at_edit_parser = attributetypes_subcommands.add_parser('edit', help='Edit an attribute type on this system') + at_edit_parser.set_defaults(func=edit_attributetype) + _add_parser_args(at_edit_parser, 'attributetypes') + at_remove_parser = attributetypes_subcommands.add_parser('remove', help='Remove an attribute type on this system') + at_remove_parser.set_defaults(func=remove_attributetype) + at_remove_parser.add_argument('name', help='NAME of the object') - query_attributetype_parser = subcommands.add_parser('query_attributetype', help='Query an attribute to determine object classes that may or must take it') - query_attributetype_parser.set_defaults(func=query_attributetype) - query_attributetype_parser.add_argument('attr', nargs='?', help='Attribute type to query') + objectclasses_parser = schema_subcommands.add_parser('objectclasses', help='Work with objectClasses on this system') + objectclasses_subcommands = objectclasses_parser.add_subparsers(help='schema') + oc_list_parser = objectclasses_subcommands.add_parser('list', help='List available objectClasses on this system') + oc_list_parser.set_defaults(func=list_objectclasses) + oc_query_parser = objectclasses_subcommands.add_parser('query', help='Query an objectClass') + oc_query_parser.set_defaults(func=query_objectclass) + oc_query_parser.add_argument('attr', nargs='?', help='ObjectClass to query') + oc_add_parser = objectclasses_subcommands.add_parser('add', help='Add an objectClass to this system') + oc_add_parser.set_defaults(func=add_objectclass) + _add_parser_args(oc_add_parser, 'objectclasses') + oc_edit_parser = objectclasses_subcommands.add_parser('edit', help='Edit an objectClass on this system') + oc_edit_parser.set_defaults(func=edit_objectclass) + _add_parser_args(oc_edit_parser, 'objectclasses') + oc_remove_parser = objectclasses_subcommands.add_parser('remove', help='Remove an objectClass on this system') + oc_remove_parser.set_defaults(func=remove_objectclass) + oc_remove_parser.add_argument('name', help='NAME of the object') - list_objectclass_parser = subcommands.add_parser('list_objectclasses', help='List available objectclasses on this system') - list_objectclass_parser.set_defaults(func=list_objectclasses) + matchingrules_parser = schema_subcommands.add_parser('matchingrules', help='Work with matching rules on this system') + matchingrules_subcommands = matchingrules_parser.add_subparsers(help='schema') + mr_list_parser = matchingrules_subcommands.add_parser('list', help='List available matching rules on this system') + mr_list_parser.set_defaults(func=list_matchingrules) + mr_query_parser = matchingrules_subcommands.add_parser('query', help='Query a matching rule') + mr_query_parser.set_defaults(func=query_matchingrule) + mr_query_parser.add_argument('attr', nargs='?', help='Matching rule to query') - query_objectclass_parser = subcommands.add_parser('query_objectclass', help='Query an objectclass') - query_objectclass_parser.set_defaults(func=query_objectclass) - query_objectclass_parser.add_argument('attr', nargs='?', help='Objectclass to query') - - reload_parser = subcommands.add_parser('reload', help='Dynamically reload schema while server is running') + reload_parser = schema_subcommands.add_parser('reload', help='Dynamically reload schema while server is running') reload_parser.set_defaults(func=reload_schema) reload_parser.add_argument('-d', '--schemadir', help="directory where schema files are located") reload_parser.add_argument('--wait', action='store_true', default=False, help="Wait for the reload task to complete") - list_matchingrules_parser = subcommands.add_parser('list_matchingrules', help='List available matching rules on this system') - list_matchingrules_parser.set_defaults(func=list_matchingrules) - - query_matchingrule_parser = subcommands.add_parser('query_matchingrule', help='Query a matchingrule') - query_matchingrule_parser.set_defaults(func=query_matchingrule) - query_matchingrule_parser.add_argument('attr', nargs='?', help='Matchingrule to query') diff --git a/src/lib389/lib389/schema.py b/src/lib389/lib389/schema.py index bd51a39d1..39f0de428 100755 --- a/src/lib389/lib389/schema.py +++ b/src/lib389/lib389/schema.py @@ -8,28 +8,150 @@ """ You will access this from: - DirSrv.schema.methodName() + schema = Schema(instance) """ import glob import ldap +import ldif from json import dumps as dump_json from operator import itemgetter from ldap.schema.models import AttributeType, ObjectClass, MatchingRule - from lib389._constants import * from lib389._constants import DN_SCHEMA from lib389.utils import ds_is_newer from lib389._mapped_object import DSLdapObject from lib389.tasks import SchemaReloadTask +OBJECT_MODEL_PARAMS = {ObjectClass: {'names': (), 'oid': None, 'desc': None, 'obsolete': 0, + 'kind': 0, 'sup': (), 'must': (), 'may': ()}, + AttributeType: {'names': (), 'oid': None, 'desc': None, 'obsolete': 0, + 'sup': (), 'equality': None, 'ordering': None, 'substr': None, + 'syntax': None, 'syntax_len': None, 'single_value': 0, 'collective': 0, + 'no_user_mod': 0, 'usage': 0, 'x_origin': None, 'x_ordered': None}} + class Schema(DSLdapObject): + """An object that represents the schema entry + + :param instance: An instance + :type instance: lib389.DirSrv + """ + def __init__(self, instance): super(Schema, self).__init__(instance=instance) self._dn = DN_SCHEMA self._rdn_attribute = 'cn' + @staticmethod + def _get_attr_name_by_model(object_model): + # Validate the model and return its attribute name + if object_model in (ObjectClass, AttributeType, MatchingRule): + return object_model.schema_attribute + else: + raise ValueError("Wrong object model was specified") + + def _get_schema_objects(self, object_model, json=False): + attr_name = self._get_attr_name_by_model(object_model) + + results = self.get_attr_vals_utf8(attr_name) + + if json: + object_insts = [vars(object_model(obj_i)) for obj_i in results] + + for obj_i in object_insts: + # Add normalized name for sorting. Some matching rules don't have a name + if len(obj_i["names"]) > 0: + obj_i['name'] = obj_i['names'][0].lower() + else: + obj_i['name'] = "" + object_insts = sorted(object_insts, key=itemgetter('name')) + result = {'type': 'list', 'items': object_insts} + + return dump_json(result) + else: + return [object_model(obj_i) for obj_i in results] + + def _get_schema_object(self, name, object_model, json=False): + objects = self._get_schema_objects(object_model, json=json) + schema_object = [obj_i for obj_i in objects if name.lower() in + list(map(str.lower, obj_i.names))] + + if len(schema_object) != 1: + # This is an error. + if json: + raise ValueError('Could not find: %s' % name) + else: + return None + + return schema_object[0] + + def _add_schema_object(self, parameters, object_model): + attr_name = self._get_attr_name_by_model(object_model) + + if len(parameters) == 0: + raise ValueError('Parameters should be specified') + + # Validate args + if "names" not in parameters.keys(): + raise ValueError('%s name should be specified' % attr_name) + for name in parameters["names"]: + schema_object_old = self._get_schema_object(name, object_model) + if schema_object_old is not None: + raise ValueError('The %s with the name %s already exists' % (attr_name, name)) + + # Default structure. We modify it later with the specified arguments + schema_object = object_model() + + for oc_param, value in parameters.items(): + if oc_param.lower() not in OBJECT_MODEL_PARAMS[object_model].keys(): + raise ValueError('Wrong parameter name was specified: %s' % oc_param) + if value is not None: + # ldap.schema.models requires tuple + if type(value) == list: + value = tuple(value) + setattr(schema_object, oc_param.lower(), value) + + # Set other not defined arguments so objectClass model work correctly + # all 'None', but OBSOLETE and KIND are '0' (STRUCTURAL) + # It is automatically assigned to 'SUP top' + parameters_none = {k.lower(): v for k, v in parameters.items() if v is None} + for k, v in parameters_none.items(): + setattr(schema_object, k, OBJECT_MODEL_PARAMS[object_model][k]) + return self.add(attr_name, str(schema_object)) + + def _remove_schema_object(self, name, object_model): + attr_name = self._get_attr_name_by_model(object_model) + schema_object = self._get_schema_object(name, object_model) + + return self.remove(attr_name, str(schema_object)) + + def _edit_schema_object(self, name, parameters, object_model): + attr_name = self._get_attr_name_by_model(object_model) + schema_object = self._get_schema_object(name, object_model) + schema_object_str_old = str(schema_object) + + if len(parameters) == 0: + raise ValueError('Parameters should be specified') + + for oc_param, value in parameters.items(): + if oc_param.lower() not in OBJECT_MODEL_PARAMS[object_model].keys(): + raise ValueError('Wrong parameter name was specified: %s' % oc_param) + if value is not None: + # ldap.schema.models requires tuple + if type(value) == list: + value = tuple(value) + setattr(schema_object, oc_param.lower(), value) + + schema_object_str = str(schema_object) + if schema_object_str == schema_object_str_old: + raise ValueError('ObjectClass is already in the required state. Nothing to change') + + self.remove(attr_name, schema_object_str_old) + return self.add(attr_name, schema_object_str) + def reload(self, schema_dir=None): + """Reload the schema""" + task = SchemaReloadTask(self._instance) task_properties = {} @@ -40,6 +162,234 @@ class Schema(DSLdapObject): return task + def list_files(self): + """Return a list of the schema files in the instance schemadir""" + + file_list = [] + file_list += glob.glob(os.path.join(self.conn.schemadir, "*.ldif")) + if ds_is_newer('1.3.6.0'): + file_list += glob.glob(os.path.join(self.conn.ds_paths.system_schema_dir, "*.ldif")) + return file_list + + def file_to_ldap(self, filename): + """Convert the given schema file name to its python-ldap format + suitable for passing to ldap.schema.SubSchema() + + :param filename: the full path and filename of a schema file in ldif format + :type filename: str + """ + + with open(filename, 'r') as f: + ldif_parser = ldif.LDIFRecordList(f, max_entries=1) + if not ldif_parser: + return None + ldif_parser.parse() + if not ldif_parser.all_records: + return None + return ldif_parser.all_records[0][1] + + def file_to_subschema(self, filename): + """Convert the given schema file name to its python-ldap format + ldap.schema.SubSchema object + + :param filename: the full path and filename of a schema file in ldif format + :type filename: str + """ + + ent = self.file_to_ldap(filename) + if not ent: + return None + return ldap.schema.SubSchema(ent) + + def get_schema_csn(self): + """Return the schema nsSchemaCSN attribute""" + + return self.get_attr_val_utf8('nsSchemaCSN') + + def add_attributetype(self, parameters): + """Add an attribute type definition to the schema. + + :param parameters: an attribute type definition to add + :type parameters: str + """ + + return self._add_schema_object(parameters, AttributeType) + + def add_objectclass(self, parameters): + """Add an object class definition to the schema. + + :param parameters: an objectClass definition to add + :type parameters: str + """ + + return self._add_schema_object(parameters, ObjectClass) + + def remove_attributetype(self, name): + """Remove the attribute type definition from the schema. + + :param name: the name of the attributeType you want to remove. + :type name: str + """ + + return self._remove_schema_object(name, AttributeType) + + def remove_objectclass(self, name): + """Remove an objectClass definition from the schema. + + :param name: the name of the objectClass you want to remove. + :type name: str + """ + + return self._remove_schema_object(name, ObjectClass) + + def edit_attributetype(self, name, parameters): + """Edit the attribute type definition in the schema + + :param name: the name of the attribute type you want to edit. + :type name: str + :param parameters: an attribute type definition to edit + :type parameters: str + """ + + return self._edit_schema_object(name, parameters, AttributeType) + + def edit_objectclass(self, name, parameters): + """Edit an objectClass definition in the schema. + + :param name: the name of the objectClass you want to edit. + :type name: str + :param parameters: an objectClass definition to edit + :type parameters: str + """ + + return self._edit_schema_object(name, parameters, ObjectClass) + + def get_objectclasses(self, json=False): + """Returns a list of ldap.schema.models.ObjectClass objects for all + objectClasses supported by this instance. + + :param json: dump the result into JSON format + :type json: bool + """ + + return self._get_schema_objects(ObjectClass, json=json) + + def get_attributetypes(self, json=False): + """Returns a list of ldap.schema.models.AttributeType objects for all + attributeTypes supported by this instance. + + :param json: dump the result into JSON format + :type json: bool + """ + + return self._get_schema_objects(AttributeType, json=json) + + def get_matchingrules(self, json=False): + """Return a list of the server defined matching rules + + :param json: dump the result into JSON format + :type json: bool + """ + + return self._get_schema_objects(MatchingRule, json=json) + + def query_matchingrule(self, mr_name, json=False): + """Returns a single matching rule instance that matches the mr_name. + Returns None if the matching rule doesn't exist. + + :param mr_name: the name of the matching rule you want to query. + :type mr_name: str + :param json: dump the result into JSON format + :type json: bool + + :returns: MatchingRule or None + + <ldap.schema.models.MatchingRule instance> + """ + + matching_rule = self._get_schema_object(mr_name, MatchingRule, json=json) + + if json: + result = {'type': 'schema', 'mr': vars(matching_rule)} + return dump_json(result) + else: + return str(matching_rule) + + def query_objectclass(self, objectclassname, json=False): + """Returns a single ObjectClass instance that matches objectclassname. + Returns None if the objectClass doesn't exist. + + :param objectclassname: The name of the objectClass you want to query. + :type objectclassname: str + :param json: dump the result into JSON format + :type json: bool + + :returns: ObjectClass or None + + ex. query_objectclass('account') + <ldap.schema.models.ObjectClass instance> + """ + + objectclass = self._get_schema_object(objectclassname, ObjectClass, json=json) + + if json: + result = {'type': 'schema', 'oc': vars(objectclass)} + return dump_json(result) + else: + return str(objectclass) + + def query_attributetype(self, attributetypename, json=False): + """Returns a tuple of the AttributeType, and what objectclasses may or + must take this attributeType. Returns None if attributetype doesn't + exist. + + :param attributetypename: The name of the attributeType you want to query + :type attributetypename: str + :param json: dump the result into JSON format + :type json: bool + + :returns: (AttributeType, Must, May) or None + + ex. query_attributetype('uid') + ( <ldap.schema.models.AttributeType instance>, + [<ldap.schema.models.ObjectClass instance>, ...], + [<ldap.schema.models.ObjectClass instance>, ...] ) + """ + + # First, get the attribute that matches name. We need to consider + # alternate names. There is no way to search this, so we have to + # filter our set of all attribute types. + attributetype = self._get_schema_object(attributetypename, AttributeType, json=json) + objectclasses = self.get_objectclasses() + + # Get the primary name of this attribute + attributetypename = attributetype.names[0] + # Build a set if they have may. + may = [oc for oc in objectclasses if attributetypename.lower() in + list(map(str.lower, oc.may))] + # Build a set if they have must. + must = [oc for oc in objectclasses if attributetypename.lower() in + list(map(str.lower, oc.must))] + + if json: + # convert Objectclass class to dict, then sort each list + may = [vars(oc) for oc in may] + must = [vars(oc) for oc in must] + # Add normalized 'name' for sorting + for oc in may: + oc['name'] = oc['names'][0].lower() + for oc in must: + oc['name'] = oc['names'][0].lower() + may = sorted(may, key=itemgetter('name')) + must = sorted(must, key=itemgetter('name')) + result = {'type': 'schema', + 'at': vars(attributetype), + 'may': may, + 'must': must} + return dump_json(result) + else: + return str(attributetype), may, must + class SchemaLegacy(object): @@ -71,12 +421,9 @@ class SchemaLegacy(object): suitable for passing to ldap.schema.SubSchema() @param filename - the full path and filename of a schema file in ldif format""" - import six.moves.urllib.request - import six.moves.urllib.parse - import ldif - ldif_file = six.moves.urllib.request.urlopen('file://' + filename) - ldif_parser = ldif.LDIFRecordList(ldif_file, max_entries=1) + with open(filename, 'r') as f: + ldif_parser = ldif.LDIFRecordList(f, max_entries=1) if not ldif_parser: return None ldif_parser.parse()
0
a534583fdc7aaaeda11d87fdaf09cfaa603fb48f
389ds/389-ds-base
Ticket 48325 - Add lib389 test script Description: Add test script to test replication promotion https://fedorahosted.org/389/ticket/48325 Reviewed by: wibrown(Thanks!)
commit a534583fdc7aaaeda11d87fdaf09cfaa603fb48f Author: Mark Reynolds <[email protected]> Date: Tue Nov 10 13:54:30 2015 -0500 Ticket 48325 - Add lib389 test script Description: Add test script to test replication promotion https://fedorahosted.org/389/ticket/48325 Reviewed by: wibrown(Thanks!) diff --git a/dirsrvtests/tickets/ticket48325_test.py b/dirsrvtests/tickets/ticket48325_test.py new file mode 100644 index 000000000..3505d1a91 --- /dev/null +++ b/dirsrvtests/tickets/ticket48325_test.py @@ -0,0 +1,270 @@ +import os +import sys +import time +import ldap +import logging +import pytest +from lib389 import DirSrv, Entry, tools, tasks +from lib389.tools import DirSrvTools +from lib389._constants import * +from lib389.properties import * +from lib389.tasks import * +from lib389.utils import * + +logging.getLogger(__name__).setLevel(logging.DEBUG) +log = logging.getLogger(__name__) + +installation1_prefix = None + + +class TopologyReplication(object): + def __init__(self, master1, hub1, consumer1): + master1.open() + self.master1 = master1 + hub1.open() + self.hub1 = hub1 + consumer1.open() + self.consumer1 = consumer1 + + [email protected](scope="module") +def topology(request): + global installation1_prefix + if installation1_prefix: + args_instance[SER_DEPLOYED_DIR] = installation1_prefix + + # Creating master 1... + master1 = DirSrv(verbose=False) + args_instance[SER_HOST] = HOST_MASTER_1 + args_instance[SER_PORT] = PORT_MASTER_1 + args_instance[SER_SERVERID_PROP] = SERVERID_MASTER_1 + args_instance[SER_CREATION_SUFFIX] = DEFAULT_SUFFIX + args_master = args_instance.copy() + master1.allocate(args_master) + instance_master1 = master1.exists() + if instance_master1: + master1.delete() + master1.create() + master1.open() + master1.replica.enableReplication(suffix=SUFFIX, role=REPLICAROLE_MASTER, + replicaId=REPLICAID_MASTER_1) + + # Creating hub 1... + hub1 = DirSrv(verbose=False) + args_instance[SER_HOST] = HOST_HUB_1 + args_instance[SER_PORT] = PORT_HUB_1 + args_instance[SER_SERVERID_PROP] = SERVERID_HUB_1 + args_instance[SER_CREATION_SUFFIX] = DEFAULT_SUFFIX + args_hub = args_instance.copy() + hub1.allocate(args_hub) + instance_hub1 = hub1.exists() + if instance_hub1: + hub1.delete() + hub1.create() + hub1.open() + hub1.replica.enableReplication(suffix=SUFFIX, role=REPLICAROLE_HUB, + replicaId=REPLICAID_HUB_1) + + # Creating consumer 1... + consumer1 = DirSrv(verbose=False) + args_instance[SER_HOST] = HOST_CONSUMER_1 + args_instance[SER_PORT] = PORT_CONSUMER_1 + args_instance[SER_SERVERID_PROP] = SERVERID_CONSUMER_1 + args_instance[SER_CREATION_SUFFIX] = DEFAULT_SUFFIX + args_consumer = args_instance.copy() + consumer1.allocate(args_consumer) + instance_consumer1 = consumer1.exists() + if instance_consumer1: + consumer1.delete() + consumer1.create() + consumer1.open() + consumer1.changelog.create() + consumer1.replica.enableReplication(suffix=SUFFIX, + role=REPLICAROLE_CONSUMER, + replicaId=CONSUMER_REPLICAID) + + # + # Create all the agreements + # + # Creating agreement from master 1 to hub 1 + properties = {RA_NAME: r'meTo_$host:$port', + RA_BINDDN: defaultProperties[REPLICATION_BIND_DN], + RA_BINDPW: defaultProperties[REPLICATION_BIND_PW], + RA_METHOD: defaultProperties[REPLICATION_BIND_METHOD], + RA_TRANSPORT_PROT: defaultProperties[REPLICATION_TRANSPORT]} + m1_h1_agmt = master1.agreement.create(suffix=SUFFIX, host=hub1.host, + port=hub1.port, + properties=properties) + if not m1_h1_agmt: + log.fatal("Fail to create a master -> hub replica agreement") + sys.exit(1) + log.debug("%s created" % m1_h1_agmt) + + # Creating agreement from hub 1 to consumer 1 + properties = {RA_NAME: r'meTo_$host:$port', + RA_BINDDN: defaultProperties[REPLICATION_BIND_DN], + RA_BINDPW: defaultProperties[REPLICATION_BIND_PW], + RA_METHOD: defaultProperties[REPLICATION_BIND_METHOD], + RA_TRANSPORT_PROT: defaultProperties[REPLICATION_TRANSPORT]} + h1_c1_agmt = hub1.agreement.create(suffix=SUFFIX, host=consumer1.host, + port=consumer1.port, + properties=properties) + if not h1_c1_agmt: + log.fatal("Fail to create a hub -> consumer replica agreement") + sys.exit(1) + log.debug("%s created" % h1_c1_agmt) + + # Allow the replicas to get situated with the new agreements... + time.sleep(5) + + # + # Initialize all the agreements + # + master1.agreement.init(SUFFIX, HOST_HUB_1, PORT_HUB_1) + master1.waitForReplInit(m1_h1_agmt) + hub1.agreement.init(SUFFIX, HOST_CONSUMER_1, PORT_CONSUMER_1) + hub1.waitForReplInit(h1_c1_agmt) + + # Check replication is working... + if master1.testReplication(DEFAULT_SUFFIX, consumer1): + log.info('Replication is working.') + else: + log.fatal('Replication is not working.') + assert False + + # Delete each instance in the end + def fin(): + master1.delete() + hub1.delete() + consumer1.delete() + pass + + request.addfinalizer(fin) + + # Clear out the tmp dir + master1.clearTmpDir(__file__) + + return TopologyReplication(master1, hub1, consumer1) + + +def checkFirstElement(ds, rid): + """ + Return True if the first RUV element is for the specified rid + """ + try: + entry = ds.search_s(DEFAULT_SUFFIX, + ldap.SCOPE_SUBTREE, + REPLICA_RUV_FILTER, + ['nsds50ruv']) + assert entry + entry = entry[0] + except ldap.LDAPError as e: + log.fatal('Failed to retrieve RUV entry: %s' % str(e)) + assert False + + ruv_elements = entry.getValues('nsds50ruv') + if ('replica %s ' % rid) in ruv_elements[1]: + return True + else: + return False + + +def test_ticket48325(topology): + """ + Test that the RUV element order is correctly maintained when promoting + a hub or consumer. + """ + + # + # Promote consumer to master + # + try: + DN = topology.consumer1.replica._get_mt_entry(DEFAULT_SUFFIX) + topology.consumer1.modify_s(DN, [(ldap.MOD_REPLACE, + 'nsDS5ReplicaType', + '3'), + (ldap.MOD_REPLACE, + 'nsDS5ReplicaID', + '1234'), + (ldap.MOD_REPLACE, + 'nsDS5Flags', + '1')]) + except ldap.LDAPError as e: + log.fatal('Failed to promote consuemr to master: error %s' % str(e)) + assert False + time.sleep(1) + + # + # Check ruv has been reordered + # + if not checkFirstElement(topology.consumer1, '1234'): + log.fatal('RUV was not reordered') + assert False + + # + # Create repl agreement from the newly promoted master to master1 + # + properties = {RA_NAME: r'meTo_$host:$port', + RA_BINDDN: defaultProperties[REPLICATION_BIND_DN], + RA_BINDPW: defaultProperties[REPLICATION_BIND_PW], + RA_METHOD: defaultProperties[REPLICATION_BIND_METHOD], + RA_TRANSPORT_PROT: defaultProperties[REPLICATION_TRANSPORT]} + new_agmt = topology.consumer1.agreement.create(suffix=SUFFIX, + host=topology.master1.host, + port=topology.master1.port, + properties=properties) + + if not new_agmt: + log.fatal("Fail to create new agmt from old consumer to the master") + assert False + + # + # Test replication is working + # + if topology.consumer1.testReplication(DEFAULT_SUFFIX, topology.master1): + log.info('Replication is working.') + else: + log.fatal('Replication is not working.') + assert False + + # + # Promote hub to master + # + try: + DN = topology.hub1.replica._get_mt_entry(DEFAULT_SUFFIX) + topology.hub1.modify_s(DN, [(ldap.MOD_REPLACE, + 'nsDS5ReplicaType', + '3'), + (ldap.MOD_REPLACE, + 'nsDS5ReplicaID', + '5678')]) + except ldap.LDAPError as e: + log.fatal('Failed to promote consuemr to master: error %s' % str(e)) + assert False + time.sleep(1) + + # + # Check ruv has been reordered + # + if not checkFirstElement(topology.hub1, '5678'): + log.fatal('RUV was not reordered') + assert False + + # + # Test replication is working + # + if topology.hub1.testReplication(DEFAULT_SUFFIX, topology.master1): + log.info('Replication is working.') + else: + log.fatal('Replication is not working.') + assert False + + # Done + log.info('Test complete') + + +if __name__ == '__main__': + # Run isolated + # -s for DEBUG mode + CURRENT_FILE = os.path.realpath(__file__) + pytest.main("-s %s" % CURRENT_FILE) \ No newline at end of file
0
d5fe6ba773ef2655845df5152901fd5bb6a9d4e9
389ds/389-ds-base
Ticket 623 - cleanAllRUV task fails to cleanup config upon completion Bug description: coverity reported "13158 - Logically dead code' Fix description: csn_as_string returns allocated csn string, which needs to be reassigned to csnstr. https://fedorahosted.org/389/ticket/623 Reviewed by Nathan (Thank you!!)
commit d5fe6ba773ef2655845df5152901fd5bb6a9d4e9 Author: Noriko Hosoi <[email protected]> Date: Thu Mar 28 15:30:13 2013 -0700 Ticket 623 - cleanAllRUV task fails to cleanup config upon completion Bug description: coverity reported "13158 - Logically dead code' Fix description: csn_as_string returns allocated csn string, which needs to be reassigned to csnstr. https://fedorahosted.org/389/ticket/623 Reviewed by Nathan (Thank you!!) diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c index b1aca418c..c280ced17 100644 --- a/ldap/servers/plugins/replication/repl5_replica_config.c +++ b/ldap/servers/plugins/replication/repl5_replica_config.c @@ -2396,7 +2396,7 @@ delete_cleaned_rid_config(cleanruv_data *clean_data) /* * If there is no maxcsn, set the proper csnstr */ - csn_as_string(clean_data->maxcsn, PR_FALSE, csnstr); + csnstr = csn_as_string(clean_data->maxcsn, PR_FALSE, csnstr); if(csnstr == NULL || csn_get_replicaid(clean_data->maxcsn) == 0){ csnstr = slapi_ch_strdup("00000000000000000000"); }
0
fc97900fc6637d888a103c69adbf303f6e78e233
389ds/389-ds-base
Ticket 48752 - Add CI test Description: Test that search with simple paged result control works properly on two suffixes (one is parent of the other) and the logs show right pr_cookie values. https://fedorahosted.org/389/ticket/48752 Reviewed by: mreynolds (Thanks!)
commit fc97900fc6637d888a103c69adbf303f6e78e233 Author: Simon Pichugin <[email protected]> Date: Thu Jul 14 14:14:12 2016 +0200 Ticket 48752 - Add CI test Description: Test that search with simple paged result control works properly on two suffixes (one is parent of the other) and the logs show right pr_cookie values. https://fedorahosted.org/389/ticket/48752 Reviewed by: mreynolds (Thanks!) diff --git a/dirsrvtests/tests/suites/paged_results/paged_results_test.py b/dirsrvtests/tests/suites/paged_results/paged_results_test.py index 9c1978e02..7dbc8fa0d 100644 --- a/dirsrvtests/tests/suites/paged_results/paged_results_test.py +++ b/dirsrvtests/tests/suites/paged_results/paged_results_test.py @@ -12,8 +12,7 @@ import logging import pytest from random import sample from ldap.controls import SimplePagedResultsControl, GetEffectiveRightsControl -from lib389 import DirSrv, Entry, tools, tasks -from lib389.tools import DirSrvTools +from lib389 import DirSrv, Entry from lib389._constants import * from lib389.properties import * from lib389.tasks import * @@ -24,8 +23,14 @@ logging.getLogger(__name__).setLevel(logging.DEBUG) log = logging.getLogger(__name__) TEST_USER_NAME = 'simplepaged_test' -TEST_USER_DN = 'uid=%s,%s' % (TEST_USER_NAME, DEFAULT_SUFFIX) +TEST_USER_DN = 'uid={},{}'.format(TEST_USER_NAME, DEFAULT_SUFFIX) TEST_USER_PWD = 'simplepaged_test' +NEW_SUFFIX_1_NAME = 'test_parent' +NEW_SUFFIX_1 = 'o={}'.format(NEW_SUFFIX_1_NAME) +NEW_SUFFIX_2_NAME = 'child' +NEW_SUFFIX_2 = 'ou={},{}'.format(NEW_SUFFIX_2_NAME, NEW_SUFFIX_1) +NEW_BACKEND_1 = 'parent_base' +NEW_BACKEND_2 = 'child_base' class TopologyStandalone(object): @@ -62,9 +67,10 @@ def topology(request): @pytest.fixture(scope="module") -def test_user(topology): +def test_user(topology, request): """User for binding operation""" + log.info('Adding user {}'.format(TEST_USER_DN)) try: topology.standalone.add_s(Entry((TEST_USER_DN, { 'objectclass': 'top person'.split(), @@ -81,8 +87,63 @@ def test_user(topology): e.message['desc'])) raise e + def fin(): + log.info('Deleting user {}'.format(TEST_USER_DN)) + topology.standalone.delete_s(TEST_USER_DN) + request.addfinalizer(fin) + + [email protected](scope="module") +def new_suffixes(topology): + """Add two suffixes with backends, one is a parent + of the another + """ + + log.info('Adding suffix:{} and backend: {}'.format(NEW_SUFFIX_1, NEW_BACKEND_1)) + topology.standalone.backend.create(NEW_SUFFIX_1, + {BACKEND_NAME: NEW_BACKEND_1}) + topology.standalone.mappingtree.create(NEW_SUFFIX_1, + bename=NEW_BACKEND_1) + try: + topology.standalone.add_s(Entry((NEW_SUFFIX_1, { + 'objectclass': 'top', + 'objectclass': 'organization', + 'o': NEW_SUFFIX_1_NAME + }))) + except ldap.LDAPError as e: + log.error('Failed to add suffix ({}): error ({})'.format(NEW_SUFFIX_1, + e.message['desc'])) + raise + + log.info('Adding suffix:{} and backend: {}'.format(NEW_SUFFIX_2, NEW_BACKEND_2)) + topology.standalone.backend.create(NEW_SUFFIX_2, + {BACKEND_NAME: NEW_BACKEND_2}) + topology.standalone.mappingtree.create(NEW_SUFFIX_2, + bename=NEW_BACKEND_2, + parent=NEW_SUFFIX_1) -def add_users(topology, users_num): + try: + topology.standalone.add_s(Entry((NEW_SUFFIX_2, { + 'objectclass': 'top', + 'objectclass': 'organizationalunit', + 'ou': NEW_SUFFIX_2_NAME + }))) + except ldap.LDAPError as e: + log.error('Failed to add suffix ({}): error ({})'.format(NEW_SUFFIX_2, + e.message['desc'])) + raise + + log.info('Adding ACI to allow our test user to search') + ACI_TARGET = '(targetattr != "userPassword || aci")' + ACI_ALLOW = '(version 3.0; acl "Enable anonymous access";allow (read, search, compare)' + ACI_SUBJECT = '(userdn = "ldap:///anyone");)' + ACI_BODY = ACI_TARGET + ACI_ALLOW + ACI_SUBJECT + + mod = [(ldap.MOD_ADD, 'aci', ACI_BODY)] + topology.standalone.modify_s(NEW_SUFFIX_1, mod) + + +def add_users(topology, users_num, suffix): """Add users to the default suffix Return the list of added user DNs. @@ -93,7 +154,7 @@ def add_users(topology, users_num): for num in sample(range(1000), users_num): num_ran = int(round(num)) USER_NAME = 'test%05d' % num_ran - USER_DN = 'uid=%s,%s' % (USER_NAME, DEFAULT_SUFFIX) + USER_DN = 'uid=%s,%s' % (USER_NAME, suffix) users_list.append(USER_DN) try: topology.standalone.add_s(Entry((USER_DN, { @@ -154,7 +215,7 @@ def change_conf_attr(topology, suffix, attr_name, attr_value): return attr_value_bck -def paged_search(topology, controls, search_flt, searchreq_attrlist): +def paged_search(topology, suffix, controls, search_flt, searchreq_attrlist): """Search at the DEFAULT_SUFFIX with ldap.SCOPE_SUBTREE using Simple Paged Control(should the first item in the list controls. @@ -167,7 +228,7 @@ def paged_search(topology, controls, search_flt, searchreq_attrlist): pctrls = [] all_results = [] req_ctrl = controls[0] - msgid = topology.standalone.search_ext(DEFAULT_SUFFIX, + msgid = topology.standalone.search_ext(suffix, ldap.SCOPE_SUBTREE, search_flt, searchreq_attrlist, @@ -187,7 +248,7 @@ def paged_search(topology, controls, search_flt, searchreq_attrlist): if pctrls[0].cookie: # Copy cookie from response control to request control req_ctrl.cookie = pctrls[0].cookie - msgid = topology.standalone.search_ext(DEFAULT_SUFFIX, + msgid = topology.standalone.search_ext(suffix, ldap.SCOPE_SUBTREE, search_flt, searchreq_attrlist, @@ -218,7 +279,7 @@ def test_search_success(topology, test_user, page_size, users_num): :Assert: All users should be found """ - users_list = add_users(topology, users_num) + users_list = add_users(topology, users_num, DEFAULT_SUFFIX) search_flt = r'(uid=test*)' searchreq_attrlist = ['dn', 'sn'] @@ -229,7 +290,7 @@ def test_search_success(topology, test_user, page_size, users_num): log.info('Create simple paged results control instance') req_ctrl = SimplePagedResultsControl(True, size=page_size, cookie='') - all_results = paged_search(topology, [req_ctrl], + all_results = paged_search(topology, DEFAULT_SUFFIX, [req_ctrl], search_flt, searchreq_attrlist) log.info('%d results' % len(all_results)) @@ -270,7 +331,7 @@ def test_search_limits_fail(topology, test_user, page_size, users_num, :Assert: Should fail with appropriate exception """ - users_list = add_users(topology, users_num) + users_list = add_users(topology, users_num, DEFAULT_SUFFIX) attr_value_bck = change_conf_attr(topology, suffix, attr_name, attr_value) conf_param_dict = {attr_name: attr_value} search_flt = r'(uid=test*)' @@ -359,7 +420,7 @@ def test_search_sort_success(topology, test_user): users_num = 50 page_size = 5 - users_list = add_users(topology, users_num) + users_list = add_users(topology, users_num, DEFAULT_SUFFIX) search_flt = r'(uid=test*)' searchreq_attrlist = ['dn', 'sn'] @@ -374,7 +435,7 @@ def test_search_sort_success(topology, test_user): log.info('Initiate ldapsearch with created control instance') log.info('Collect data with sorting') controls = [req_ctrl, sort_ctrl] - results_sorted = paged_search(topology, controls, + results_sorted = paged_search(topology, DEFAULT_SUFFIX, controls, search_flt, searchreq_attrlist) log.info('Substring numbers from user DNs') @@ -407,7 +468,7 @@ def test_search_abandon(topology, test_user): users_num = 10 page_size = 2 - users_list = add_users(topology, users_num) + users_list = add_users(topology, users_num, DEFAULT_SUFFIX) search_flt = r'(uid=test*)' searchreq_attrlist = ['dn', 'sn'] @@ -459,7 +520,7 @@ def test_search_with_timelimit(topology, test_user): users_num = 100 page_size = 50 timelimit = 5 - users_list = add_users(topology, users_num) + users_list = add_users(topology, users_num, DEFAULT_SUFFIX) search_flt = r'(uid=test*)' searchreq_attrlist = ['dn', 'sn'] @@ -541,7 +602,7 @@ def test_search_dns_ip_aci(topology, test_user, aci_subject): users_num = 100 page_size = 5 - users_list = add_users(topology, users_num) + users_list = add_users(topology, users_num, DEFAULT_SUFFIX) search_flt = r'(uid=test*)' searchreq_attrlist = ['dn', 'sn'] @@ -572,7 +633,7 @@ def test_search_dns_ip_aci(topology, test_user, aci_subject): log.info('Initiate three searches with a paged results control') for ii in range(3): log.info('%d search' % (ii + 1)) - all_results = paged_search(topology, controls, + all_results = paged_search(topology, DEFAULT_SUFFIX, controls, search_flt, searchreq_attrlist) log.info('%d results' % len(all_results)) assert len(all_results) == len(users_list) @@ -611,7 +672,7 @@ def test_search_multiple_paging(topology, test_user): users_num = 100 page_size = 30 - users_list = add_users(topology, users_num) + users_list = add_users(topology, users_num, DEFAULT_SUFFIX) search_flt = r'(uid=test*)' searchreq_attrlist = ['dn', 'sn'] @@ -671,7 +732,7 @@ def test_search_invalid_cookie(topology, test_user, invalid_cookie): users_num = 100 page_size = 50 - users_list = add_users(topology, users_num) + users_list = add_users(topology, users_num, DEFAULT_SUFFIX) search_flt = r'(uid=test*)' searchreq_attrlist = ['dn', 'sn'] @@ -723,7 +784,7 @@ def test_search_abandon_with_zero_size(topology, test_user): users_num = 10 page_size = 0 - users_list = add_users(topology, users_num) + users_list = add_users(topology, users_num, DEFAULT_SUFFIX) search_flt = r'(uid=test*)' searchreq_attrlist = ['dn', 'sn'] @@ -777,7 +838,7 @@ def test_search_pagedsizelimit_success(topology, test_user): attr_value = '20' attr_value_bck = change_conf_attr(topology, DN_CONFIG, attr_name, attr_value) - users_list = add_users(topology, users_num) + users_list = add_users(topology, users_num, DEFAULT_SUFFIX) search_flt = r'(uid=test*)' searchreq_attrlist = ['dn', 'sn'] @@ -789,7 +850,7 @@ def test_search_pagedsizelimit_success(topology, test_user): req_ctrl = SimplePagedResultsControl(True, size=page_size, cookie='') controls = [req_ctrl] - all_results = paged_search(topology, controls, + all_results = paged_search(topology, DEFAULT_SUFFIX, controls, search_flt, searchreq_attrlist) log.info('%d results' % len(all_results)) @@ -836,7 +897,7 @@ def test_search_nspagedsizelimit(topology, test_user, users_num = 10 page_size = 10 - users_list = add_users(topology, users_num) + users_list = add_users(topology, users_num, DEFAULT_SUFFIX) search_flt = r'(uid=test*)' searchreq_attrlist = ['dn', 'sn'] conf_attr_bck = change_conf_attr(topology, DN_CONFIG, @@ -855,11 +916,11 @@ def test_search_nspagedsizelimit(topology, test_user, if expected_rs == ldap.SIZELIMIT_EXCEEDED: log.info('Expect to fail with SIZELIMIT_EXCEEDED') with pytest.raises(expected_rs): - all_results = paged_search(topology, controls, + all_results = paged_search(topology, DEFAULT_SUFFIX, controls, search_flt, searchreq_attrlist) elif expected_rs == 'PASS': log.info('Expect to pass') - all_results = paged_search(topology, controls, + all_results = paged_search(topology, DEFAULT_SUFFIX, controls, search_flt, searchreq_attrlist) log.info('%d results' % len(all_results)) assert len(all_results) == len(users_list) @@ -907,7 +968,7 @@ def test_search_paged_limits(topology, test_user, conf_attr_values, expected_rs) users_num = 101 page_size = 10 - users_list = add_users(topology, users_num) + users_list = add_users(topology, users_num, DEFAULT_SUFFIX) search_flt = r'(uid=test*)' searchreq_attrlist = ['dn', 'sn'] size_attr_bck = change_conf_attr(topology, DN_CONFIG, @@ -930,11 +991,11 @@ def test_search_paged_limits(topology, test_user, conf_attr_values, expected_rs) if expected_rs == ldap.ADMINLIMIT_EXCEEDED: log.info('Expect to fail with ADMINLIMIT_EXCEEDED') with pytest.raises(expected_rs): - all_results = paged_search(topology, controls, + all_results = paged_search(topology, DEFAULT_SUFFIX, controls, search_flt, searchreq_attrlist) elif expected_rs == 'PASS': log.info('Expect to pass') - all_results = paged_search(topology, controls, + all_results = paged_search(topology, DEFAULT_SUFFIX, controls, search_flt, searchreq_attrlist) log.info('%d results' % len(all_results)) assert len(all_results) == len(users_list) @@ -986,7 +1047,7 @@ def test_search_paged_user_limits(topology, test_user, conf_attr_values, expecte users_num = 101 page_size = 10 - users_list = add_users(topology, users_num) + users_list = add_users(topology, users_num, DEFAULT_SUFFIX) search_flt = r'(uid=test*)' searchreq_attrlist = ['dn', 'sn'] lookthrough_attr_bck = change_conf_attr(topology, 'cn=config,%s' % DN_LDBM, @@ -1009,11 +1070,11 @@ def test_search_paged_user_limits(topology, test_user, conf_attr_values, expecte if expected_rs == ldap.ADMINLIMIT_EXCEEDED: log.info('Expect to fail with ADMINLIMIT_EXCEEDED') with pytest.raises(expected_rs): - all_results = paged_search(topology, controls, + all_results = paged_search(topology, DEFAULT_SUFFIX, controls, search_flt, searchreq_attrlist) elif expected_rs == 'PASS': log.info('Expect to pass') - all_results = paged_search(topology, controls, + all_results = paged_search(topology, DEFAULT_SUFFIX, controls, search_flt, searchreq_attrlist) log.info('%d results' % len(all_results)) assert len(all_results) == len(users_list) @@ -1048,7 +1109,7 @@ def test_ger_basic(topology, test_user): an 'attributeLevelRights' returned """ - users_list = add_users(topology, 20) + users_list = add_users(topology, 20, DEFAULT_SUFFIX) search_flt = r'(uid=test*)' searchreq_attrlist = ['dn', 'sn'] page_size = 4 @@ -1061,7 +1122,7 @@ def test_ger_basic(topology, test_user): spr_ctrl = SimplePagedResultsControl(True, size=page_size, cookie='') ger_ctrl = GetEffectiveRightsControl(True, "dn: " + DN_DM) - all_results = paged_search(topology, [spr_ctrl, ger_ctrl], + all_results = paged_search(topology, DEFAULT_SUFFIX, [spr_ctrl, ger_ctrl], search_flt, searchreq_attrlist) log.info('{} results'.format(len(all_results))) @@ -1073,6 +1134,62 @@ def test_ger_basic(topology, test_user): del_users(topology, users_list) +def test_multi_suffix_search(topology, test_user, new_suffixes): + """Verify that page result search returns empty cookie + if there is no returned entry. + + :Feature: Simple paged results + + :Setup: Standalone instance, test user for binding, + two suffixes with backends, one is inserted into another, + 10 users for the search base within each suffix + + :Steps: 1. Bind as test user + 2. Search through all 20 added users with a simple paged control + using page_size = 4 + 3. Wait some time logs to be updated + 3. Check access log + + :Assert: All users should be found, the access log should contain + the pr_cookie for each page request and it should be equal 0, + except the last one should be equal -1 + """ + + search_flt = r'(uid=test*)' + searchreq_attrlist = ['dn', 'sn'] + page_size = 4 + users_num = 20 + + users_list_1 = add_users(topology, users_num / 2, NEW_SUFFIX_1) + users_list_2 = add_users(topology, users_num / 2, NEW_SUFFIX_2) + + try: + log.info('Set DM bind') + topology.standalone.simple_bind_s(DN_DM, PASSWORD) + + log.info('Create simple paged results control instance') + req_ctrl = SimplePagedResultsControl(True, size=page_size, cookie='') + + all_results = paged_search(topology, NEW_SUFFIX_1, [req_ctrl], + search_flt, searchreq_attrlist) + + log.info('{} results'.format(len(all_results))) + assert len(all_results) == users_num + + log.info('Waiting for logs to be updated') + time.sleep(30) + access_log_lines = topology.standalone.ds_access_log.match('.*pr_cookie=.*') + pr_cookie_list = ([line.rsplit('=', 1)[-1] for line in access_log_lines]) + pr_cookie_list = [int(pr_cookie) for pr_cookie in pr_cookie_list] + log.info('Assert that last pr_cookie == -1 and others pr_cookie == 0') + assert all((pr_cookie == 0 for pr_cookie in pr_cookie_list[0:-1])) + assert pr_cookie_list[-1] == -1 + finally: + log.info('Remove added users') + del_users(topology, users_list_1) + del_users(topology, users_list_2) + + if __name__ == '__main__': # Run isolated # -s for DEBUG mode
0
2092a1be4eb014a43bc0e7c203c62f165551eaef
389ds/389-ds-base
Issue 6555 - V2 - Potential crash when deleting a replicated backend (#6585) * Issue 6555 - Potential crash when deleting a replicated backend - hang at shutdown Prevent previous 6555 fix to hang at shutdown. Issue: #6555 Reviewed by: @tbordaz
commit 2092a1be4eb014a43bc0e7c203c62f165551eaef Author: progier389 <[email protected]> Date: Thu Feb 6 17:56:22 2025 +0100 Issue 6555 - V2 - Potential crash when deleting a replicated backend (#6585) * Issue 6555 - Potential crash when deleting a replicated backend - hang at shutdown Prevent previous 6555 fix to hang at shutdown. Issue: #6555 Reviewed by: @tbordaz diff --git a/ldap/servers/plugins/replication/repl5_replica_hash.c b/ldap/servers/plugins/replication/repl5_replica_hash.c index 275e5f7a8..c4b551242 100644 --- a/ldap/servers/plugins/replication/repl5_replica_hash.c +++ b/ldap/servers/plugins/replication/repl5_replica_hash.c @@ -75,9 +75,11 @@ replica_destroy_name_hash() if (s_hash) PL_HashTableDestroy(s_hash); + s_hash = NULL; if (s_lock) slapi_destroy_rwlock(s_lock); + s_lock = NULL; } int @@ -207,7 +209,7 @@ replica_check_validity(Replica *replica) { struct repl_enum_validity data = { replica, false }; - if (replica == NULL) { + if (replica == NULL || s_lock == NULL) { return false; } slapi_rwlock_rdlock(s_lock);
0
cb3035cb25bac8a4bd963da709075fc94bf1f474
389ds/389-ds-base
Copyright updates
commit cb3035cb25bac8a4bd963da709075fc94bf1f474 Author: Nathan Kinder <[email protected]> Date: Tue Mar 22 18:46:00 2005 +0000 Copyright updates diff --git a/builddsrpm.sh b/builddsrpm.sh index 6ce63bc61..b56875e29 100755 --- a/builddsrpm.sh +++ b/builddsrpm.sh @@ -1,4 +1,8 @@ #!/bin/sh -v +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- mkdirs() { for d in "$@" ; do diff --git a/buildnum.pl b/buildnum.pl index 6b184f212..0d1e806a0 100755 --- a/buildnum.pl +++ b/buildnum.pl @@ -1,4 +1,10 @@ #!/usr/bin/perl +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- + #-------------------------------------------- # buildnum.pl # diff --git a/dirver.pl b/dirver.pl index f360c18ab..a7f202573 100755 --- a/dirver.pl +++ b/dirver.pl @@ -1,4 +1,10 @@ #!/usr/bin/perl +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- + #----------------------------------------------------------------- # dirver.pl: Generates ascii format #define for FILEVERSION # resource identifier used by Windows executable binaries. diff --git a/ldap/admin/src/scripts/template-cl-dump.pl b/ldap/admin/src/scripts/template-cl-dump.pl index fe89de2ae..8fad15051 100755 --- a/ldap/admin/src/scripts/template-cl-dump.pl +++ b/ldap/admin/src/scripts/template-cl-dump.pl @@ -1,9 +1,10 @@ #{{PERL-EXEC}} - -################################################################################ -# -# Copyright (C) 2002-2004 Netscape Communications Corporation. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK +################################################################################ # # FILE: cl-dump.pl # diff --git a/ldap/admin/src/scripts/template-dsml-activate.pl b/ldap/admin/src/scripts/template-dsml-activate.pl index 6ebaf751f..3bd159ad5 100644 --- a/ldap/admin/src/scripts/template-dsml-activate.pl +++ b/ldap/admin/src/scripts/template-dsml-activate.pl @@ -1,4 +1,9 @@ #{{PERL-EXEC}} +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK use Getopt::Std; use File::Copy "cp"; diff --git a/ldap/admin/src/scripts/template-repl-monitor.pl b/ldap/admin/src/scripts/template-repl-monitor.pl index 78e3aa853..3a356e4e9 100755 --- a/ldap/admin/src/scripts/template-repl-monitor.pl +++ b/ldap/admin/src/scripts/template-repl-monitor.pl @@ -1,10 +1,11 @@ #{{PERL-EXEC}} - +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK ############################################################################## # -# Copyright (C) 2002-2004 Netscape Communications Corporation. -# All Rights Reserved. -# # FILE: repl-monitor.pl # # SYNOPSIS: diff --git a/ldap/clients/dsgw/admhtml/Makefile b/ldap/clients/dsgw/admhtml/Makefile index e82a8c251..656f7b9db 100644 --- a/ldap/clients/dsgw/admhtml/Makefile +++ b/ldap/clients/dsgw/admhtml/Makefile @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # # Gmakefile for Directory Server Gateway html files. diff --git a/ldap/clients/dsgw/admhtml/index.lst b/ldap/clients/dsgw/admhtml/index.lst index aea03131b..57ff13fc6 100644 --- a/ldap/clients/dsgw/admhtml/index.lst +++ b/ldap/clients/dsgw/admhtml/index.lst @@ -1,9 +1,9 @@ -;------------------------------------------------------------------------- -; PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -; license terms. Copyright ? 2001 Sun Microsystems, Inc. -; Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +; --- BEGIN COPYRIGHT BLOCK --- +; Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +; Copyright (C) 2005 Red Hat, Inc. ; All rights reserved. -;------------------------------------------------------------------------- +; --- END COPYRIGHT BLOCK --- +; ; Netscape admin index page master list ; ; Lines beginning with a ';' are comments diff --git a/ldap/clients/dsgw/config/Makefile b/ldap/clients/dsgw/config/Makefile index 930010d1b..df045cc08 100644 --- a/ldap/clients/dsgw/config/Makefile +++ b/ldap/clients/dsgw/config/Makefile @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # # Gmakefile for Directory Server Gateway config files. diff --git a/ldap/clients/dsgw/config/de/dsgw-l10n.conf b/ldap/clients/dsgw/config/de/dsgw-l10n.conf index 0482312bb..76c14b16d 100644 --- a/ldap/clients/dsgw/config/de/dsgw-l10n.conf +++ b/ldap/clients/dsgw/config/de/dsgw-l10n.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # To localize the search type menu: # Locate dsgw-l10n.conf in config/<lang>/. diff --git a/ldap/clients/dsgw/config/de/dsgw.conf b/ldap/clients/dsgw/config/de/dsgw.conf index 64c202d1d..a240647c7 100644 --- a/ldap/clients/dsgw/config/de/dsgw.conf +++ b/ldap/clients/dsgw/config/de/dsgw.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # The baseurl directive gives the server, port, and base dn where searches # should be rooted. The format is: diff --git a/ldap/clients/dsgw/config/de/dsgw.tmpl b/ldap/clients/dsgw/config/de/dsgw.tmpl index f126945df..762f68c11 100644 --- a/ldap/clients/dsgw/config/de/dsgw.tmpl +++ b/ldap/clients/dsgw/config/de/dsgw.tmpl @@ -1,3 +1,9 @@ +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + # The htmldir directive tells the CGIs where to find the html files htmldir ../html diff --git a/ldap/clients/dsgw/config/de/dsgw_adm.conf b/ldap/clients/dsgw/config/de/dsgw_adm.conf index 28dc9775b..85571796c 100644 --- a/ldap/clients/dsgw/config/de/dsgw_adm.conf +++ b/ldap/clients/dsgw/config/de/dsgw_adm.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # Mapping between config/display-XXX.html templates and LDAP objectClasses. # This can be generated by using the templateindex program. The format is: diff --git a/ldap/clients/dsgw/config/de/dsgwfilter.conf b/ldap/clients/dsgw/config/de/dsgwfilter.conf index 5b08d17c9..42dba32ab 100644 --- a/ldap/clients/dsgw/config/de/dsgwfilter.conf +++ b/ldap/clients/dsgw/config/de/dsgwfilter.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # ldap filter file # diff --git a/ldap/clients/dsgw/config/de/dsgwfilter_adm.conf b/ldap/clients/dsgw/config/de/dsgwfilter_adm.conf index 6abe00a2f..64641315a 100644 --- a/ldap/clients/dsgw/config/de/dsgwfilter_adm.conf +++ b/ldap/clients/dsgw/config/de/dsgwfilter_adm.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # ldap filter file # diff --git a/ldap/clients/dsgw/config/de/dsgwsearchprefs.conf b/ldap/clients/dsgw/config/de/dsgwsearchprefs.conf index bfc97e4b1..7c1d05c3f 100644 --- a/ldap/clients/dsgw/config/de/dsgwsearchprefs.conf +++ b/ldap/clients/dsgw/config/de/dsgwsearchprefs.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # dsgwsearchprefs.conf - directory server gateway search object definitions diff --git a/ldap/clients/dsgw/config/dsgw-l10n.conf b/ldap/clients/dsgw/config/dsgw-l10n.conf index 0482312bb..76c14b16d 100644 --- a/ldap/clients/dsgw/config/dsgw-l10n.conf +++ b/ldap/clients/dsgw/config/dsgw-l10n.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # To localize the search type menu: # Locate dsgw-l10n.conf in config/<lang>/. diff --git a/ldap/clients/dsgw/config/dsgw.tmpl b/ldap/clients/dsgw/config/dsgw.tmpl index 4bc85cb4d..8ebf37caf 100644 --- a/ldap/clients/dsgw/config/dsgw.tmpl +++ b/ldap/clients/dsgw/config/dsgw.tmpl @@ -1,3 +1,9 @@ +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + # The attribute the orgchart uses to search for entries. # This value should correspond to the value of attrib-farleft-rdn # in the orgchart's config.txt configuration file. diff --git a/ldap/clients/dsgw/config/dsgw_adm.conf b/ldap/clients/dsgw/config/dsgw_adm.conf index 46f06f4ef..dcb678a4e 100644 --- a/ldap/clients/dsgw/config/dsgw_adm.conf +++ b/ldap/clients/dsgw/config/dsgw_adm.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # Mapping between config/display-XXX.html templates and LDAP objectClasses. # This can be generated by using the templateindex program. The format is: diff --git a/ldap/clients/dsgw/config/dsgwfilter.conf b/ldap/clients/dsgw/config/dsgwfilter.conf index 6205b12a9..ec50c8ab7 100644 --- a/ldap/clients/dsgw/config/dsgwfilter.conf +++ b/ldap/clients/dsgw/config/dsgwfilter.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # ldap filter file # diff --git a/ldap/clients/dsgw/config/dsgwfilter_adm.conf b/ldap/clients/dsgw/config/dsgwfilter_adm.conf index b6654e407..b51caf8c5 100644 --- a/ldap/clients/dsgw/config/dsgwfilter_adm.conf +++ b/ldap/clients/dsgw/config/dsgwfilter_adm.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # ldap filter file # diff --git a/ldap/clients/dsgw/config/dsgwsearchprefs.conf b/ldap/clients/dsgw/config/dsgwsearchprefs.conf index a01909191..2484bc984 100644 --- a/ldap/clients/dsgw/config/dsgwsearchprefs.conf +++ b/ldap/clients/dsgw/config/dsgwsearchprefs.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # dsgwsearchprefs.conf - directory server gateway search object definitions diff --git a/ldap/clients/dsgw/config/en-us/dsgw-l10n.conf b/ldap/clients/dsgw/config/en-us/dsgw-l10n.conf index 0482312bb..76c14b16d 100644 --- a/ldap/clients/dsgw/config/en-us/dsgw-l10n.conf +++ b/ldap/clients/dsgw/config/en-us/dsgw-l10n.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # To localize the search type menu: # Locate dsgw-l10n.conf in config/<lang>/. diff --git a/ldap/clients/dsgw/config/en-us/dsgwcollate.conf b/ldap/clients/dsgw/config/en-us/dsgwcollate.conf index 81f9f461a..3adf525bf 100644 --- a/ldap/clients/dsgw/config/en-us/dsgwcollate.conf +++ b/ldap/clients/dsgw/config/en-us/dsgwcollate.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # Ignore accents (diacritical marks) when doing case-insensitive comparison. caseIgnoreAccents diff --git a/ldap/clients/dsgw/config/en/dsgw-l10n.conf b/ldap/clients/dsgw/config/en/dsgw-l10n.conf index 0482312bb..76c14b16d 100644 --- a/ldap/clients/dsgw/config/en/dsgw-l10n.conf +++ b/ldap/clients/dsgw/config/en/dsgw-l10n.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # To localize the search type menu: # Locate dsgw-l10n.conf in config/<lang>/. diff --git a/ldap/clients/dsgw/config/en/dsgwcollate.conf b/ldap/clients/dsgw/config/en/dsgwcollate.conf index fc7996920..1221e5986 100644 --- a/ldap/clients/dsgw/config/en/dsgwcollate.conf +++ b/ldap/clients/dsgw/config/en/dsgwcollate.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # Case 1. en and en-* # diff --git a/ldap/clients/dsgw/config/es/dsgw-l10n.conf b/ldap/clients/dsgw/config/es/dsgw-l10n.conf index 0482312bb..76c14b16d 100644 --- a/ldap/clients/dsgw/config/es/dsgw-l10n.conf +++ b/ldap/clients/dsgw/config/es/dsgw-l10n.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # To localize the search type menu: # Locate dsgw-l10n.conf in config/<lang>/. diff --git a/ldap/clients/dsgw/config/es/dsgw.tmpl b/ldap/clients/dsgw/config/es/dsgw.tmpl index 47360e0ad..3a2851c2f 100644 --- a/ldap/clients/dsgw/config/es/dsgw.tmpl +++ b/ldap/clients/dsgw/config/es/dsgw.tmpl @@ -1,3 +1,9 @@ +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + # The htmldir directive tells the CGIs where to find the html files htmldir ../html diff --git a/ldap/clients/dsgw/config/es/dsgw_adm.conf b/ldap/clients/dsgw/config/es/dsgw_adm.conf index ff662a467..0a7b12940 100644 --- a/ldap/clients/dsgw/config/es/dsgw_adm.conf +++ b/ldap/clients/dsgw/config/es/dsgw_adm.conf @@ -1,46 +1,46 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # -# Mapping between config/display-XXX.html templates and LDAP objectClasses. -# This can be generated by using the templateindex program. The format is: -# -# template TEMPLATENAME OBJECTCLASSES -# -# where "display-TEMPLATENAME.html" is the name of a display template -# that is found in this config directory (e.g., "display-group.html") and -# OBJECTCLASSES is a list of one or more objectClass values. For a given -# template to be used, all the objectClass values listed must be present -# in the directory entry, so the order of these template lines is -# significant (e.g. note that the more specific "orgperson" template is -# listed before the one for an ordinary "person"). -# -template group groupOfNames -template groupun groupOfUniqueNames -template org organization -template orgunit organizationalUnit -template orgperson person inetOrgPerson -template person person -template country country -template licensed-user nsLicenseUser - -# Attribute Value Sets (used with DS_ATTRVAL_SET directives) -# attrvset HANDLE VALUE PREFIX SUFFIX -# -attrvset CAL news "" "Netscape Collabra Server" -attrvset CAL slapd "" "Netscape Directory Server" - - -# Template Set definitions -# Note: templates must be defined before they can be mentioned on -# a tmplset line. -# -# tmplset SETNAME VIEWNAME TEMPLATENAME [HREF-LOCATION] -# -tmplset person "General" orgperson -tmplset person "Contrase&ntilde;a" passwd -tmplset person "Licencia" licensed-user -tmplset group "General" group -tmplset groupun "General" groupun +# Mapping between config/display-XXX.html templates and LDAP objectClasses. +# This can be generated by using the templateindex program. The format is: +# +# template TEMPLATENAME OBJECTCLASSES +# +# where "display-TEMPLATENAME.html" is the name of a display template +# that is found in this config directory (e.g., "display-group.html") and +# OBJECTCLASSES is a list of one or more objectClass values. For a given +# template to be used, all the objectClass values listed must be present +# in the directory entry, so the order of these template lines is +# significant (e.g. note that the more specific "orgperson" template is +# listed before the one for an ordinary "person"). +# +template group groupOfNames +template groupun groupOfUniqueNames +template org organization +template orgunit organizationalUnit +template orgperson person inetOrgPerson +template person person +template country country +template licensed-user nsLicenseUser + +# Attribute Value Sets (used with DS_ATTRVAL_SET directives) +# attrvset HANDLE VALUE PREFIX SUFFIX +# +attrvset CAL news "" "Netscape Collabra Server" +attrvset CAL slapd "" "Netscape Directory Server" + + +# Template Set definitions +# Note: templates must be defined before they can be mentioned on +# a tmplset line. +# +# tmplset SETNAME VIEWNAME TEMPLATENAME [HREF-LOCATION] +# +tmplset person "General" orgperson +tmplset person "Contrase&ntilde;a" passwd +tmplset person "Licencia" licensed-user +tmplset group "General" group +tmplset groupun "General" groupun diff --git a/ldap/clients/dsgw/config/es/dsgwfilter.conf b/ldap/clients/dsgw/config/es/dsgwfilter.conf index 735facece..eabe0fc40 100644 --- a/ldap/clients/dsgw/config/es/dsgwfilter.conf +++ b/ldap/clients/dsgw/config/es/dsgwfilter.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # ldap filter file # diff --git a/ldap/clients/dsgw/config/es/dsgwfilter_adm.conf b/ldap/clients/dsgw/config/es/dsgwfilter_adm.conf index 48eadf059..791d75661 100644 --- a/ldap/clients/dsgw/config/es/dsgwfilter_adm.conf +++ b/ldap/clients/dsgw/config/es/dsgwfilter_adm.conf @@ -1,73 +1,73 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK +# +# ldap filter file +# +# lines like this that start with # or empty lines are ignored # -# ldap filter file -# -# lines like this that start with # or empty lines are ignored -# -# syntax: -# -# <tag> -# <pattern1> <delimiters> <filter1-1> <desc1-1> [<scope>] -# <filter1-2> <desc1-2> [<scope>] -# -# <pattern2> <delimiters> <filter2-1> <desc2-1> [<scope>] ... -# -# The <desc> should describe the filter. It should correctly complete -# the phrases (in the resource database) DBT_Found0EntriesWhere_, -# DBT_Found1EntryWhere_ and DBT_FoundEntriesWhere_; for example (en): -# -# Found 1 entry where the <desc> '%v'. -# Found no entries where the <desc> '%v'. -# Found 3 entries where the <desc> '%v'. -# -# The <desc> should begin with the article ("the" in English) for -# languages that require agreement between article and noun (e.g -# genders in Spanish or French). -# -# The scope is optional, and should be one of: -# "base" -# "onelevel" -# "subtree" -# if it is included. - -# -# Directory Server gateway - for Netscape Admin Server -# - -"dsgw-people" - "=" " " "(%v))" "LDAP filtro es" - - "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "n&uacute;mero de tel&eacute;fono termina en" - - "@" " " "(mail=%v))" "direcci&oacute;n electr&oacute;nica es" - "(mail=%v*))" "direcci&oacute;n electr&oacute;nica comienza por" - - "^.[. _].*" ". _" "(cn=%v1* %v2-))" "primera inicial + nombre es" - - ".*[. _].$" ". _" "(cn=%v1-*))" "nombre + &uacute;ltima inicial es" - - "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "name is" - "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "nombre suena como o contiene" - - ".*" ". " "(uid=%v1))" "identificaci&oacute;n de acceso es" - "(|(cn=%v1)(sn=%v1)))" "nombre es" - "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "nombre suena como o contiene" - - -"dsgw-groups" - "=" " " "(%v))" "LDAP filter is" - - ".*" ". _" "(cn=%v1-))" "nombre es" - "(cn~=%v1-))" "nombre suena como" - -"dsgw-orgunits" - "=" " " "(%v))" "LDAP filtro es" - - ".*" ". _" "(ou=%v1-))" "nombre de la unidad es" - "(ou~=%v1-))" "nombre de la unidad suena como" - -#Do not remove this line, or place any additional lines after it. +# syntax: +# +# <tag> +# <pattern1> <delimiters> <filter1-1> <desc1-1> [<scope>] +# <filter1-2> <desc1-2> [<scope>] +# +# <pattern2> <delimiters> <filter2-1> <desc2-1> [<scope>] ... +# +# The <desc> should describe the filter. It should correctly complete +# the phrases (in the resource database) DBT_Found0EntriesWhere_, +# DBT_Found1EntryWhere_ and DBT_FoundEntriesWhere_; for example (en): +# +# Found 1 entry where the <desc> '%v'. +# Found no entries where the <desc> '%v'. +# Found 3 entries where the <desc> '%v'. +# +# The <desc> should begin with the article ("the" in English) for +# languages that require agreement between article and noun (e.g +# genders in Spanish or French). +# +# The scope is optional, and should be one of: +# "base" +# "onelevel" +# "subtree" +# if it is included. + +# +# Directory Server gateway - for Netscape Admin Server +# + +"dsgw-people" + "=" " " "(%v))" "LDAP filtro es" + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "n&uacute;mero de tel&eacute;fono termina en" + + "@" " " "(mail=%v))" "direcci&oacute;n electr&oacute;nica es" + "(mail=%v*))" "direcci&oacute;n electr&oacute;nica comienza por" + + "^.[. _].*" ". _" "(cn=%v1* %v2-))" "primera inicial + nombre es" + + ".*[. _].$" ". _" "(cn=%v1-*))" "nombre + &uacute;ltima inicial es" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "name is" + "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "nombre suena como o contiene" + + ".*" ". " "(uid=%v1))" "identificaci&oacute;n de acceso es" + "(|(cn=%v1)(sn=%v1)))" "nombre es" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "nombre suena como o contiene" + + +"dsgw-groups" + "=" " " "(%v))" "LDAP filter is" + + ".*" ". _" "(cn=%v1-))" "nombre es" + "(cn~=%v1-))" "nombre suena como" + +"dsgw-orgunits" + "=" " " "(%v))" "LDAP filtro es" + + ".*" ". _" "(ou=%v1-))" "nombre de la unidad es" + "(ou~=%v1-))" "nombre de la unidad suena como" + +#Do not remove this line, or place any additional lines after it. diff --git a/ldap/clients/dsgw/config/es/dsgwsearchprefs.conf b/ldap/clients/dsgw/config/es/dsgwsearchprefs.conf index fee61c100..2be925971 100644 --- a/ldap/clients/dsgw/config/es/dsgwsearchprefs.conf +++ b/ldap/clients/dsgw/config/es/dsgwsearchprefs.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # dsgwsearchprefs.conf - directory server gateway search object definitions diff --git a/ldap/clients/dsgw/config/es/ns-license-schema.conf b/ldap/clients/dsgw/config/es/ns-license-schema.conf index bbe5d4934..95f4858a1 100644 --- a/ldap/clients/dsgw/config/es/ns-license-schema.conf +++ b/ldap/clients/dsgw/config/es/ns-license-schema.conf @@ -1,17 +1,17 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # -attribute nsLicensedFor cis -attribute nsLicenseStartTime cis -attribute nsLicenseEndTime cis - -objectclass nsLicenseUser - requires - objectClass - allows - nsLicensedFor - nsLicenseStartTime - nsLicenseEndTime +attribute nsLicensedFor cis +attribute nsLicenseStartTime cis +attribute nsLicenseEndTime cis + +objectclass nsLicenseUser + requires + objectClass + allows + nsLicensedFor + nsLicenseStartTime + nsLicenseEndTime diff --git a/ldap/clients/dsgw/config/fr/dsgw-l10n.conf b/ldap/clients/dsgw/config/fr/dsgw-l10n.conf index 0482312bb..76c14b16d 100644 --- a/ldap/clients/dsgw/config/fr/dsgw-l10n.conf +++ b/ldap/clients/dsgw/config/fr/dsgw-l10n.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # To localize the search type menu: # Locate dsgw-l10n.conf in config/<lang>/. diff --git a/ldap/clients/dsgw/config/fr/dsgw.conf b/ldap/clients/dsgw/config/fr/dsgw.conf index f109eb842..8d76a97bb 100644 --- a/ldap/clients/dsgw/config/fr/dsgw.conf +++ b/ldap/clients/dsgw/config/fr/dsgw.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # The baseurl directive gives the server, port, and base dn where searches # should be rooted. The format is: diff --git a/ldap/clients/dsgw/config/fr/dsgw.tmpl b/ldap/clients/dsgw/config/fr/dsgw.tmpl index 983aac2c8..a7c54bbd5 100644 --- a/ldap/clients/dsgw/config/fr/dsgw.tmpl +++ b/ldap/clients/dsgw/config/fr/dsgw.tmpl @@ -1,3 +1,9 @@ +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + # The htmldir directive tells the CGIs where to find the html files htmldir ../html diff --git a/ldap/clients/dsgw/config/fr/dsgw_adm.conf b/ldap/clients/dsgw/config/fr/dsgw_adm.conf index 33cc3f378..cd486225f 100644 --- a/ldap/clients/dsgw/config/fr/dsgw_adm.conf +++ b/ldap/clients/dsgw/config/fr/dsgw_adm.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # Mapping between config/display-XXX.html templates and LDAP objectClasses. # This can be generated by using the templateindex program. The format is: diff --git a/ldap/clients/dsgw/config/fr/dsgwfilter.conf b/ldap/clients/dsgw/config/fr/dsgwfilter.conf index 17a0c3ba4..2f6cac0fc 100644 --- a/ldap/clients/dsgw/config/fr/dsgwfilter.conf +++ b/ldap/clients/dsgw/config/fr/dsgwfilter.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # ldap filter file # diff --git a/ldap/clients/dsgw/config/fr/dsgwfilter_adm.conf b/ldap/clients/dsgw/config/fr/dsgwfilter_adm.conf index 7c387abf0..66dc2cf86 100644 --- a/ldap/clients/dsgw/config/fr/dsgwfilter_adm.conf +++ b/ldap/clients/dsgw/config/fr/dsgwfilter_adm.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # ldap filter file # diff --git a/ldap/clients/dsgw/config/fr/dsgwsearchprefs.conf b/ldap/clients/dsgw/config/fr/dsgwsearchprefs.conf index ac4cec446..791226bd0 100644 --- a/ldap/clients/dsgw/config/fr/dsgwsearchprefs.conf +++ b/ldap/clients/dsgw/config/fr/dsgwsearchprefs.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # dsgwsearchprefs.conf - directory server gateway search object definitions diff --git a/ldap/clients/dsgw/config/ja/dsgw-l10n.conf b/ldap/clients/dsgw/config/ja/dsgw-l10n.conf index 0482312bb..76c14b16d 100644 --- a/ldap/clients/dsgw/config/ja/dsgw-l10n.conf +++ b/ldap/clients/dsgw/config/ja/dsgw-l10n.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # To localize the search type menu: # Locate dsgw-l10n.conf in config/<lang>/. diff --git a/ldap/clients/dsgw/config/ja/dsgw.conf b/ldap/clients/dsgw/config/ja/dsgw.conf index d818fd445..955ca0579 100644 --- a/ldap/clients/dsgw/config/ja/dsgw.conf +++ b/ldap/clients/dsgw/config/ja/dsgw.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # The baseurl directive gives the server, port, and base dn where searches # should be rooted. The format is: diff --git a/ldap/clients/dsgw/config/ja/dsgw.tmpl b/ldap/clients/dsgw/config/ja/dsgw.tmpl index 732e04066..056a37a8f 100644 --- a/ldap/clients/dsgw/config/ja/dsgw.tmpl +++ b/ldap/clients/dsgw/config/ja/dsgw.tmpl @@ -1,3 +1,9 @@ +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + # The htmldir directive tells the CGIs where to find the html files htmldir ../html diff --git a/ldap/clients/dsgw/config/ja/dsgw_adm.conf b/ldap/clients/dsgw/config/ja/dsgw_adm.conf index 9fbf96ea0..20a21c44f 100644 --- a/ldap/clients/dsgw/config/ja/dsgw_adm.conf +++ b/ldap/clients/dsgw/config/ja/dsgw_adm.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # Mapping between config/display-XXX.html templates and LDAP objectClasses. # This can be generated by using the templateindex program. The format is: diff --git a/ldap/clients/dsgw/config/ja/dsgwcharset.conf b/ldap/clients/dsgw/config/ja/dsgwcharset.conf index d14e3f1d4..4794b61a9 100644 --- a/ldap/clients/dsgw/config/ja/dsgwcharset.conf +++ b/ldap/clients/dsgw/config/ja/dsgwcharset.conf @@ -1,7 +1,7 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # Shift_JIS diff --git a/ldap/clients/dsgw/config/ja/dsgwcollate.conf b/ldap/clients/dsgw/config/ja/dsgwcollate.conf index 34377d013..e72b14029 100644 --- a/ldap/clients/dsgw/config/ja/dsgwcollate.conf +++ b/ldap/clients/dsgw/config/ja/dsgwcollate.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # Each line in this file defines a crude string collation. # There are two such collations, one for sorting a displayed list, and diff --git a/ldap/clients/dsgw/config/ja/dsgwfilter.conf b/ldap/clients/dsgw/config/ja/dsgwfilter.conf index 965854a14..2f2a74087 100644 --- a/ldap/clients/dsgw/config/ja/dsgwfilter.conf +++ b/ldap/clients/dsgw/config/ja/dsgwfilter.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # ldap filter file # diff --git a/ldap/clients/dsgw/config/ja/dsgwfilter_adm.conf b/ldap/clients/dsgw/config/ja/dsgwfilter_adm.conf index 87d504063..26251186a 100644 --- a/ldap/clients/dsgw/config/ja/dsgwfilter_adm.conf +++ b/ldap/clients/dsgw/config/ja/dsgwfilter_adm.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # ldap filter file # diff --git a/ldap/clients/dsgw/config/ja/dsgwsearchprefs.conf b/ldap/clients/dsgw/config/ja/dsgwsearchprefs.conf index 14146ae9f..1aa6a4cf9 100644 --- a/ldap/clients/dsgw/config/ja/dsgwsearchprefs.conf +++ b/ldap/clients/dsgw/config/ja/dsgwsearchprefs.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # dsgwsearchprefs.conf - directory server gateway search object definitions diff --git a/ldap/clients/dsgw/config/ko/dsgw-l10n.conf b/ldap/clients/dsgw/config/ko/dsgw-l10n.conf index 0482312bb..76c14b16d 100644 --- a/ldap/clients/dsgw/config/ko/dsgw-l10n.conf +++ b/ldap/clients/dsgw/config/ko/dsgw-l10n.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # To localize the search type menu: # Locate dsgw-l10n.conf in config/<lang>/. diff --git a/ldap/clients/dsgw/config/ko/dsgwcharset.conf b/ldap/clients/dsgw/config/ko/dsgwcharset.conf index f42c2b31c..41ba6df9c 100644 --- a/ldap/clients/dsgw/config/ko/dsgwcharset.conf +++ b/ldap/clients/dsgw/config/ko/dsgwcharset.conf @@ -1,7 +1,7 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. -# +# END COPYRIGHT BLOCK +# euc-kr diff --git a/ldap/clients/dsgw/config/ns-license-schema.conf b/ldap/clients/dsgw/config/ns-license-schema.conf index 7ab2c1fee..95f4858a1 100644 --- a/ldap/clients/dsgw/config/ns-license-schema.conf +++ b/ldap/clients/dsgw/config/ns-license-schema.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # attribute nsLicensedFor cis attribute nsLicenseStartTime cis diff --git a/ldap/clients/dsgw/config/search.html b/ldap/clients/dsgw/config/search.html index 2aa7ffd86..b96f5040a 100644 --- a/ldap/clients/dsgw/config/search.html +++ b/ldap/clients/dsgw/config/search.html @@ -1,9 +1,8 @@ -<!-- - PROPRIETARY/CONFIDENTIAL. Use of this product is subject to - license terms. Copyright ? 2001 Sun Microsystems, Inc. - Some preexisting portions Copyright ? 2001 Netscape Communications Corp. - All rights reserved. - --> +<!-- BEGIN COPYRIGHT BLOCK + Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + Copyright (C) 2005 Red Hat, Inc. + All rights reserved. + END COPYRIGHT BLOCK --> <HTML> <!-- HEAD --> <!-- search.html --> diff --git a/ldap/clients/dsgw/config/searchString.html b/ldap/clients/dsgw/config/searchString.html index dfad73dc7..eb54bfb4e 100644 --- a/ldap/clients/dsgw/config/searchString.html +++ b/ldap/clients/dsgw/config/searchString.html @@ -1,9 +1,8 @@ -<!-- - PROPRIETARY/CONFIDENTIAL. Use of this product is subject to - license terms. Copyright ? 2001 Sun Microsystems, Inc. - Some preexisting portions Copyright ? 2001 Netscape Communications Corp. - All rights reserved. - --> +<!-- BEGIN COPYRIGHT BLOCK + Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + Copyright (C) 2005 Red Hat, Inc. + All rights reserved. + END COPYRIGHT BLOCK --> <HTML> <!-- HEAD --> <!-- searchString.html --> diff --git a/ldap/clients/dsgw/config/zh/dsgw-l10n.conf b/ldap/clients/dsgw/config/zh/dsgw-l10n.conf index 0482312bb..76c14b16d 100644 --- a/ldap/clients/dsgw/config/zh/dsgw-l10n.conf +++ b/ldap/clients/dsgw/config/zh/dsgw-l10n.conf @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # To localize the search type menu: # Locate dsgw-l10n.conf in config/<lang>/. diff --git a/ldap/clients/dsgw/config/zh/dsgwcharset.conf b/ldap/clients/dsgw/config/zh/dsgwcharset.conf index d8b0f8595..dbadb728e 100644 --- a/ldap/clients/dsgw/config/zh/dsgwcharset.conf +++ b/ldap/clients/dsgw/config/zh/dsgwcharset.conf @@ -1,7 +1,7 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # big5 diff --git a/ldap/clients/dsgw/html/Makefile b/ldap/clients/dsgw/html/Makefile index 5b5b9d039..975d03887 100644 --- a/ldap/clients/dsgw/html/Makefile +++ b/ldap/clients/dsgw/html/Makefile @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # # Gmakefile for Directory Server Gateway html files. diff --git a/ldap/clients/dsgw/html/info/Makefile b/ldap/clients/dsgw/html/info/Makefile index 1f791c2ad..6ca82dad9 100644 --- a/ldap/clients/dsgw/html/info/Makefile +++ b/ldap/clients/dsgw/html/info/Makefile @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # # Gmakefile for Directory Server Gateway info files. diff --git a/ldap/clients/dsgw/html/manual/Makefile b/ldap/clients/dsgw/html/manual/Makefile index accb957a5..e4bef8d80 100644 --- a/ldap/clients/dsgw/html/manual/Makefile +++ b/ldap/clients/dsgw/html/manual/Makefile @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # # Gmakefile for Directory Server Gateway manual files. diff --git a/ldap/clients/dsgw/html/manual/index.map b/ldap/clients/dsgw/html/manual/index.map index a70461c35..4e7679872 100644 --- a/ldap/clients/dsgw/html/manual/index.map +++ b/ldap/clients/dsgw/html/manual/index.map @@ -1,9 +1,9 @@ -;------------------------------------------------------------------------- -; PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -; license terms. Copyright ? 2001 Sun Microsystems, Inc. -; Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +; --- BEGIN COPYRIGHT BLOCK --- +; Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +; Copyright (C) 2005 Red Hat, Inc. ; All rights reserved. -;------------------------------------------------------------------------- +; --- END COPYRIGHT BLOCK --- +; ; -------------------------------------------MAPPINGS ; CGIScriptName = HTMLfile#AnchorName ; last update, sarette 10/10 diff --git a/ldap/clients/dsgw/html/style.css b/ldap/clients/dsgw/html/style.css index 7c63f233b..a84492955 100644 --- a/ldap/clients/dsgw/html/style.css +++ b/ldap/clients/dsgw/html/style.css @@ -1,3 +1,9 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + /* ======================================================= * * Style sheet for the Directory Express application * * ======================================================= */ diff --git a/ldap/clients/dsgw/pbconfig/Makefile b/ldap/clients/dsgw/pbconfig/Makefile index 4fad2a258..f3e9f3d3d 100644 --- a/ldap/clients/dsgw/pbconfig/Makefile +++ b/ldap/clients/dsgw/pbconfig/Makefile @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # # Gmakefile for Directory Server Gateway config files. diff --git a/ldap/clients/dsgw/pbconfig/dsgwfilter.conf b/ldap/clients/dsgw/pbconfig/dsgwfilter.conf index 2c083f00f..f6cfcb541 100644 --- a/ldap/clients/dsgw/pbconfig/dsgwfilter.conf +++ b/ldap/clients/dsgw/pbconfig/dsgwfilter.conf @@ -1,12 +1,12 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # ################################################################################ # -# $Id: dsgwfilter.conf,v 1.1 2005/01/21 00:40:49 cvsadm Exp $ +# $Id: dsgwfilter.conf,v 1.2 2005/03/22 18:45:47 nkinder Exp $ # # AUTHOR: # diff --git a/ldap/clients/dsgw/pbconfig/dsgwsearchprefs.conf b/ldap/clients/dsgw/pbconfig/dsgwsearchprefs.conf index 528e66d7b..c081d2b80 100644 --- a/ldap/clients/dsgw/pbconfig/dsgwsearchprefs.conf +++ b/ldap/clients/dsgw/pbconfig/dsgwsearchprefs.conf @@ -1,12 +1,12 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # ################################################################################ # -# $Id: dsgwsearchprefs.conf,v 1.1 2005/01/21 00:40:49 cvsadm Exp $ +# $Id: dsgwsearchprefs.conf,v 1.2 2005/03/22 18:45:47 nkinder Exp $ # # AUTHOR: # diff --git a/ldap/clients/dsgw/pbconfig/pb.tmpl b/ldap/clients/dsgw/pbconfig/pb.tmpl index 57ec10d85..c0650322c 100644 --- a/ldap/clients/dsgw/pbconfig/pb.tmpl +++ b/ldap/clients/dsgw/pbconfig/pb.tmpl @@ -1,3 +1,9 @@ +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + # The attribute the orgchart uses to search for entries. # This value should correspond to the value of attrib-farleft-rdn # in the orgchart's config.txt configuration file. diff --git a/ldap/clients/dsgw/pbhtml/Makefile b/ldap/clients/dsgw/pbhtml/Makefile index 5e59271ab..3c1a827cb 100644 --- a/ldap/clients/dsgw/pbhtml/Makefile +++ b/ldap/clients/dsgw/pbhtml/Makefile @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # # Gmakefile for Directory Server Phonebook html files. diff --git a/ldap/clients/dsgw/pbhtml/phone.js b/ldap/clients/dsgw/pbhtml/phone.js index f51d06dc1..d4aeb3cce 100755 --- a/ldap/clients/dsgw/pbhtml/phone.js +++ b/ldap/clients/dsgw/pbhtml/phone.js @@ -1,8 +1,9 @@ // -// PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -// license terms. Copyright ? 2001 Sun Microsystems, Inc. -// Some preexisting portions Copyright ? 2001 Netscape Communications Corp. -// all rights reserved. +// --- BEGIN COPYRIGHT BLOCK --- +// Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +// Copyright (C) 2005 Red Hat, Inc. +// All rights reserved. +// --- END COPYRIGHT BLOCK --- // function goToURL(i){ window.location.href=i; diff --git a/ldap/clients/dsgw/pbhtml/style.css b/ldap/clients/dsgw/pbhtml/style.css index c41191b95..67fcc0d60 100644 --- a/ldap/clients/dsgw/pbhtml/style.css +++ b/ldap/clients/dsgw/pbhtml/style.css @@ -1,3 +1,9 @@ +/* --- BEGIN COPYRIGHT BLOCK + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + /* ======================================================= * * Style sheet for the Directory Express application * * ======================================================= */ diff --git a/ldap/clients/dsgw/userhtml/Makefile b/ldap/clients/dsgw/userhtml/Makefile index 4a19446a7..6e10caae0 100644 --- a/ldap/clients/dsgw/userhtml/Makefile +++ b/ldap/clients/dsgw/userhtml/Makefile @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright ? 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# END COPYRIGHT BLOCK # # # Gmakefile for Directory Server Gateway html files. diff --git a/ldap/clients/dsgw/userhtml/index.lst b/ldap/clients/dsgw/userhtml/index.lst index 83156146e..ebb6e3387 100644 --- a/ldap/clients/dsgw/userhtml/index.lst +++ b/ldap/clients/dsgw/userhtml/index.lst @@ -1,9 +1,9 @@ -;------------------------------------------------------------------------- -; PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -; license terms. Copyright ? 2001 Sun Microsystems, Inc. -; Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +; --- BEGIN COPYRIGHT BLOCK --- +; Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +; Copyright (C) 2005 Red Hat, Inc. ; All rights reserved. -;------------------------------------------------------------------------- +; --- END COPYRIGHT BLOCK --- +; ; Netscape admin index page master list ; ; Lines beginning with a ';' are comments diff --git a/ldap/clients/dsmlgw/Makefile b/ldap/clients/dsmlgw/Makefile index bca513bf9..1b05ebd71 100644 --- a/ldap/clients/dsmlgw/Makefile +++ b/ldap/clients/dsmlgw/Makefile @@ -1,3 +1,8 @@ +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + NOSTDCLEAN=true NO_BUILD_NUM=true COMPONENT_DEPS=true diff --git a/ldap/clients/dsmlgw/build.xml b/ldap/clients/dsmlgw/build.xml index 054e10f79..f2c2643de 100644 --- a/ldap/clients/dsmlgw/build.xml +++ b/ldap/clients/dsmlgw/build.xml @@ -1,4 +1,8 @@ <?xml version='1.0'?> +<!-- BEGIN COPYRIGHT BLOCK + Copyright (C) 2005 Red Hat, Inc. + All rights reserved. + END COPYRIGHT BLOCK --> <!-- ANT build script for the new dsml gateway --> <!-- Possible to compile by hand, use cd /ldapserver/ldap/clients/dsmlgw diff --git a/ldap/clients/dsmlgw/misc/dsmlgw.cfg b/ldap/clients/dsmlgw/misc/dsmlgw.cfg index d9686aa92..ab30530ab 100644 --- a/ldap/clients/dsmlgw/misc/dsmlgw.cfg +++ b/ldap/clients/dsmlgw/misc/dsmlgw.cfg @@ -1,3 +1,8 @@ +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# #properties file for the #Netscape DSMLGW # DSML Gateway diff --git a/ldap/clients/dsmlgw/misc/server-config.wsdd b/ldap/clients/dsmlgw/misc/server-config.wsdd index 8740196ba..747e14788 100644 --- a/ldap/clients/dsmlgw/misc/server-config.wsdd +++ b/ldap/clients/dsmlgw/misc/server-config.wsdd @@ -1,4 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- BEGIN COPYRIGHT BLOCK + Copyright (C) 2005 Red Hat, Inc. + All rights reserved. + END COPYRIGHT BLOCK --> <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <globalConfiguration> <parameter name="adminPassword" value="admin"/> diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/BatchProcessor.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/BatchProcessor.java index 31f9ca509..37220d037 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/BatchProcessor.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/BatchProcessor.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import org.w3c.dom.*; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Configuration.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Configuration.java index 98f78a62b..ed2b810d4 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Configuration.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Configuration.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import java.io.*; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Constants.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Constants.java index 6bb14f41a..5c3aa5d5e 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Constants.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Constants.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; /** diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/GenericOperation.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/GenericOperation.java index b718c519b..b02166a85 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/GenericOperation.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/GenericOperation.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; @@ -44,4 +41,4 @@ class GenericOperation { ldapConn = lc; } // abstract javax.xml.soap.SOAPElement getResponse(gatewayContext ctx); -} \ No newline at end of file +} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnMgrFactoryFunctor.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnMgrFactoryFunctor.java index c13a95032..07171053a 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnMgrFactoryFunctor.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnMgrFactoryFunctor.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; /** diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnectionManager.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnectionManager.java index ee4300f87..2caa0810b 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnectionManager.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnectionManager.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import java.io.IOException; @@ -27,4 +24,4 @@ public interface IConnectionManager { public LDAPConnection getConnection(String loginCtx); -} \ No newline at end of file +} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/LDAPAuthenticator.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/LDAPAuthenticator.java index 017c067b3..2493dd135 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/LDAPAuthenticator.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/LDAPAuthenticator.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import netscape.ldap.*; @@ -64,4 +61,4 @@ public class LDAPAuthenticator { return LDAPException.UNAVAILABLE ; } } -} \ No newline at end of file +} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAdd.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAdd.java index 5b3046c2a..ccca1f146 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAdd.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAdd.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import netscape.ldap.*; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAuth.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAuth.java index 776aeeb3f..1fd1dbde3 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAuth.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAuth.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import netscape.ldap.*; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationCompare.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationCompare.java index 45939c326..1d832604f 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationCompare.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationCompare.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import netscape.ldap.*; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationDelete.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationDelete.java index 995fc2bf0..d5d6c080f 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationDelete.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationDelete.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import netscape.ldap.*; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationExtended.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationExtended.java index bbffd9479..155ed7012 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationExtended.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationExtended.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import netscape.ldap.*; @@ -90,4 +87,4 @@ public class OperationExtended extends GenericOperation { } -} \ No newline at end of file +} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModify.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModify.java index f9d47ecb9..8ad4fca80 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModify.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModify.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import netscape.ldap.*; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModifyDN.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModifyDN.java index 138edb606..2bc194feb 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModifyDN.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModifyDN.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import netscape.ldap.*; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationSearch.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationSearch.java index f75d82382..538ae45b0 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationSearch.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationSearch.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import netscape.ldap.*; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseControl.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseControl.java index c0ac27a15..a49d7f318 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseControl.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseControl.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import org.w3c.dom.*; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseFilter.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseFilter.java index 85b884df0..25053a266 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseFilter.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseFilter.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import org.w3c.dom.*; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnMgrFactory.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnMgrFactory.java index 278d5a8cd..aa40b711a 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnMgrFactory.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnMgrFactory.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; /** diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnectionManager.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnectionManager.java index 230ca1088..246b48d7a 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnectionManager.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnectionManager.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import java.lang.Exception ; @@ -257,4 +254,4 @@ class ProxyConnectionManager implements IConnectionManager { } -} \ No newline at end of file +} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayContext.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayContext.java index d737e8bbf..17e21902b 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayContext.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayContext.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import netscape.ldap.*; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayException.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayException.java index 8bb5fb76c..252bdd52b 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayException.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayException.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayHandler.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayHandler.java index 6598dda38..8777a9f04 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayHandler.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayHandler.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayService.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayService.java index 4dba8fd05..3a220f091 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayService.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayService.java @@ -1,10 +1,7 @@ -/* - * Copyright 2004 Netscape Communications Corporation. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - * - * - * - */ + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.gateway; import javax.activation.DataHandler; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/SOAPClient.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/test/SOAPClient.java index 9b8914697..269a4f704 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/SOAPClient.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/test/SOAPClient.java @@ -1,11 +1,7 @@ -/* - * SOAPClient.java - * - * Created on June 24, 2004, 3:00 PM - */ - - - +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.test; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlClient.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlClient.java index 98fd255a5..e402adb86 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlClient.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlClient.java @@ -1,3 +1,7 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.test; import javax.xml.parsers.*; diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlSearch.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlSearch.java index bd0d8f8ad..bbe9bc9c6 100644 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlSearch.java +++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlSearch.java @@ -1,3 +1,7 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ package com.netscape.dsml.test; import javax.xml.parsers.*; diff --git a/ldap/clients/orgchart/botframe.html b/ldap/clients/orgchart/botframe.html index 7a8330765..7da32d0e4 100644 --- a/ldap/clients/orgchart/botframe.html +++ b/ldap/clients/orgchart/botframe.html @@ -1,4 +1,8 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<!-- BEGIN COPYRIGHT BLOCK + Copyright (C) 2005 Red Hat, Inc. + All rights reserved. + END COPYRIGHT BLOCK --> <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> diff --git a/ldap/clients/orgchart/config.tmpl b/ldap/clients/orgchart/config.tmpl index c5bfd749f..784dabbe2 100644 --- a/ldap/clients/orgchart/config.tmpl +++ b/ldap/clients/orgchart/config.tmpl @@ -1,3 +1,10 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# + #ldap-host localhost #ldap-port 389 #ldap-search-base dc=example,dc=com diff --git a/ldap/clients/orgchart/index.html b/ldap/clients/orgchart/index.html index 1bb68ae1e..627440403 100644 --- a/ldap/clients/orgchart/index.html +++ b/ldap/clients/orgchart/index.html @@ -1,3 +1,7 @@ +<!-- BEGIN COPYRIGHT BLOCK + Copyright (C) 2005 Red Hat, Inc. + All rights reserved. + END COPYRIGHT BLOCK --> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> diff --git a/ldap/clients/orgchart/myorg.bat b/ldap/clients/orgchart/myorg.bat index 88f10c11c..aee91d47f 100644 --- a/ldap/clients/orgchart/myorg.bat +++ b/ldap/clients/orgchart/myorg.bat @@ -1,2 +1,6 @@ +@rem // --- BEGIN COPYRIGHT BLOCK --- +@rem // Copyright (C) 2005 Red Hat, Inc. +@rem // All rights reserved. +@rem // --- END COPYRIGHT BLOCK --- @set path=..\..\..\bin\slapd\admin\bin;%path% @perl myorg.pl diff --git a/ldap/clients/orgchart/myorg.pl b/ldap/clients/orgchart/myorg.pl index 0161415da..4c0de7153 100755 --- a/ldap/clients/orgchart/myorg.pl +++ b/ldap/clients/orgchart/myorg.pl @@ -1,4 +1,11 @@ #!../../../bin/slapd/admin/bin/perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# + # #set ts=4 diff --git a/ldap/clients/orgchart/org.bat b/ldap/clients/orgchart/org.bat index c36e890b9..6a15fef55 100644 --- a/ldap/clients/orgchart/org.bat +++ b/ldap/clients/orgchart/org.bat @@ -1,2 +1,6 @@ +@rem // --- BEGIN COPYRIGHT BLOCK --- +@rem // Copyright (C) 2005 Red Hat, Inc. +@rem // All rights reserved. +@rem // --- END COPYRIGHT BLOCK --- @set path=..\..\..\bin\slapd\admin\bin;%path% @perl org.pl diff --git a/ldap/clients/orgchart/org.pl b/ldap/clients/orgchart/org.pl index c7eec21c6..07c4ef8f5 100755 --- a/ldap/clients/orgchart/org.pl +++ b/ldap/clients/orgchart/org.pl @@ -1,4 +1,11 @@ #!../../../bin/slapd/admin/bin/perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# + # #set ts=4 diff --git a/ldap/clients/orgchart/styles.css b/ldap/clients/orgchart/styles.css index 73bc65024..797d75916 100644 --- a/ldap/clients/orgchart/styles.css +++ b/ldap/clients/orgchart/styles.css @@ -1,3 +1,8 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + /* ======================================================================= * * Style sheet for the Directory Server Org Chart application * * ======================================================================= */ diff --git a/ldap/clients/orgchart/topframe.html b/ldap/clients/orgchart/topframe.html index c6e1b637a..93281f860 100644 --- a/ldap/clients/orgchart/topframe.html +++ b/ldap/clients/orgchart/topframe.html @@ -1,3 +1,7 @@ +<!-- BEGIN COPYRIGHT BLOCK + Copyright (C) 2005 Red Hat, Inc. + All rights reserved. + END COPYRIGHT BLOCK --> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> diff --git a/ldap/clients/orgchart/wrapper.c b/ldap/clients/orgchart/wrapper.c index 1cead680c..23314d034 100644 --- a/ldap/clients/orgchart/wrapper.c +++ b/ldap/clients/orgchart/wrapper.c @@ -1,10 +1,7 @@ -/*********************************************************************** -** Copyright 1996 - Netscape Communications Corporation -** -** Contact: Fred Cox <[email protected]> -** -** Name: perl.c -***********************************************************************/ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ /*********************************************************************** ** Includes diff --git a/ldap/cm/newinst/setup.pl b/ldap/cm/newinst/setup.pl index f5c95b653..cee72f6fb 100755 --- a/ldap/cm/newinst/setup.pl +++ b/ldap/cm/newinst/setup.pl @@ -1,5 +1,8 @@ #!./tools/perl -# Author: Nathan Kinder +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- # # This program will package a downloaded JRE into a nsjre.zip # file suitable for a DS install. diff --git a/ldap/cm/newinst/setup.sh b/ldap/cm/newinst/setup.sh index a4059e943..ba72c2725 100755 --- a/ldap/cm/newinst/setup.sh +++ b/ldap/cm/newinst/setup.sh @@ -1,4 +1,8 @@ #!/bin/sh +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- # Configure nsPerl if [ ! -f "./tools/perl" ]; then diff --git a/ldap/cm/newinstnt/dsinst.rc b/ldap/cm/newinstnt/dsinst.rc index 5a6ba2782..83e433ed0 100644 --- a/ldap/cm/newinstnt/dsinst.rc +++ b/ldap/cm/newinstnt/dsinst.rc @@ -1,3 +1,9 @@ +// --- BEGIN COPYRIGHT BLOCK --- +// Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +// Copyright (C) 2005 Red Hat, Inc. +// All rights reserved. +// --- END COPYRIGHT BLOCK --- + //Microsoft Developer Studio generated resource script. // #include "resource.h" diff --git a/ldap/cm/newinstnt/resource.h b/ldap/cm/newinstnt/resource.h index 6c8d6af3b..7e1910a2e 100644 --- a/ldap/cm/newinstnt/resource.h +++ b/ldap/cm/newinstnt/resource.h @@ -1,3 +1,9 @@ +// --- BEGIN COPYRIGHT BLOCK --- +// Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +// Copyright (C) 2005 Red Hat, Inc. +// All rights reserved. +// --- END COPYRIGHT BLOCK --- + //{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by dsinst.rc diff --git a/ldap/cm/newinstnt/setup.bat b/ldap/cm/newinstnt/setup.bat index ce42aaf25..7c9f88221 100644 --- a/ldap/cm/newinstnt/setup.bat +++ b/ldap/cm/newinstnt/setup.bat @@ -1,3 +1,8 @@ +@rem // --- BEGIN COPYRIGHT BLOCK --- +@rem // Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +@rem // Copyright (C) 2005 Red Hat, Inc. +@rem // All rights reserved. +@rem // --- END COPYRIGHT BLOCK --- @echo off tools\perl setup.pl %* diff --git a/ldap/servers/plugins/distrib/Makefile b/ldap/servers/plugins/distrib/Makefile index 3f26ca76d..ab92eba0f 100644 --- a/ldap/servers/plugins/distrib/Makefile +++ b/ldap/servers/plugins/distrib/Makefile @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright 2001 Netscape Communications Corp. +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# --- END COPYRIGHT BLOCK --- # # # GNU Makefile for Directory Server distribution plugin diff --git a/ldap/servers/plugins/distrib/Makefile.AIX b/ldap/servers/plugins/distrib/Makefile.AIX index d155626db..b783a1b83 100644 --- a/ldap/servers/plugins/distrib/Makefile.AIX +++ b/ldap/servers/plugins/distrib/Makefile.AIX @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright 2001 Netscape Communications Corp. +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# --- END COPYRIGHT BLOCK --- # # AIX Makefile for Directory Server plug-in examples # NOTE: Make sure to set the DSLIB variable to the path diff --git a/ldap/servers/plugins/distrib/Makefile.BSDI b/ldap/servers/plugins/distrib/Makefile.BSDI index c8016c9e8..58a69ab4f 100644 --- a/ldap/servers/plugins/distrib/Makefile.BSDI +++ b/ldap/servers/plugins/distrib/Makefile.BSDI @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright 2001 Netscape Communications Corp. +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# --- END COPYRIGHT BLOCK --- # # SOLARIS Makefile for Directory Server plug-in examples # diff --git a/ldap/servers/plugins/distrib/Makefile.HPUX b/ldap/servers/plugins/distrib/Makefile.HPUX index 34c24521d..56281e054 100644 --- a/ldap/servers/plugins/distrib/Makefile.HPUX +++ b/ldap/servers/plugins/distrib/Makefile.HPUX @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright 2001 Netscape Communications Corp. +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# --- END COPYRIGHT BLOCK --- # # HPUX Makefile for Directory Server plug-in examples diff --git a/ldap/servers/plugins/distrib/Makefile.HPUX64 b/ldap/servers/plugins/distrib/Makefile.HPUX64 index d6a093396..0ac16a50c 100644 --- a/ldap/servers/plugins/distrib/Makefile.HPUX64 +++ b/ldap/servers/plugins/distrib/Makefile.HPUX64 @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright 2001 Netscape Communications Corp. +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# --- END COPYRIGHT BLOCK --- # # HPUX Makefile for Directory Server plug-in examples diff --git a/ldap/servers/plugins/distrib/Makefile.IRIX b/ldap/servers/plugins/distrib/Makefile.IRIX index f2ffc0c78..f387b2525 100644 --- a/ldap/servers/plugins/distrib/Makefile.IRIX +++ b/ldap/servers/plugins/distrib/Makefile.IRIX @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright 2001 Netscape Communications Corp. +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# --- END COPYRIGHT BLOCK --- # # IRIX Makefile for Directory Server plug-in examples # diff --git a/ldap/servers/plugins/distrib/Makefile.Linux b/ldap/servers/plugins/distrib/Makefile.Linux index b5fe839fb..6bf42527b 100644 --- a/ldap/servers/plugins/distrib/Makefile.Linux +++ b/ldap/servers/plugins/distrib/Makefile.Linux @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright 2001 Netscape Communications Corp. +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# --- END COPYRIGHT BLOCK --- # # SOLARIS Makefile for Directory Server plug-in examples # diff --git a/ldap/servers/plugins/distrib/Makefile.OSF1 b/ldap/servers/plugins/distrib/Makefile.OSF1 index 2c2c4660d..459b8a6d6 100644 --- a/ldap/servers/plugins/distrib/Makefile.OSF1 +++ b/ldap/servers/plugins/distrib/Makefile.OSF1 @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright 2001 Netscape Communications Corp. +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# --- END COPYRIGHT BLOCK --- # # OSF1 Makefile for Directory Server plug-in examples diff --git a/ldap/servers/plugins/distrib/Makefile.ReliantUNIX b/ldap/servers/plugins/distrib/Makefile.ReliantUNIX index c8016c9e8..58a69ab4f 100644 --- a/ldap/servers/plugins/distrib/Makefile.ReliantUNIX +++ b/ldap/servers/plugins/distrib/Makefile.ReliantUNIX @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright 2001 Netscape Communications Corp. +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# --- END COPYRIGHT BLOCK --- # # SOLARIS Makefile for Directory Server plug-in examples # diff --git a/ldap/servers/plugins/distrib/Makefile.SOLARIS b/ldap/servers/plugins/distrib/Makefile.SOLARIS index c8016c9e8..58a69ab4f 100644 --- a/ldap/servers/plugins/distrib/Makefile.SOLARIS +++ b/ldap/servers/plugins/distrib/Makefile.SOLARIS @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright 2001 Netscape Communications Corp. +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# --- END COPYRIGHT BLOCK --- # # SOLARIS Makefile for Directory Server plug-in examples # diff --git a/ldap/servers/plugins/distrib/Makefile.SOLARIS64 b/ldap/servers/plugins/distrib/Makefile.SOLARIS64 index 170d2b47e..f7093b3c2 100644 --- a/ldap/servers/plugins/distrib/Makefile.SOLARIS64 +++ b/ldap/servers/plugins/distrib/Makefile.SOLARIS64 @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright 2001 Netscape Communications Corp. +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# --- END COPYRIGHT BLOCK --- # # SOLARIS Makefile for Directory Server plug-in examples # diff --git a/ldap/servers/plugins/distrib/Makefile.SOLARISx86 b/ldap/servers/plugins/distrib/Makefile.SOLARISx86 index c8016c9e8..58a69ab4f 100644 --- a/ldap/servers/plugins/distrib/Makefile.SOLARISx86 +++ b/ldap/servers/plugins/distrib/Makefile.SOLARISx86 @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright 2001 Netscape Communications Corp. +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# --- END COPYRIGHT BLOCK --- # # SOLARIS Makefile for Directory Server plug-in examples # diff --git a/ldap/servers/plugins/distrib/Makefile.UnixWare b/ldap/servers/plugins/distrib/Makefile.UnixWare index c8016c9e8..58a69ab4f 100644 --- a/ldap/servers/plugins/distrib/Makefile.UnixWare +++ b/ldap/servers/plugins/distrib/Makefile.UnixWare @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright 2001 Netscape Communications Corp. +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# --- END COPYRIGHT BLOCK --- # # SOLARIS Makefile for Directory Server plug-in examples # diff --git a/ldap/servers/plugins/distrib/Makefile.UnixWareUDK b/ldap/servers/plugins/distrib/Makefile.UnixWareUDK index c8016c9e8..58a69ab4f 100644 --- a/ldap/servers/plugins/distrib/Makefile.UnixWareUDK +++ b/ldap/servers/plugins/distrib/Makefile.UnixWareUDK @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright 2001 Netscape Communications Corp. +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# --- END COPYRIGHT BLOCK --- # # SOLARIS Makefile for Directory Server plug-in examples # diff --git a/ldap/servers/plugins/distrib/Makefile.WINNT b/ldap/servers/plugins/distrib/Makefile.WINNT index ddb02e298..34279b192 100644 --- a/ldap/servers/plugins/distrib/Makefile.WINNT +++ b/ldap/servers/plugins/distrib/Makefile.WINNT @@ -1,3 +1,9 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- +# # Makefile for Directory Server plug-in # diff --git a/ldap/servers/plugins/distrib/README b/ldap/servers/plugins/distrib/README index 516d33ce7..14a7a2cae 100644 --- a/ldap/servers/plugins/distrib/README +++ b/ldap/servers/plugins/distrib/README @@ -1,3 +1,9 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + ---------------------------- Sample pluggable distribution logic for Netscape Directory Server @@ -14,10 +20,3 @@ distrib.c ---------- This is an example of a distribution function that can be used to distribute a flat namespace into several backends - -/** - * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to - * license terms. Copyright 2001 Sun Microsystems, Inc. - * Some preexisting portions Copyright 2001 Netscape Communications Corp. - * All rights reserved. - */ diff --git a/ldap/servers/plugins/distrib/distrib.c b/ldap/servers/plugins/distrib/distrib.c index fd8ea5b62..8b40a06ae 100644 --- a/ldap/servers/plugins/distrib/distrib.c +++ b/ldap/servers/plugins/distrib/distrib.c @@ -1,9 +1,8 @@ -/** - * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to - * license terms. Copyright 2001 Sun Microsystems, Inc. - * Some preexisting portions Copyright 2001 Netscape Communications Corp. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - */ + * --- END COPYRIGHT BLOCK --- */ #include <ctype.h> #include <string.h> #include "slapi-plugin.h" diff --git a/ldap/servers/plugins/distrib/dllmain.c b/ldap/servers/plugins/distrib/dllmain.c index bce5eed76..5f6517ef4 100644 --- a/ldap/servers/plugins/distrib/dllmain.c +++ b/ldap/servers/plugins/distrib/dllmain.c @@ -1,19 +1,8 @@ -/** - * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to - * license terms. Copyright 2001 Sun Microsystems, Inc. - * Some preexisting portions Copyright 2001 Netscape Communications Corp. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - */ -/* - * Copyright (C) 2000 Sun Microsystems Inc. - * - * Use of this Source Code is subject to the terms of the applicable license - * agreement from Sun Microsystems Inc. - * - * The copyright notice(s) in this Source Code does not indicate actual or - * intended publication of this Source Code. - */ - + * --- END COPYRIGHT BLOCK --- */ /* * Microsoft Windows specifics */ diff --git a/ldap/servers/plugins/distrib/libdistrib.def b/ldap/servers/plugins/distrib/libdistrib.def index 9c36e66dd..2ee3c79ed 100644 --- a/ldap/servers/plugins/distrib/libdistrib.def +++ b/ldap/servers/plugins/distrib/libdistrib.def @@ -1,9 +1,8 @@ -;------------------------------------------------------------------------- -; PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -; license terms. Copyright 2001 Sun Microsystems, Inc. -; Some preexisting portions Copyright 2001 Netscape Communications Corp. +; --- BEGIN COPYRIGHT BLOCK --- +; Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +; Copyright (C) 2005 Red Hat, Inc. ; All rights reserved. -;------------------------------------------------------------------------- +; --- END COPYRIGHT BLOCK --- DESCRIPTION 'Brandx Directory Server 7 distribution logic example' EXPORTS alpha_distribution @1 diff --git a/ldap/servers/plugins/http/Makefile b/ldap/servers/plugins/http/Makefile index ba10ab35e..9d3fe52d7 100644 --- a/ldap/servers/plugins/http/Makefile +++ b/ldap/servers/plugins/http/Makefile @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright 2001 Netscape Communications Corp. +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# --- END COPYRIGHT BLOCK --- # LDAP_SRC = ../../.. BUILD_ROOT = ../../../.. diff --git a/ldap/servers/plugins/http/dllmain.c b/ldap/servers/plugins/http/dllmain.c index ef1f637a6..10dc7f82e 100644 --- a/ldap/servers/plugins/http/dllmain.c +++ b/ldap/servers/plugins/http/dllmain.c @@ -1,9 +1,9 @@ -/** - * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to - * license terms. Copyright 2001 Sun Microsystems, Inc. - * Some preexisting portions Copyright 2001 Netscape Communications Corp. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - */ + * --- END COPYRIGHT BLOCK --- */ + /* * Microsoft Windows specifics for BACK-LDBM DLL */ diff --git a/ldap/servers/plugins/http/http.def b/ldap/servers/plugins/http/http.def index ac2f3e054..c36568ee6 100644 --- a/ldap/servers/plugins/http/http.def +++ b/ldap/servers/plugins/http/http.def @@ -1,9 +1,9 @@ -;------------------------------------------------------------------------- -; PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -; license terms. Copyright 2001 Sun Microsystems, Inc. -; Some preexisting portions Copyright 2001 Netscape Communications Corp. +; --- BEGIN COPYRIGHT BLOCK --- +; Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +; Copyright (C) 2005 Red Hat, Inc. ; All rights reserved. -;------------------------------------------------------------------------- +; --- END COPYRIGHT BLOCK --- + DESCRIPTION 'Netscape Directory Server Http Client' EXPORTS http_client_init @2 diff --git a/ldap/servers/plugins/http/http_client.c b/ldap/servers/plugins/http/http_client.c index 3ed24f9b3..73889ff87 100644 --- a/ldap/servers/plugins/http/http_client.c +++ b/ldap/servers/plugins/http/http_client.c @@ -1,9 +1,8 @@ -/** - * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to - * license terms. Copyright 2001 Sun Microsystems, Inc. - * Some preexisting portions Copyright 2001 Netscape Communications Corp. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - */ + * --- END COPYRIGHT BLOCK --- */ /** * Simple Http Client API broker plugin diff --git a/ldap/servers/plugins/http/http_client.h b/ldap/servers/plugins/http/http_client.h index d849e18d6..6851ff305 100644 --- a/ldap/servers/plugins/http/http_client.h +++ b/ldap/servers/plugins/http/http_client.h @@ -1,9 +1,8 @@ -/** - * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to - * license terms. Copyright 2001 Sun Microsystems, Inc. - * Some preexisting portions Copyright 2001 Netscape Communications Corp. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - */ + * --- END COPYRIGHT BLOCK --- */ #ifndef _HTTP_CLIENT_H_ #define _HTTP_CLIENT_H_ diff --git a/ldap/servers/plugins/http/http_impl.c b/ldap/servers/plugins/http/http_impl.c index 8c216775a..285d2f242 100644 --- a/ldap/servers/plugins/http/http_impl.c +++ b/ldap/servers/plugins/http/http_impl.c @@ -1,9 +1,9 @@ -/** - * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to - * license terms. Copyright 2001 Sun Microsystems, Inc. - * Some preexisting portions Copyright 2001 Netscape Communications Corp. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - */ + * --- END COPYRIGHT BLOCK --- */ + /** * Implementation of a Simple HTTP Client */ diff --git a/ldap/servers/plugins/http/http_impl.h b/ldap/servers/plugins/http/http_impl.h index 0bca3ca23..a36730a98 100644 --- a/ldap/servers/plugins/http/http_impl.h +++ b/ldap/servers/plugins/http/http_impl.h @@ -1,9 +1,9 @@ -/** - * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to - * license terms. Copyright 2001 Sun Microsystems, Inc. - * Some preexisting portions Copyright 2001 Netscape Communications Corp. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - */ + * --- END COPYRIGHT BLOCK --- */ + #ifndef HTTP_IMPL_H__ #define HTTP_IMPL_H__ diff --git a/ldap/servers/plugins/pam_passthru/config.ldif b/ldap/servers/plugins/pam_passthru/config.ldif index 2dd9065cc..05b04e808 100644 --- a/ldap/servers/plugins/pam_passthru/config.ldif +++ b/ldap/servers/plugins/pam_passthru/config.ldif @@ -1,3 +1,8 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- dn: cn=PAM Pass Through Auth,cn=plugins,cn=config objectclass: top objectclass: nsSlapdPlugin diff --git a/ldap/servers/plugins/presence/presence.ldif b/ldap/servers/plugins/presence/presence.ldif index 67bb977b3..e704a42d2 100644 --- a/ldap/servers/plugins/presence/presence.ldif +++ b/ldap/servers/plugins/presence/presence.ldif @@ -1,3 +1,8 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- dn:cn=ICQ Presence,cn=Presence,cn=plugins,cn=config changeType:modify replace:nsim-onvaluemapgraphic diff --git a/ldap/servers/slapd/http.h b/ldap/servers/slapd/http.h index 7c1654a5a..5ced21ffb 100644 --- a/ldap/servers/slapd/http.h +++ b/ldap/servers/slapd/http.h @@ -1,9 +1,8 @@ -/** - * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to - * license terms. Copyright 2001 Sun Microsystems, Inc. - * Some preexisting portions Copyright 2001 Netscape Communications Corp. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - */ + * --- END COPYRIGHT BLOCK --- */ #ifndef _HTTP_H_ #define _HTTP_H_ diff --git a/ldap/servers/slapd/test-plugins/Makefile.server b/ldap/servers/slapd/test-plugins/Makefile.server index dda856e58..f96f72f1b 100644 --- a/ldap/servers/slapd/test-plugins/Makefile.server +++ b/ldap/servers/slapd/test-plugins/Makefile.server @@ -1,8 +1,8 @@ -# -# PROPRIETARY/CONFIDENTIAL. Use of this product is subject to -# license terms. Copyright 2001 Sun Microsystems, Inc. -# Some preexisting portions Copyright 2001 Netscape Communications Corp. +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. # All rights reserved. +# --- END COPYRIGHT BLOCK --- # # # GNU Makefile for Directory Server distribution plugin diff --git a/ldap/servers/slapd/test-plugins/installDse.pl b/ldap/servers/slapd/test-plugins/installDse.pl index 6b827ab46..e33d8a28f 100755 --- a/ldap/servers/slapd/test-plugins/installDse.pl +++ b/ldap/servers/slapd/test-plugins/installDse.pl @@ -1,3 +1,9 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- +# # The script is used to load the config mapping tree node for the null suffix # and to load the test sample plugin node into the Directory Server used to # demonstrate the Data Interoperability feature for Verisign. diff --git a/ldap/servers/slapd/test-plugins/testdbinterop.c b/ldap/servers/slapd/test-plugins/testdbinterop.c index 7da3e72fb..edde03ab3 100644 --- a/ldap/servers/slapd/test-plugins/testdbinterop.c +++ b/ldap/servers/slapd/test-plugins/testdbinterop.c @@ -1,3 +1,9 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + #include <sys/types.h> #include <stdio.h> #include "db.h" diff --git a/ldap/servers/snmp/ldap-agent.c b/ldap/servers/snmp/ldap-agent.c index efce41060..80b5dea15 100644 --- a/ldap/servers/snmp/ldap-agent.c +++ b/ldap/servers/snmp/ldap-agent.c @@ -1,3 +1,8 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + #include <stdio.h> #include <time.h> #include <net-snmp/net-snmp-config.h> diff --git a/ldap/servers/snmp/ldap-agent.h b/ldap/servers/snmp/ldap-agent.h index 4ce3fcf38..eeb010c57 100644 --- a/ldap/servers/snmp/ldap-agent.h +++ b/ldap/servers/snmp/ldap-agent.h @@ -1,3 +1,8 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + #ifndef DSOPSTABLE_H #define DSOPSTABLE_H diff --git a/ldap/servers/snmp/main.c b/ldap/servers/snmp/main.c index a0900de3e..87ff65d59 100644 --- a/ldap/servers/snmp/main.c +++ b/ldap/servers/snmp/main.c @@ -1,3 +1,8 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + #include <net-snmp/net-snmp-config.h> #include <net-snmp/net-snmp-includes.h> #include <net-snmp/agent/net-snmp-agent-includes.h> diff --git a/ldap/synctools/passwordsync/build.bat b/ldap/synctools/passwordsync/build.bat index 323e62885..a5fcf1f58 100644 --- a/ldap/synctools/passwordsync/build.bat +++ b/ldap/synctools/passwordsync/build.bat @@ -1,3 +1,8 @@ +@rem // --- BEGIN COPYRIGHT BLOCK --- +@rem // Copyright (C) 2005 Red Hat, Inc. +@rem // All rights reserved. +@rem // --- END COPYRIGHT BLOCK --- + @echo off cd passsync nmake passsync.mak diff --git a/ldap/synctools/passwordsync/passhand.cpp b/ldap/synctools/passwordsync/passhand.cpp index 23725e78c..56cd80ed3 100644 --- a/ldap/synctools/passwordsync/passhand.cpp +++ b/ldap/synctools/passwordsync/passhand.cpp @@ -1,3 +1,8 @@ +// --- BEGIN COPYRIGHT BLOCK --- +// Copyright (C) 2005 Red Hat, Inc. +// All rights reserved. +// --- END COPYRIGHT BLOCK --- + // Created: 2-8-2005 // Author(s): Scott Bridges #include "passhand.h" @@ -119,4 +124,4 @@ int PasswordHandler::PopUserPass() userPassPairs.pop_front(); return 0; -} \ No newline at end of file +} diff --git a/ldap/synctools/passwordsync/passhand.h b/ldap/synctools/passwordsync/passhand.h index 03b5f630d..77ae2a5a8 100644 --- a/ldap/synctools/passwordsync/passhand.h +++ b/ldap/synctools/passwordsync/passhand.h @@ -1,3 +1,8 @@ +// --- BEGIN COPYRIGHT BLOCK --- +// Copyright (C) 2005 Red Hat, Inc. +// All rights reserved. +// --- END COPYRIGHT BLOCK --- + // Created: 2-8-2005 // Author(s): Scott Bridges #ifndef _PASSHAND_H_ @@ -37,4 +42,4 @@ private: list<USER_PASS_PAIR> userPassPairs; }; -#endif \ No newline at end of file +#endif diff --git a/ldap/synctools/passwordsync/passhook/passhook.cpp b/ldap/synctools/passwordsync/passhook/passhook.cpp index ff49d5758..acefde1f9 100644 --- a/ldap/synctools/passwordsync/passhook/passhook.cpp +++ b/ldap/synctools/passwordsync/passhook/passhook.cpp @@ -1,3 +1,8 @@ +// --- BEGIN COPYRIGHT BLOCK --- +// Copyright (C) 2005 Red Hat, Inc. +// All rights reserved. +// --- END COPYRIGHT BLOCK --- + // Created: 2-8-2005 // Author(s): Scott Bridges #include <windows.h> @@ -44,4 +49,4 @@ BOOL NTAPI PasswordFilter( BOOL NTAPI InitializeChangeNotify() { return TRUE; -} \ No newline at end of file +} diff --git a/ldap/synctools/passwordsync/passhook/passhook.def b/ldap/synctools/passwordsync/passhook/passhook.def index eeddeeeaa..53588567e 100644 --- a/ldap/synctools/passwordsync/passhook/passhook.def +++ b/ldap/synctools/passwordsync/passhook/passhook.def @@ -1,3 +1,7 @@ +; --- BEGIN COPYRIGHT BLOCK --- +; Copyright (C) 2005 Red Hat, Inc. +; All rights reserved. +; --- END COPYRIGHT BLOCK --- LIBRARY passhook EXPORTS diff --git a/ldap/synctools/passwordsync/passhook/passhook.dep b/ldap/synctools/passwordsync/passhook/passhook.dep index 5eb1b6b5e..3d99110a8 100644 --- a/ldap/synctools/passwordsync/passhook/passhook.dep +++ b/ldap/synctools/passwordsync/passhook/passhook.dep @@ -1,3 +1,8 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- + # Microsoft Developer Studio Generated Dependency File, included by passhook.mak ..\passhand.cpp : \ diff --git a/ldap/synctools/passwordsync/passhook/passhook.dsp b/ldap/synctools/passwordsync/passhook/passhook.dsp index 385972a3b..b30066ef6 100644 --- a/ldap/synctools/passwordsync/passhook/passhook.dsp +++ b/ldap/synctools/passwordsync/passhook/passhook.dsp @@ -1,3 +1,8 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- + # Microsoft Developer Studio Project File - Name="passhook" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** diff --git a/ldap/synctools/passwordsync/passhook/passhook.mak b/ldap/synctools/passwordsync/passhook/passhook.mak index 7f24e3caa..4e2c8a3e2 100644 --- a/ldap/synctools/passwordsync/passhook/passhook.mak +++ b/ldap/synctools/passwordsync/passhook/passhook.mak @@ -1,3 +1,8 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- + # Microsoft Developer Studio Generated NMAKE File, Based on passhook.dsp !IF "$(CFG)" == "" CFG=passhook - Win32 Debug diff --git a/ldap/synctools/passwordsync/passsync.dsw b/ldap/synctools/passwordsync/passsync.dsw index f20d73a05..7c4437de2 100644 --- a/ldap/synctools/passwordsync/passsync.dsw +++ b/ldap/synctools/passwordsync/passsync.dsw @@ -1,4 +1,8 @@ Microsoft Developer Studio Workspace File, Format Version 6.00 +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### diff --git a/ldap/synctools/passwordsync/passsync/dssynch.h b/ldap/synctools/passwordsync/passsync/dssynch.h index f594cccdc..c3f7bac56 100644 --- a/ldap/synctools/passwordsync/passsync/dssynch.h +++ b/ldap/synctools/passwordsync/passsync/dssynch.h @@ -1,13 +1,10 @@ -/** - * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to - * license terms. Copyright ? 2001 Sun Microsystems, Inc. - * Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - */ + * --- END COPYRIGHT BLOCK --- */ + /*********************************************************************** ** -** Copyright 1996 - Netscape Communications Corporation -** ** NAME ** DSSynch.h ** diff --git a/ldap/synctools/passwordsync/passsync/dssynchmsg.h b/ldap/synctools/passwordsync/passsync/dssynchmsg.h index b3d2753ec..081df79f1 100644 --- a/ldap/synctools/passwordsync/passsync/dssynchmsg.h +++ b/ldap/synctools/passwordsync/passsync/dssynchmsg.h @@ -1,3 +1,7 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ // // Values are 32 bit values layed out as follows: // diff --git a/ldap/synctools/passwordsync/passsync/ntservice.cpp b/ldap/synctools/passwordsync/passsync/ntservice.cpp index 6d0f1151f..2da478de2 100644 --- a/ldap/synctools/passwordsync/passsync/ntservice.cpp +++ b/ldap/synctools/passwordsync/passsync/ntservice.cpp @@ -1,7 +1,10 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + /*********************************************************************** ** -** Copyright 1996 - Netscape Communications Corporation -** ** NAME ** NTService.cpp ** diff --git a/ldap/synctools/passwordsync/passsync/ntservice.h b/ldap/synctools/passwordsync/passsync/ntservice.h index 38233ab17..1ac9d8d3f 100644 --- a/ldap/synctools/passwordsync/passsync/ntservice.h +++ b/ldap/synctools/passwordsync/passsync/ntservice.h @@ -1,7 +1,10 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + /*********************************************************************** ** -** Copyright 1996 - Netscape Communications Corporation -** ** NAME ** NTService.h ** diff --git a/ldap/synctools/passwordsync/passsync/passsync.dep b/ldap/synctools/passwordsync/passsync/passsync.dep index 36cca3c75..8a9e62765 100644 --- a/ldap/synctools/passwordsync/passsync/passsync.dep +++ b/ldap/synctools/passwordsync/passsync/passsync.dep @@ -1,3 +1,8 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- + # Microsoft Developer Studio Generated Dependency File, included by passsync.mak .\ntservice.cpp : \ diff --git a/ldap/synctools/passwordsync/passsync/passsync.dsp b/ldap/synctools/passwordsync/passsync/passsync.dsp index e4d8c4de6..fcd102980 100644 --- a/ldap/synctools/passwordsync/passsync/passsync.dsp +++ b/ldap/synctools/passwordsync/passsync/passsync.dsp @@ -1,5 +1,9 @@ # Microsoft Developer Studio Project File - Name="passsync" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 diff --git a/ldap/synctools/passwordsync/passsync/passsync.mak b/ldap/synctools/passwordsync/passsync/passsync.mak index 58ed9269d..f62dbb712 100644 --- a/ldap/synctools/passwordsync/passsync/passsync.mak +++ b/ldap/synctools/passwordsync/passsync/passsync.mak @@ -1,3 +1,7 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- # Microsoft Developer Studio Generated NMAKE File, Based on passsync.dsp !IF "$(CFG)" == "" CFG=passsync - Win32 Debug diff --git a/ldap/synctools/passwordsync/passsync/service.cpp b/ldap/synctools/passwordsync/passsync/service.cpp index 09e0ce687..66fb036c6 100644 --- a/ldap/synctools/passwordsync/passsync/service.cpp +++ b/ldap/synctools/passwordsync/passsync/service.cpp @@ -1,3 +1,8 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + // Created: 2-8-2005 // Author(s): Scott Bridges diff --git a/ldap/synctools/passwordsync/passsync/subuniutil.cpp b/ldap/synctools/passwordsync/passsync/subuniutil.cpp index 398e8a762..5a91c3fc2 100644 --- a/ldap/synctools/passwordsync/passsync/subuniutil.cpp +++ b/ldap/synctools/passwordsync/passsync/subuniutil.cpp @@ -1,3 +1,8 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ #include "subuniutil.h" // Copied: 2-8-2005 @@ -56,4 +61,4 @@ StrToUnicode( const char *buf ) ASCIIToUnicode( buf, unibuf, sizeof(unibuf) ); return _wcsdup( unibuf ); } -// End Copy \ No newline at end of file +// End Copy diff --git a/ldap/synctools/passwordsync/passsync/subuniutil.h b/ldap/synctools/passwordsync/passsync/subuniutil.h index 49d71f494..b159dc280 100644 --- a/ldap/synctools/passwordsync/passsync/subuniutil.h +++ b/ldap/synctools/passwordsync/passsync/subuniutil.h @@ -1,3 +1,8 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ #ifndef _SUBUNIUTIL_H_ #define _SUBUNIUTIL_H_ diff --git a/ldap/synctools/passwordsync/passsync/synchcmds.h b/ldap/synctools/passwordsync/passsync/synchcmds.h index 0b1c42100..40bc1386c 100644 --- a/ldap/synctools/passwordsync/passsync/synchcmds.h +++ b/ldap/synctools/passwordsync/passsync/synchcmds.h @@ -1,13 +1,10 @@ -/** - * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to - * license terms. Copyright ? 2001 Sun Microsystems, Inc. - * Some preexisting portions Copyright ? 2001 Netscape Communications Corp. +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. - */ + * --- END COPYRIGHT BLOCK --- */ /*********************************************************************** ** -** Copyright 1996 - Netscape Communications Corporation -** ** NAME ** synchcmds.h ** diff --git a/ldap/synctools/passwordsync/passsync/syncserv.cpp b/ldap/synctools/passwordsync/passsync/syncserv.cpp index 800e2977b..00248b503 100644 --- a/ldap/synctools/passwordsync/passsync/syncserv.cpp +++ b/ldap/synctools/passwordsync/passsync/syncserv.cpp @@ -1,3 +1,8 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + // Created: 2-8-2005 // Author(s): Scott Bridges #include "syncserv.h" @@ -233,4 +238,4 @@ int PassSyncService::ModifyPassword(char* dn, char* password) } return 0; -} \ No newline at end of file +} diff --git a/ldap/synctools/passwordsync/passsync/syncserv.h b/ldap/synctools/passwordsync/passsync/syncserv.h index 64b95260b..9a2ec93ba 100644 --- a/ldap/synctools/passwordsync/passsync/syncserv.h +++ b/ldap/synctools/passwordsync/passsync/syncserv.h @@ -1,3 +1,8 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + // Created: 2-8-2005 // Author(s): Scott Bridges #ifndef _SYNCSERV_H_ @@ -52,4 +57,4 @@ private: bool multipleModify; }; -#endif \ No newline at end of file +#endif diff --git a/ldap/synctools/passwordsync/wix/PassSync.wxs b/ldap/synctools/passwordsync/wix/PassSync.wxs index 3cefe39f1..a5e1a6a8d 100644 --- a/ldap/synctools/passwordsync/wix/PassSync.wxs +++ b/ldap/synctools/passwordsync/wix/PassSync.wxs @@ -1,4 +1,8 @@ <?xml version='1.0' encoding='windows-1252'?> +<!-- BEGIN COPYRIGHT BLOCK + Copyright (C) 2005 Red Hat, Inc. + All rights reserved. + END COPYRIGHT BLOCK --> <Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'> <Product Name='Password Sync' Id='DB501C18-86C7-4D14-AEC0-86416A69ABDE' Language='1033' Codepage='1252' diff --git a/ldap/systools/getHPPatches.pl b/ldap/systools/getHPPatches.pl index 4d1be441e..65055ab56 100755 --- a/ldap/systools/getHPPatches.pl +++ b/ldap/systools/getHPPatches.pl @@ -1,4 +1,9 @@ #!/tools/ns/bin/perl5.6.1 -w +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- $patchcmd = "swlist -l bundle"; # [output sample] diff --git a/ldap/systools/getSolPatches.pl b/ldap/systools/getSolPatches.pl index 7b463fefb..ab2b9fc07 100755 --- a/ldap/systools/getSolPatches.pl +++ b/ldap/systools/getSolPatches.pl @@ -1,4 +1,9 @@ #!/usr/bin/perl -w +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- $patchdir = "/var/sadm/patch"; diff --git a/ldap/systools/hp_patches.c b/ldap/systools/hp_patches.c index a4741ecc2..09f77105b 100644 --- a/ldap/systools/hp_patches.c +++ b/ldap/systools/hp_patches.c @@ -1,3 +1,8 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ {"PHSS_30966","1.0","ld(1) and linker tools cumulative patch",0,0,0}, {"PHSS_29486","1.0","KRB5-Client Version 1.0 cumulative patch",0,0,0}, {"PHSS_29487","1.0","GSS-API Version 1.0 Cumulative patch",0,0,0}, diff --git a/ldap/systools/mergeSolPatches.pl b/ldap/systools/mergeSolPatches.pl index 4deefad41..cd80bf172 100755 --- a/ldap/systools/mergeSolPatches.pl +++ b/ldap/systools/mergeSolPatches.pl @@ -1,4 +1,9 @@ #!/usr/bin/perl -w +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- # take a solaris8 patch list and a solaris9 patch list and merge them # together, removing duplicates diff --git a/ldap/systools/sol_patches.c b/ldap/systools/sol_patches.c index 4363087d0..dc1dfe963 100644 --- a/ldap/systools/sol_patches.c +++ b/ldap/systools/sol_patches.c @@ -1,3 +1,9 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + /* This list was generated by /u/norikoyasuo/bin/getSolPatches.pl */ /* on droid.mcom.com */ /* at Thu Mar 18 18:34:27 2004 GMT */
0
7f07b4f138f52e9d523f69d80ef4ecfeb98301cd
389ds/389-ds-base
Resolves: bug 231507 Bug Description: Modification of directory entries with VLV-indexed null-value attributes results in server crash Reviewed by: nkinder, nhosoi, prowley (Thanks!) Fix Description: The value lowest_value is defined outside the loop that loops through all the attributes in the vlv sort specification (e.g. usually something like cn givenname o ou sn if defined by the console browsing index). lowest_value is not reset for each loop iteration. So if it goes through the loop one time for e.g. givenname, and givenname has values, lowest_value will point to the lowest value of givenname until the key is created, then it is freed. So the next loop iteration uses o, and if for example o does not have any values, lowest_value will point to the already freed memory used by the givenname iteration, which is now garbage (e.g. the lowest_value->bv_len may be very large, which is the probably cause of the malloc out of memory errors seen by the customer). The solution is to reset lowest_value to NULL before each loop iteration (I did this by moving the declaration and initialization of lowest_value inside the loop scope) and testing for lowest_value == NULL before trying to use it. Platforms tested: RHEL4 Flag Day: no Doc impact: no
commit 7f07b4f138f52e9d523f69d80ef4ecfeb98301cd Author: Rich Megginson <[email protected]> Date: Wed Mar 14 16:36:13 2007 +0000 Resolves: bug 231507 Bug Description: Modification of directory entries with VLV-indexed null-value attributes results in server crash Reviewed by: nkinder, nhosoi, prowley (Thanks!) Fix Description: The value lowest_value is defined outside the loop that loops through all the attributes in the vlv sort specification (e.g. usually something like cn givenname o ou sn if defined by the console browsing index). lowest_value is not reset for each loop iteration. So if it goes through the loop one time for e.g. givenname, and givenname has values, lowest_value will point to the lowest value of givenname until the key is created, then it is freed. So the next loop iteration uses o, and if for example o does not have any values, lowest_value will point to the already freed memory used by the givenname iteration, which is now garbage (e.g. the lowest_value->bv_len may be very large, which is the probably cause of the malloc out of memory errors seen by the customer). The solution is to reset lowest_value to NULL before each loop iteration (I did this by moving the declaration and initialization of lowest_value inside the loop scope) and testing for lowest_value == NULL before trying to use it. Platforms tested: RHEL4 Flag Day: no Doc impact: no diff --git a/ldap/servers/slapd/back-ldbm/vlv.c b/ldap/servers/slapd/back-ldbm/vlv.c index ac08b2af8..0e13d7e77 100644 --- a/ldap/servers/slapd/back-ldbm/vlv.c +++ b/ldap/servers/slapd/back-ldbm/vlv.c @@ -508,7 +508,7 @@ vlv_getindices(IFP callback_fn,void *param, backend *be) static struct vlv_key * vlv_create_key(struct vlvIndex* p, struct backentry* e) { - struct berval val, *lowest_value = NULL; + struct berval val; unsigned char char_min = 0x00; unsigned char char_max = 0xFF; struct vlv_key *key= vlv_key_new(); @@ -530,7 +530,7 @@ vlv_create_key(struct vlvIndex* p, struct backentry* e) /* xxxPINAKI */ /* need to free some stuff! */ Slapi_Value **cvalue = NULL; - struct berval **value = NULL; + struct berval **value = NULL, *lowest_value = NULL; int free_value= 0; if (attr != NULL && !valueset_isempty(&attr->a_present_values)) { @@ -587,7 +587,7 @@ vlv_create_key(struct vlvIndex* p, struct backentry* e) unsigned int i; char *attributeValue = NULL; /* Bug 605477 : Don't malloc 0 bytes */ - if (attr != NULL && lowest_value->bv_len != 0) { + if (attr != NULL && lowest_value && lowest_value->bv_len != 0) { attributeValue = (char*)slapi_ch_malloc(lowest_value->bv_len); for(i=0;i<lowest_value->bv_len;i++) { @@ -615,7 +615,7 @@ vlv_create_key(struct vlvIndex* p, struct backentry* e) /* If the forward-sorted attribute is absent or has no * value, we need to use the value of 0xFF. */ - if (attr != NULL && lowest_value->bv_len > 0) { + if (attr != NULL && lowest_value && lowest_value->bv_len > 0) { vlv_key_addattr(key,lowest_value); } else { val.bv_val = (void*)&char_max;
0
56939cc3017d9527a30d4816ed75c654b096c371
389ds/389-ds-base
Issue 4758 - Add tests for WebUI Description: Added WebUI visibility tests for Plugins tab, LDAP Browser tab. Relates: https://github.com/389ds/389-ds-base/issues/4758 Reviewed by: @bsimonova @droideck (Thanks!)
commit 56939cc3017d9527a30d4816ed75c654b096c371 Author: Vladimir Cech <[email protected]> Date: Wed Apr 5 12:54:33 2023 +0200 Issue 4758 - Add tests for WebUI Description: Added WebUI visibility tests for Plugins tab, LDAP Browser tab. Relates: https://github.com/389ds/389-ds-base/issues/4758 Reviewed by: @bsimonova @droideck (Thanks!) diff --git a/dirsrvtests/tests/suites/webui/ldap_browser/__init__.py b/dirsrvtests/tests/suites/webui/ldap_browser/__init__.py new file mode 100644 index 000000000..79c6bee8c --- /dev/null +++ b/dirsrvtests/tests/suites/webui/ldap_browser/__init__.py @@ -0,0 +1,3 @@ +""" + :Requirement: WebUI: LDAP Browser +""" diff --git a/dirsrvtests/tests/suites/webui/ldap_browser/ldap_browser_test.py b/dirsrvtests/tests/suites/webui/ldap_browser/ldap_browser_test.py new file mode 100644 index 000000000..93c43a2ca --- /dev/null +++ b/dirsrvtests/tests/suites/webui/ldap_browser/ldap_browser_test.py @@ -0,0 +1,77 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2023 Red Hat, Inc. +# All rights reserved. +# +# License: GPL (version 3 or any later version). +# See LICENSE for details. +# --- END COPYRIGHT BLOCK --- +# +import time +import subprocess +import pytest + +from lib389.cli_idm.account import * +from lib389.tasks import * +from lib389.utils import * +from lib389.topologies import topology_st +from .. import setup_page, check_frame_assignment, setup_login + +pytestmark = pytest.mark.skipif(os.getenv('WEBUI') is None, reason="These tests are only for WebUI environment") +pytest.importorskip('playwright') + +SERVER_ID = 'standalone1' + + +def test_ldap_browser_tab_visibility(topology_st, page, browser_name): + """ Test LDAP Browser tab visibility + + :id: cb5f04dc-99ff-4ef6-928c-5f41272c51af + :setup: Standalone instance + :steps: + 1. Click on LDAP Browser tab. + 2. Check if Tree View tab is visible. + 3. Click on dc=example,dc=com button. + 4. Check if Attribute columnheader is visible. + 5. Click on Table View tab. + 6. Check if Database Suffixes columnheader is visible. + 7. Click on Search tab and click on Show Search Criteria button. + 8. Check if Search Base text input field is visible. + :expectedresults: + 1. Success + 2. Element is visible + 3. Success + 4. Element is visible + 5. Success + 6. Element is visible + 7. Success + 8. Element is visible + """ + setup_login(page) + time.sleep(1) + frame = check_frame_assignment(page, browser_name) + + log.info('Click on LDAP Browser tab and check if element is loaded.') + frame.get_by_role('tab', name='LDAP Browser', exact=True).click() + frame.get_by_role('tab', name='Tree View').wait_for() + assert frame.get_by_role('tab', name='Tree View').is_visible() + + log.info('Click on dc=example,dc=com button and check if element is loaded.') + frame.get_by_role('button').filter(has_text='dc=example,dc=com').click() + frame.get_by_role('columnheader', name='Attribute').wait_for() + assert frame.get_by_role('columnheader', name='Attribute').is_visible() + + log.info('Click on Table View tab and check if element is loaded') + frame.get_by_role('tab', name='Table View').click() + assert frame.get_by_role('columnheader', name='Database Suffixes').is_visible() + + log.info('Click on Search tab and check if element is loaded') + frame.get_by_role('tab', name='Search').click() + frame.get_by_text('Show Search Criteria').click() + assert frame.locator('#searchBase').is_visible() + + +if __name__ == '__main__': + # Run isolated + # -s for DEBUG mode + CURRENT_FILE = os.path.realpath(__file__) + pytest.main("-s %s" % CURRENT_FILE) diff --git a/dirsrvtests/tests/suites/webui/plugins/__init__.py b/dirsrvtests/tests/suites/webui/plugins/__init__.py new file mode 100644 index 000000000..fc5adcec1 --- /dev/null +++ b/dirsrvtests/tests/suites/webui/plugins/__init__.py @@ -0,0 +1,3 @@ +""" + :Requirement: WebUI: Plugins +""" diff --git a/dirsrvtests/tests/suites/webui/plugins/plugins_test.py b/dirsrvtests/tests/suites/webui/plugins/plugins_test.py new file mode 100644 index 000000000..849dedcf2 --- /dev/null +++ b/dirsrvtests/tests/suites/webui/plugins/plugins_test.py @@ -0,0 +1,423 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2023 Red Hat, Inc. +# All rights reserved. +# +# License: GPL (version 3 or any later version). +# See LICENSE for details. +# --- END COPYRIGHT BLOCK --- +# +import time +import subprocess +import pytest + +from lib389.cli_idm.account import * +from lib389.tasks import * +from lib389.utils import * +from lib389.topologies import topology_st +from .. import setup_page, check_frame_assignment, setup_login + +pytestmark = pytest.mark.skipif(os.getenv('WEBUI') is None, reason="These tests are only for WebUI environment") +pytest.importorskip('playwright') + +SERVER_ID = 'standalone1' + + +def test_plugins_tab_visibility(topology_st, page, browser_name): + """ Test visibility of Plugins tab. + + :id: 5b80bd5d-9294-4521-af0e-cd37ce9264a6 + :setup: Standalone instance + :steps: + 1. Click on Plugins tab. + 2. Check if search input is visible + :expectedresults: + 1. Success + 2. Element is visible + """ + setup_login(page) + time.sleep(1) + frame = check_frame_assignment(page, browser_name) + + log.info('Check if Plugins tab is loaded.') + frame.get_by_role('tab', name='Plugins', exact=True).click() + frame.get_by_placeholder('Search Plugins').wait_for() + assert frame.get_by_placeholder('Search Plugins').is_visible() + + +def test_account_policy_plugin_visibility(topology_st, page, browser_name): + """ Test Account Policy Plugin visibility. + + :id: 6e8a27cb-32a2-46f1-918e-4c3f91c8f34e + :setup: Standalone instance + :steps: + 1. Click on Plugins tab. + 2. Click on Account Policy button on the side panel. + 3. Check if Shared Config Entry text input field is visible. + :expectedresults: + 1. Success + 2. Success + 3. Element is visible + """ + setup_login(page) + time.sleep(1) + frame = check_frame_assignment(page, browser_name) + + log.info('Click on Plugins tab, click on Account Policy plugin and check if element is loaded.') + frame.get_by_role('tab', name='Plugins', exact=True).click() + frame.get_by_text('Plugin is disabledAccount Policy', exact=True).wait_for() + frame.get_by_text('Plugin is disabledAccount Policy', exact=True).click() + frame.locator('#configArea').wait_for() + assert frame.locator('#configArea').is_visible() + + +def test_attribute_uniqueness_plugin_visibility(topology_st, page, browser_name): + """ Test Attribute Uniqueness plugin visibility. + + :id: f6e49e13-7820-40fa-b2ae-d5e48dd03d2c + :setup: Standalone instance + :steps: + 1. Click on Plugins tab. + 2. Click on Attribute Uniqueness button on the side panel. + 3. Check if Add Config button is visible. + :expectedresults: + 1. Success + 2. Success + 3. Element is visible + """ + setup_login(page) + time.sleep(1) + frame = check_frame_assignment(page, browser_name) + + log.info('Click on Plugins tab, click on Attribute Uniqueness plugin and check if element is loaded.') + frame.get_by_role('tab', name='Plugins', exact=True).click() + frame.get_by_text('Plugin is disabledAttribute Uniqueness', exact=True).wait_for() + frame.get_by_text('Plugin is disabledAttribute Uniqueness', exact=True).click() + frame.get_by_role('button', name='Add Config').wait_for() + assert frame.get_by_role('button', name='Add Config').is_visible() + + +def test_auto_membership_plugin_visibility(topology_st, page, browser_name): + """ Test Auto Membership plugin visibility + + :id: 5c05617a-8a23-46cb-83ce-3bdd30388e0b + :setup: Standalone instance + :steps: + 1. Click on Plugins tab. + 2. Click on Auto Membership button on the side panel. + 3. Check if Add Definition button is visible. + :expectedresults: + 1. Success + 2. Success + 3. Element is visible + """ + setup_login(page) + time.sleep(1) + frame = check_frame_assignment(page, browser_name) + + log.info('Click on Plugins tab, click on Auto Membership plugin and check if element is loaded.') + frame.get_by_role('tab', name='Plugins', exact=True).click() + frame.get_by_text('Plugin is enabledAuto Membership').wait_for() + frame.get_by_text('Plugin is enabledAuto Membership').click() + frame.get_by_role('button', name='Add Definition').wait_for() + assert frame.get_by_role('button', name='Add Definition').is_visible() + + +def test_dna_plugin_visibility(topology_st, page, browser_name): + """ Test DNA plugin visibility. + + :id: b246682b-c41d-4ae9-9c64-38bd8e665a71 + :setup: Standalone instance + :steps: + 1. Click on Plugins tab. + 2. Click on DNA button on the side panel. + 3. Check if Add Config button is visible. + :expectedresults: + 1. Success + 2. Success + 3. Element is visible + """ + setup_login(page) + time.sleep(1) + frame = check_frame_assignment(page, browser_name) + + log.info('Click on Plugins tab, click on DNA plugin and check if element is loaded.') + frame.get_by_role('tab', name='Plugins', exact=True).click() + frame.get_by_text('Plugin is disabledDNA').wait_for() + frame.get_by_text('Plugin is disabledDNA').click() + frame.get_by_role('button', name='Add Config').wait_for() + assert frame.get_by_role('button', name='Add Config').is_visible() + + +def test_linked_attributes_plugin_visibility(topology_st, page, browser_name): + """ Test Linked Attributes plugin visibility + + :id: 21cb6021-dc6f-4f26-a6a3-f4311c9afe2e + :setup: Standalone instance + :steps: + 1. Click on Plugins tab. + 2. Click on Linked Attributes button on the side panel. + 3. Check if Add Config button is visible. + :expectedresults: + 1. Success + 2. Success + 3. Element is visible + """ + setup_login(page) + time.sleep(1) + frame = check_frame_assignment(page, browser_name) + + log.info('Click on Plugins tab, click on Linked Attributes plugin and check if element is loaded.') + frame.get_by_role('tab', name='Plugins', exact=True).click() + frame.get_by_text('Linked Attributes').wait_for() + frame.get_by_text('Linked Attributes').click() + frame.get_by_role('button', name='Add Config').wait_for() + assert frame.get_by_role('button', name='Add Config').is_visible() + + +def test_managed_entries_plugin_visibility(topology_st, page, browser_name): + """ Test Managed Entries plugin visibility + + :id: fd2dcaf9-422b-4d17-85f2-bc12427adc1c + :setup: Standalone instance + :steps: + 1. Click on Plugins tab. + 2. Click on Managed Entries button on the side panel. + 3. Check if Create Template button is visible. + 4. Click on Definitions tab. + 5. Check if Add Definition button is visible. + :expectedresults: + 1. Success + 2. Success + 3. Element is visible + 4. Success + 5. Element is visible + """ + setup_login(page) + time.sleep(1) + frame = check_frame_assignment(page, browser_name) + + log.info('Click on Plugins tab, click on Managed Entries plugin and check if element is loaded.') + frame.get_by_role('tab', name='Plugins', exact=True).click() + frame.get_by_text('Plugin is enabledManaged Entries').wait_for() + frame.get_by_text('Plugin is enabledManaged Entries').click() + frame.get_by_role('button', name='Create Template').wait_for() + assert frame.get_by_role('button', name='Create Template').is_visible() + + log.info('Click on Definitions tab and check if element is loaded.') + frame.get_by_role('tab', name='Definitions').click() + assert frame.get_by_role('button', name='Add Definition').is_visible() + + +def test_memberof_plugin_visibility(topology_st, page, browser_name): + """ Test MemberOf plugin visibility + + :id: 865db69f-6e6b-4beb-b456-8e055fc0b14b + :setup: Standalone instance + :steps: + 1. Click on Plugins tab. + 2. Click on MemberOf button on the side panel. + 3. Check if Shared Config Entry text input field is visible. + :expectedresults: + 1. Success + 2. Success + 3. Element is visible + """ + setup_login(page) + time.sleep(1) + frame = check_frame_assignment(page, browser_name) + + log.info('Click on Plugins tab, click on MemberOf plugin and check if element is loaded.') + frame.get_by_role('tab', name='Plugins', exact=True).click() + frame.get_by_text('Plugin is disabledMemberOf').wait_for() + frame.get_by_text('Plugin is disabledMemberOf').click() + frame.locator('#memberOfConfigEntry').wait_for() + assert frame.locator('#memberOfConfigEntry').is_visible() + + +def test_ldap_pass_through_auth_plugin_visibility(topology_st, page, browser_name): + """ test LDAP Pass Through Auth plugin visibility + + :id: a47c4054-233f-4398-aaf6-eddfb442e53d + :setup: Standalone instance + :steps: + 1. Click on Plugins tab. + 2. Click on LDAP Pass Through Auth button on the side panel. + 3. Check if Add URL button is visible. + :expectedresults: + 1. Success + 2. Success + 3. Element is visible + """ + setup_login(page) + time.sleep(1) + frame = check_frame_assignment(page, browser_name) + + log.info('Click on Plugins tab, click on LDAP Pass Through Auth plugin and check if element is loaded.') + frame.get_by_role('tab', name='Plugins', exact=True).click() + frame.get_by_text('LDAP Pass Through Auth').wait_for() + frame.get_by_text('LDAP Pass Through Auth').click() + frame.get_by_role('button', name='Add URL').wait_for() + assert frame.get_by_role('button', name='Add URL').is_visible() + + +def test_pam_pass_through_auth_plugin_visibility(topology_st, page, browser_name): + """ Test PAM Pass Through Auth visibility. + + :id: 99c72177-6c86-4b24-b754-38f9698bd70c + :setup: Standalone instance + :steps: + 1. Click on Plugins tab. + 2. Click on PAM Pass Through Auth button on the side panel. + 3. Check if Add Config button is visible. + :expectedresults: + 1. Success + 2. Success + 3. Element is visible + """ + setup_login(page) + time.sleep(1) + frame = check_frame_assignment(page, browser_name) + + log.info('Click on Plugins tab, click on PAM Pass Through Auth plugin and check if element is loaded.') + frame.get_by_role('tab', name='Plugins', exact=True).click() + frame.get_by_text('PAM Pass Through Auth').wait_for() + frame.get_by_text('PAM Pass Through Auth').click() + frame.get_by_role('button', name='Add Config').wait_for() + assert frame.get_by_role('button', name='Add Config').is_visible() + + +def test_posix_winsync_plugin_visibility(topology_st, page, browser_name): + """ Test Posix Winsync plugin visibility. + + :id: 9998d23c-d550-4605-bcbe-d501f26d8a66 + :setup: Standalone instance + :steps: + 1. Click on Plugins tab. + 2. Click on Posix Winsync button on the side panel. + 3. Check if Create MemberOf Task checkbox is visible. + :expectedresults: + 1. Success + 2. Success + 3. Element is visible + """ + setup_login(page) + time.sleep(1) + frame = check_frame_assignment(page, browser_name) + + log.info('Click on Plugins tab, click on Posix Winsync plugin and check if element is loaded.') + frame.get_by_role('tab', name='Plugins', exact=True).click() + frame.get_by_text('Posix Winsync').wait_for() + frame.get_by_text('Posix Winsync').click() + frame.locator('#posixWinsyncCreateMemberOfTask').wait_for() + assert frame.locator('#posixWinsyncCreateMemberOfTask').is_visible() + + +def test_referential_integrity_plugin_visibility(topology_st, page, browser_name): + """ Test Referential Integrity plugin visibility. + + :id: e868f520-a409-4ec8-b086-c86cf1f8855b + :setup: Standalone instance + :steps: + 1. Click on Plugins tab. + 2. Click on Referential Integrity button on the side panel. + 3. Check if Entry Scope text input field is visible. + :expectedresults: + 1. Success + 2. Success + 3. Element is visible + """ + setup_login(page) + time.sleep(1) + frame = check_frame_assignment(page, browser_name) + + log.info('Click on Plugins tab, click on Referential Integrity plugin and check if element is loaded.') + frame.get_by_role('tab', name='Plugins', exact=True).click() + frame.get_by_text('Referential Integrity').wait_for() + frame.get_by_text('Referential Integrity').click() + frame.locator('#entryScope').wait_for() + assert frame.locator('#entryScope').is_visible() + + +def test_retro_changelog_plugin_visibility(topology_st, page, browser_name): + """ Test Retro Changelog plugin visibility. + + :id: b1813138-25d9-4b73-ab99-1e27d51d0c53 + :setup: Standalone instance + :steps: + 1. Click on Plugins tab. + 2. Click on Retro Changelog button on the side panel. + 3. Check if Is Replicated checkbox is visible. + :expectedresults: + 1. Success + 2. Success + 3. Element is visible + """ + setup_login(page) + time.sleep(1) + frame = check_frame_assignment(page, browser_name) + + log.info('Click on Plugins tab, click on Retro Changelog plugin and check if element is loaded.') + frame.get_by_role('tab', name='Plugins', exact=True).click() + frame.get_by_text('Retro Changelog').wait_for() + frame.get_by_text('Retro Changelog').click() + frame.locator('#isReplicated').wait_for() + assert frame.locator('#isReplicated').is_visible() + + +def test_rootdn_access_control_plugin_visibility(topology_st, page, browser_name): + """ Test RootDN Access Control plugin visibility + + :id: 3d57131f-a23e-4030-b51b-1dd3ebac95c9 + :setup: Standalone instance + :steps: + 1. Click on Plugins tab. + 2. Click on RootDN Access Control button on the side panel. + 3. Check if Monday checkbox is visible. + :expectedresults: + 1. Success + 2. Success + 3. Element is visible + """ + setup_login(page) + time.sleep(1) + frame = check_frame_assignment(page, browser_name) + + log.info('Click on Plugins tab, click on RootDN Access Control plugin and check if element is loaded.') + frame.get_by_role('tab', name='Plugins', exact=True).click() + frame.get_by_text('RootDN Access Control').wait_for() + frame.get_by_text('RootDN Access Control').click() + frame.locator('#allowMon').wait_for() + assert frame.locator('#allowMon').is_visible() + + +def test_usn_plugin_visibility(topology_st, page, browser_name): + """ Test USN plugin visibility + + :id: e1a60298-694e-4d04-ace9-164290a3786b + :setup: Standalone instance + :steps: + 1. Click on Plugins tab. + 2. Click on USN button on the side panel. + 3. Check if USN Global label is visible. + :expectedresults: + 1. Success + 2. Success + 3. Element is visible + """ + setup_login(page) + time.sleep(1) + frame = check_frame_assignment(page, browser_name) + + log.info('Click on Plugins tab, click on USN Access Control plugin and check if element is loaded.') + frame.get_by_role('tab', name='Plugins', exact=True).click() + frame.get_by_text('Plugin is disabledUSN').wait_for() + frame.get_by_text('Plugin is disabledUSN').click() + frame.get_by_text('USN Global').wait_for() + assert frame.get_by_text('USN Global').is_visible() + + +if __name__ == '__main__': + # Run isolated + # -s for DEBUG mode + CURRENT_FILE = os.path.realpath(__file__) + pytest.main("-s %s" % CURRENT_FILE)
0
10966f3cfe9a60ac385ca76bc331fa292da7b888
389ds/389-ds-base
bump version to 1.2.6.rc3
commit 10966f3cfe9a60ac385ca76bc331fa292da7b888 Author: Rich Megginson <[email protected]> Date: Wed Jun 16 10:22:10 2010 -0600 bump version to 1.2.6.rc3 diff --git a/VERSION.sh b/VERSION.sh index dc8c1ac1f..fd343ad53 100644 --- a/VERSION.sh +++ b/VERSION.sh @@ -14,7 +14,7 @@ VERSION_MAINT=6 # if this is a PRERELEASE, set VERSION_PREREL # otherwise, comment it out # be sure to include the dot prefix in the prerel -VERSION_PREREL=.rc2 +VERSION_PREREL=.rc3 # NOTES on VERSION_PREREL # use aN for an alpha release e.g. a1, a2, etc. # use rcN for a release candidate e.g. rc1, rc2, etc.
0
d9d13811cfe7fbb71f54dbc7eada95a027001db1
389ds/389-ds-base
Resolves: bug 458668 Bug Description: Memory leaks in ids_sasl_user_search Reviewed by: nkinder (Thanks!) Branch: HEAD Fix Description: This leak occurs when we use the new regex based identity mapping to lookup the user bind dn based on the given user and user realm. There is a pblock allocated but not freed. Platforms tested: RHEL5, Fedora 8 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
commit d9d13811cfe7fbb71f54dbc7eada95a027001db1 Author: Rich Megginson <[email protected]> Date: Wed Aug 27 21:05:35 2008 +0000 Resolves: bug 458668 Bug Description: Memory leaks in ids_sasl_user_search Reviewed by: nkinder (Thanks!) Branch: HEAD Fix Description: This leak occurs when we use the new regex based identity mapping to lookup the user bind dn based on the given user and user realm. There is a pblock allocated but not freed. Platforms tested: RHEL5, Fedora 8 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none diff --git a/ldap/servers/slapd/saslbind.c b/ldap/servers/slapd/saslbind.c index cd0ef62eb..a5a0692d4 100644 --- a/ldap/servers/slapd/saslbind.c +++ b/ldap/servers/slapd/saslbind.c @@ -275,7 +275,11 @@ static void ids_sasl_user_search( out: - if (pb) slapi_free_search_results_internal(pb); + if (pb) { + slapi_free_search_results_internal(pb); + slapi_pblock_destroy(pb); + pb = NULL; + } return; }
0
f33e73fe45225c0c7413d74dc846cead3214a404
389ds/389-ds-base
Ticket 495 - internalModifiersname not updated by DNA plugin Bug Description: If you are using the "nsslapd-plugin-binddn-tracking", and the DNA plugin modifiers the entry, the internalmodifiersname is not updated. Fix Description: This is because the DNA plugin directly modifies the entry, and does not use the internal modify functions that would trigger the last mod attributes to be updated. So we have to call the last mod update function directly from the dna plugin. There is also a slight change to the behavior now. The internalModifiersname & internalCreatorsname will never be the bind dn, but instead it will be the plugin that actually did the update. So if a entry was not touched by a DS plugin, then the "database" plugin would be the internal modifier/creator: cn=ldbm database,cn=plugins,cn=config This would also allow us to detect if someone replaced the default backend. https://fedorahosted.org/389/ticket/495 Reviewed by: nhosoi & richm(Thanks!)
commit f33e73fe45225c0c7413d74dc846cead3214a404 Author: Mark Reynolds <[email protected]> Date: Fri Oct 19 15:55:54 2012 -0400 Ticket 495 - internalModifiersname not updated by DNA plugin Bug Description: If you are using the "nsslapd-plugin-binddn-tracking", and the DNA plugin modifiers the entry, the internalmodifiersname is not updated. Fix Description: This is because the DNA plugin directly modifies the entry, and does not use the internal modify functions that would trigger the last mod attributes to be updated. So we have to call the last mod update function directly from the dna plugin. There is also a slight change to the behavior now. The internalModifiersname & internalCreatorsname will never be the bind dn, but instead it will be the plugin that actually did the update. So if a entry was not touched by a DS plugin, then the "database" plugin would be the internal modifier/creator: cn=ldbm database,cn=plugins,cn=config This would also allow us to detect if someone replaced the default backend. https://fedorahosted.org/389/ticket/495 Reviewed by: nhosoi & richm(Thanks!) diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c index 34d67abe9..2b5696795 100644 --- a/ldap/servers/plugins/dna/dna.c +++ b/ldap/servers/plugins/dna/dna.c @@ -2853,6 +2853,8 @@ _dna_pre_op_add(Slapi_PBlock *pb, Slapi_Entry *e) /* no need to dup */ DNA_NEEDS_UPDATE); } + /* Update the internalModifiersname for this add op */ + add_internal_modifiersname(pb, e); /* Make sure we don't generate for this * type again by keeping a list of types @@ -3106,6 +3108,8 @@ _dna_pre_op_modify(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Mods *smods) /* no need to dup */ DNA_NEEDS_UPDATE); } + /* Update the internalModifersname for this mod op */ + modify_update_last_modified_attr(pb, smods); /* Make sure we don't generate for this * type again by keeping a list of types diff --git a/ldap/servers/slapd/add.c b/ldap/servers/slapd/add.c index d1d23b3a8..2a70f648c 100644 --- a/ldap/servers/slapd/add.c +++ b/ldap/servers/slapd/add.c @@ -73,7 +73,7 @@ /* Forward declarations */ static int add_internal_pb (Slapi_PBlock *pb); static void op_shared_add (Slapi_PBlock *pb); -static int add_created_attrs(Operation *op, Slapi_Entry *e); +static int add_created_attrs(Slapi_PBlock *pb, Slapi_Entry *e); static int check_rdn_for_created_attrs(Slapi_Entry *e); static void handle_fast_add(Slapi_PBlock *pb, Slapi_Entry *entry); static int add_uniqueid (Slapi_Entry *e); @@ -684,7 +684,7 @@ static void op_shared_add (Slapi_PBlock *pb) /* can get lastmod only after backend is selected */ slapi_pblock_get(pb, SLAPI_BE_LASTMOD, &lastmod); - if (lastmod && add_created_attrs(operation, e) != 0) + if (lastmod && add_created_attrs(pb, e) != 0) { send_ldap_result(pb, LDAP_UNWILLING_TO_PERFORM, NULL, "cannot insert computed attributes", 0, NULL); @@ -797,32 +797,51 @@ done: } static int -add_created_attrs(Operation *op, Slapi_Entry *e) +add_created_attrs(Slapi_PBlock *pb, Slapi_Entry *e) { char buf[20]; char *binddn = NULL; + char *plugin_dn = NULL; struct berval bv; struct berval *bvals[2]; time_t curtime; struct tm ltm; + Operation *op; + struct slapdplugin *plugin = NULL; + struct slapi_componentid *cid = NULL; slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); LDAPDebug(LDAP_DEBUG_TRACE, "add_created_attrs\n", 0, 0, 0); bvals[0] = &bv; bvals[1] = NULL; + slapi_pblock_get(pb, SLAPI_OPERATION, &op); if(slapdFrontendConfig->plugin_track){ /* plugin bindDN tracking is enabled, grab the dn from thread local storage */ if(slapi_sdn_isempty(&op->o_sdn)){ bv.bv_val = ""; - bv.bv_len = strlen(bv.bv_val); + bv.bv_len = 0; } else { - bv.bv_val = (char*)slapi_sdn_get_dn(&op->o_sdn); - bv.bv_len = strlen(bv.bv_val); + slapi_pblock_get (pb, SLAPI_PLUGIN_IDENTITY, &cid); + if (cid){ + plugin=(struct slapdplugin *) cid->sci_plugin; + } else { + slapi_pblock_get (pb, SLAPI_PLUGIN, &plugin); + } + if(plugin) + plugin_dn = plugin_get_dn (plugin); + if(plugin_dn){ + bv.bv_val = plugin_dn; + bv.bv_len = strlen(bv.bv_val); + } else { + bv.bv_val = (char*)slapi_sdn_get_dn(&op->o_sdn); + bv.bv_len = strlen(bv.bv_val); + } } slapi_entry_attr_replace(e, "internalCreatorsName", bvals); slapi_entry_attr_replace(e, "internalModifiersName", bvals); + slapi_ch_free_string(&plugin_dn); /* Grab the thread data(binddn) */ slapi_td_get_dn(&binddn); @@ -830,7 +849,7 @@ add_created_attrs(Operation *op, Slapi_Entry *e) if(binddn == NULL){ /* anonymous bind */ bv.bv_val = ""; - bv.bv_len = strlen(bv.bv_val); + bv.bv_len = 0; } else { bv.bv_val = binddn; bv.bv_len = strlen(bv.bv_val); @@ -838,7 +857,7 @@ add_created_attrs(Operation *op, Slapi_Entry *e) } else { if (slapi_sdn_isempty(&op->o_sdn)) { bv.bv_val = ""; - bv.bv_len = strlen(bv.bv_val); + bv.bv_len = 0; } else { bv.bv_val = (char*)slapi_sdn_get_dn(&op->o_sdn); bv.bv_len = strlen(bv.bv_val); @@ -1023,3 +1042,31 @@ check_oc_subentry(Slapi_Entry *e, struct berval **vals, char *normtype) { } return subentry; } + +/* + * Used by plugins that modify entries on add operations, otherwise the internalModifiersname + * would not be set the the correct plugin name. + */ +void +add_internal_modifiersname(Slapi_PBlock *pb, Slapi_Entry *e) +{ + slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); + struct slapi_componentid *cid = NULL; + struct slapdplugin *plugin = NULL; + char *plugin_dn = NULL; + + if(slapdFrontendConfig->plugin_track){ + slapi_pblock_get (pb, SLAPI_PLUGIN_IDENTITY, &cid); + if (cid){ + plugin=(struct slapdplugin *) cid->sci_plugin; + } else { + slapi_pblock_get (pb, SLAPI_PLUGIN, &plugin); + } + if(plugin) + plugin_dn = plugin_get_dn (plugin); + if(plugin_dn){ + slapi_entry_attr_set_charptr(e, "internalModifiersname", plugin_dn); + slapi_ch_free_string(&plugin_dn); + } + } +} diff --git a/ldap/servers/slapd/configdse.c b/ldap/servers/slapd/configdse.c index 51f916594..b54062d5b 100644 --- a/ldap/servers/slapd/configdse.c +++ b/ldap/servers/slapd/configdse.c @@ -117,6 +117,7 @@ ignore_attr_type(const char *attr_type) (strcasecmp (attr_type, "objectclass") == 0) || (strcasecmp (attr_type, "numsubordinates") == 0) || (strcasecmp (attr_type, "internalModifiersname") == 0) || + (strcasecmp (attr_type, "internalCreatorsname") == 0) || (strcasecmp (attr_type, "modifytimestamp") == 0) || (strcasecmp (attr_type, "modifiersname") == 0)) { return 1; diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c index 019fe20b0..afd81accd 100644 --- a/ldap/servers/slapd/opshared.c +++ b/ldap/servers/slapd/opshared.c @@ -135,7 +135,8 @@ do_ps_service(Slapi_Entry *e, Slapi_Entry *eprev, ber_int_t chgtype, ber_int_t c (ps_service_fn)(e, eprev, chgtype, chgnum); } -void modify_update_last_modified_attr(Slapi_PBlock *pb, Slapi_Mods *smods) +void +modify_update_last_modified_attr(Slapi_PBlock *pb, Slapi_Mods *smods) { char buf[20]; char *plugin_dn = NULL; @@ -159,11 +160,14 @@ void modify_update_last_modified_attr(Slapi_PBlock *pb, Slapi_Mods *smods) /* plugin bindDN tracking is enabled, grab the bind dn from thread local storage */ if(slapi_sdn_isempty(&op->o_sdn)){ bv.bv_val = ""; - bv.bv_len = strlen(bv.bv_val); + bv.bv_len = 0; } else { slapi_pblock_get (pb, SLAPI_PLUGIN_IDENTITY, &cid); - if (cid) + if (cid){ plugin=(struct slapdplugin *) cid->sci_plugin; + } else { + slapi_pblock_get (pb, SLAPI_PLUGIN, &plugin); + } if(plugin) plugin_dn = plugin_get_dn (plugin); if(plugin_dn){ @@ -176,6 +180,7 @@ void modify_update_last_modified_attr(Slapi_PBlock *pb, Slapi_Mods *smods) } slapi_mods_add_modbvps(smods, LDAP_MOD_REPLACE | LDAP_MOD_BVALUES, "internalModifiersName", bvals); + slapi_ch_free_string(&plugin_dn); /* Grab the thread data(binddn) */ slapi_td_get_dn(&binddn); @@ -183,7 +188,7 @@ void modify_update_last_modified_attr(Slapi_PBlock *pb, Slapi_Mods *smods) if(binddn == NULL){ /* anonymous bind */ bv.bv_val = ""; - bv.bv_len = strlen(bv.bv_val); + bv.bv_len = 0; } else { bv.bv_val = binddn; bv.bv_len = strlen(bv.bv_val); @@ -192,7 +197,7 @@ void modify_update_last_modified_attr(Slapi_PBlock *pb, Slapi_Mods *smods) /* fill in modifiersname */ if (slapi_sdn_isempty(&op->o_sdn)) { bv.bv_val = ""; - bv.bv_len = strlen(bv.bv_val); + bv.bv_len = 0; } else { bv.bv_val = (char*)slapi_sdn_get_dn(&op->o_sdn); bv.bv_len = strlen(bv.bv_val); diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h index 905b0f45c..19c06a272 100644 --- a/ldap/servers/slapd/proto-slap.h +++ b/ldap/servers/slapd/proto-slap.h @@ -1290,7 +1290,6 @@ void set_config_params (Slapi_PBlock *pb); /* set parameters common for all internal operations */ void set_common_params (Slapi_PBlock *pb); void do_ps_service(Slapi_Entry *e, Slapi_Entry *eprev, ber_int_t chgtype, ber_int_t chgnum); -void modify_update_last_modified_attr(Slapi_PBlock *pb, Slapi_Mods *smods); /* * debugdump.cpp diff --git a/ldap/servers/slapd/slapi-private.h b/ldap/servers/slapd/slapi-private.h index 6c2781c29..3ee175598 100644 --- a/ldap/servers/slapd/slapi-private.h +++ b/ldap/servers/slapd/slapi-private.h @@ -1252,6 +1252,12 @@ int slapi_add_internal_attr_syntax( const char *name, const char *oid, const cha void pw_exp_init ( void ); int pw_copy_entry_ext(Slapi_Entry *src_e, Slapi_Entry *dest_e); +/* op_shared.c */ +void modify_update_last_modified_attr(Slapi_PBlock *pb, Slapi_Mods *smods); + +/* add.c */ +void add_internal_modifiersname(Slapi_PBlock *pb, Slapi_Entry *e); + #ifdef __cplusplus } #endif
0
5ce7f69f5866e79b68080d329f9b8bd2d7efa3e7
389ds/389-ds-base
Issue 49162 - Only check event.m4 if nunc-stans is enabled Description: We only want to process event.m4 if nunc-stans is enabled, otherwise it breaks builds on platforms that do not support nunc-stans https://pagure.io/389-ds-base/issue/49162 Reviewed by: nhosoi(Thanks!)
commit 5ce7f69f5866e79b68080d329f9b8bd2d7efa3e7 Author: Mark Reynolds <[email protected]> Date: Thu Mar 9 10:03:40 2017 -0500 Issue 49162 - Only check event.m4 if nunc-stans is enabled Description: We only want to process event.m4 if nunc-stans is enabled, otherwise it breaks builds on platforms that do not support nunc-stans https://pagure.io/389-ds-base/issue/49162 Reviewed by: nhosoi(Thanks!) diff --git a/configure.ac b/configure.ac index 4e3e9fb7d..ebcffd5cd 100644 --- a/configure.ac +++ b/configure.ac @@ -289,6 +289,7 @@ AC_ARG_ENABLE(nunc_stans, AS_HELP_STRING([--enable-nunc-stans], [enable support for nunc-stans event framework (default: no)])) if test "$enable_nunc_stans" = yes ; then + m4_include(m4/event.m4) AC_MSG_RESULT(yes) AC_DEFINE([ENABLE_NUNC_STANS], [1], [enable support for nunc-stans event framework]) else @@ -752,7 +753,6 @@ m4_include(m4/selinux.m4) m4_include(m4/systemd.m4) m4_include(m4/cmocka.m4) m4_include(m4/doxygen.m4) -m4_include(m4/event.m4) m4_include(m4/tcmalloc.m4) PACKAGE_BASE_VERSION=`echo $PACKAGE_VERSION | awk -F\. '{print $1"."$2}'`
0
120e818cc2d2948350d98fac2a77dc785c6d6613
389ds/389-ds-base
Ticket 49165 - Fix compiler warnings Description: Fix compiler warnings https://pagure.io/389-ds-base/issue/49185 Reviewd by: mreynolds(one line commit rule)
commit 120e818cc2d2948350d98fac2a77dc785c6d6613 Author: Mark Reynolds <[email protected]> Date: Fri May 12 12:19:13 2017 -0400 Ticket 49165 - Fix compiler warnings Description: Fix compiler warnings https://pagure.io/389-ds-base/issue/49185 Reviewd by: mreynolds(one line commit rule) diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c index 4fde295b0..0e81643b7 100644 --- a/ldap/servers/slapd/back-ldbm/dblayer.c +++ b/ldap/servers/slapd/back-ldbm/dblayer.c @@ -1267,7 +1267,7 @@ dblayer_start(struct ldbminfo *li, int dbmode) /* li->li_directory comes from nsslapd-directory */ /* dblayer_home_directory is freed in dblayer_post_close. * li_directory needs to live beyond dblayer. */ - slapi_ch_free(&priv->dblayer_home_directory); + slapi_ch_free_string(&priv->dblayer_home_directory); priv->dblayer_home_directory = slapi_ch_strdup(li->li_directory); priv->dblayer_cachesize = li->li_dbcachesize; priv->dblayer_lock_config = li->li_dblock; @@ -7002,7 +7002,7 @@ dblayer_restore_file_update(struct ldbminfo *li, char *directory) PRFileDesc *prfd; char *fname = dblayer_restore_file_name(li); dblayer_file_open(fname, PR_RDWR, li->li_mode, &prfd); - slapi_ch_free(&fname); + slapi_ch_free_string(&fname); if (prfd) { char *line = slapi_ch_smprintf("restore of %s succeeded", directory); slapi_write_buffer(prfd, line, strlen(line)); diff --git a/ldap/servers/slapd/main.c b/ldap/servers/slapd/main.c index 7d27e8340..85e4c6f10 100644 --- a/ldap/servers/slapd/main.c +++ b/ldap/servers/slapd/main.c @@ -185,7 +185,7 @@ main_create_ns(ns_thrpool_t **tp_in) { tp_config.max_threads = maxthreads; tp_config.stacksize = SLAPD_DEFAULT_THREAD_STACKSIZE; /* Highly likely that we need to re-write logging to be controlled by NS here. */ - /* tp_config.log_fct = nunc_stans_logging; */ + tp_config.log_fct = nunc_stans_logging; #ifdef DEBUG tp_config.log_fct = ns_printf_logger; #endif @@ -2037,7 +2037,6 @@ slapd_exemode_ldif2db(void) { int return_value= 0; struct slapdplugin *plugin; - slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); if ( ldif_file == NULL ) { slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_ldif2db", @@ -2160,7 +2159,6 @@ slapd_exemode_db2ldif(int argc, char** argv) { int return_value= 0; struct slapdplugin *plugin; - slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); char *my_ldiffile; char **instp; @@ -2376,7 +2374,6 @@ static int slapd_exemode_db2index(void) { int return_value= 0; struct slapdplugin *plugin; - slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); mapping_tree_init(); @@ -2465,7 +2462,6 @@ slapd_exemode_db2archive(void) { int return_value= 0; struct slapdplugin *backend_plugin; - slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); if ((backend_plugin = plugin_get_by_name("ldbm database")) == NULL) { slapi_log_err(SLAPI_LOG_CRIT, "slapd_exemode_db2archive", @@ -2512,7 +2508,6 @@ slapd_exemode_archive2db(void) { int return_value= 0; struct slapdplugin *backend_plugin; - slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); if ((backend_plugin = plugin_get_by_name("ldbm database")) == NULL) { slapi_log_err(SLAPI_LOG_CRIT, "slapd_exemode_archive2db", @@ -2564,7 +2559,6 @@ slapd_exemode_upgradedb(void) { int return_value= 0; struct slapdplugin *backend_plugin; - slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); if ( archive_name == NULL ) { slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_upgradedb", @@ -2629,7 +2623,6 @@ slapd_exemode_upgradednformat(void) { int rc = -1; /* error, by default */ struct slapdplugin *backend_plugin; - slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); if ( archive_name == NULL ) { slapi_log_err(SLAPI_LOG_ERR, "slapd_exemode_upgradednformat", diff --git a/ldap/servers/slapd/task.c b/ldap/servers/slapd/task.c index afaaebde6..02f8b2e64 100644 --- a/ldap/servers/slapd/task.c +++ b/ldap/servers/slapd/task.c @@ -911,7 +911,7 @@ static int task_import_add(Slapi_PBlock *pb __attribute__((unused)), if (counter == 1){ instance_name = slapi_ch_strdup(*instances); - nameFrombe_name = instance_name; + nameFrombe_name = (char *)instance_name; charray_free(instances); } else if (counter == 0) { slapi_log_err(SLAPI_LOG_ERR,
0
fc3bdb7499e8de168cfd12694ad395023f4eb74a
389ds/389-ds-base
Resolves: #428232 Summary: DN Rename with case change only fails Description: The modrdn operation allows the source dn and the target dn are identical or the same except the cases.
commit fc3bdb7499e8de168cfd12694ad395023f4eb74a Author: Noriko Hosoi <[email protected]> Date: Tue Jul 29 20:37:22 2008 +0000 Resolves: #428232 Summary: DN Rename with case change only fails Description: The modrdn operation allows the source dn and the target dn are identical or the same except the cases. diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c index cc5e78bb2..ca65c5fe6 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c @@ -263,12 +263,14 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) ldap_result_code= -1; goto error_return; /* error result sent by find_entry2modify() */ } - /* Check that an entry with the same DN doesn't already exist. */ { Slapi_Entry *entry; slapi_pblock_get( pb, SLAPI_MODRDN_EXISTING_ENTRY, &entry); - if(entry!=NULL) + if((entry != NULL) && + /* allow modrdn even if the src dn and dest dn are identical */ + (0 != slapi_sdn_compare((const Slapi_DN *)&dn_newdn, + (const Slapi_DN *)&dn_olddn))) { ldap_result_code= LDAP_ALREADY_EXISTS; goto error_return; @@ -279,14 +281,14 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) oldparent_addr.dn = (char*)slapi_sdn_get_dn (&dn_parentdn); oldparent_addr.uniqueid = NULL; parententry = find_entry2modify_only( pb, be, &oldparent_addr, NULL ); - modify_init(&parent_modify_context,parententry); + modify_init(&parent_modify_context,parententry); /* Fetch and lock the new parent of the entry that is moving */ if(slapi_sdn_get_ndn(&dn_newsuperiordn)!=NULL) { slapi_pblock_get (pb, SLAPI_MODRDN_NEWSUPERIOR_ADDRESS, &newsuperior_addr); newparententry = find_entry2modify_only( pb, be, newsuperior_addr, NULL); - modify_init(&newparent_modify_context,newparententry); + modify_init(&newparent_modify_context,newparententry); } opcsn = operation_get_csn (operation); @@ -414,21 +416,25 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) goto error_return; } - slapi_entry_set_sdn( ec->ep_entry, &dn_newdn ); + slapi_entry_set_sdn( ec->ep_entry, &dn_newdn ); /* create it in the cache - prevents others from creating it */ - if ( cache_add_tentative( &inst->inst_cache, ec, NULL ) != 0 ) { + if (( cache_add_tentative( &inst->inst_cache, ec, NULL ) != 0 ) && + /* allow modrdn even if the src dn and dest dn are identical */ + ( 0 != slapi_sdn_compare((const Slapi_DN *)&dn_newdn, + (const Slapi_DN *)&dn_olddn)) ) + { /* somebody must've created it between dn2entry() and here */ /* JCMREPL - Hmm... we can't permit this to happen...? */ ldap_result_code= LDAP_ALREADY_EXISTS; goto error_return; } - ec_in_cache= 1; + ec_in_cache= 1; /* Build the list of modifications required to the existing entry */ { - slapi_mods_init(&smods_generated,4); - slapi_mods_init(&smods_generated_wsi,4); + slapi_mods_init(&smods_generated,4); + slapi_mods_init(&smods_generated_wsi,4); ldap_result_code = moddn_newrdn_mods(pb, slapi_sdn_get_ndn(&dn_olddn), ec, &smods_generated, &smods_generated_wsi, is_replicated_operation); if (ldap_result_code != LDAP_SUCCESS) {
0
db6cd2375f8421184f32ff54f87a1f4a79b0e4a8
389ds/389-ds-base
Issue 51031 UI - transition between two instances needs improvement Bug Description: When you switch between instances in the UI, there is no loading page, there is a long wait before the dropdown menu changes, and it does not refresh the page content (it still contains the previous instance's data). Fix Description: Set the "loading" flag and the serverId right away when instance is changed. Then we set the tab component's key to the server ID so the content is automatically refreshed. fixes: https://pagure.io/389-ds-base/issue/51031 Reviewed by: spichugi(Thanks!)
commit db6cd2375f8421184f32ff54f87a1f4a79b0e4a8 Author: Mark Reynolds <[email protected]> Date: Fri Apr 17 15:46:42 2020 -0400 Issue 51031 UI - transition between two instances needs improvement Bug Description: When you switch between instances in the UI, there is no loading page, there is a long wait before the dropdown menu changes, and it does not refresh the page content (it still contains the previous instance's data). Fix Description: Set the "loading" flag and the serverId right away when instance is changed. Then we set the tab component's key to the server ID so the content is automatically refreshed. fixes: https://pagure.io/389-ds-base/issue/51031 Reviewed by: spichugi(Thanks!) diff --git a/src/cockpit/389-console/src/ds.jsx b/src/cockpit/389-console/src/ds.jsx index b8be78e20..7ff8b03f5 100644 --- a/src/cockpit/389-console/src/ds.jsx +++ b/src/cockpit/389-console/src/ds.jsx @@ -332,6 +332,11 @@ export class DSInstance extends React.Component { } handleServerIdChange(e) { + this.setState({ + pageLoadingState: { state: "loading", jsx: "" }, + progressValue: 25, + serverId: e.target.value + }); this.loadInstanceList(e.target.value); } @@ -625,6 +630,7 @@ export class DSInstance extends React.Component { addNotification={this.addNotification} serverId={this.state.serverId} wasActiveList={this.state.wasActiveList} + key={this.state.serverId} /> </TabPane> <TabPane eventKey={2}> @@ -632,6 +638,7 @@ export class DSInstance extends React.Component { addNotification={this.addNotification} serverId={this.state.serverId} wasActiveList={this.state.wasActiveList} + key={this.state.serverId} /> </TabPane> <TabPane eventKey={3}> @@ -639,6 +646,7 @@ export class DSInstance extends React.Component { addNotification={this.addNotification} serverId={this.state.serverId} wasActiveList={this.state.wasActiveList} + key={this.state.serverId} /> </TabPane> <TabPane eventKey={4}> @@ -646,6 +654,7 @@ export class DSInstance extends React.Component { addNotification={this.addNotification} serverId={this.state.serverId} wasActiveList={this.state.wasActiveList} + key={this.state.serverId} /> </TabPane> <TabPane eventKey={5}> @@ -653,6 +662,7 @@ export class DSInstance extends React.Component { addNotification={this.addNotification} serverId={this.state.serverId} wasActiveList={this.state.wasActiveList} + key={this.state.serverId} /> </TabPane> <TabPane eventKey={6}> @@ -660,6 +670,7 @@ export class DSInstance extends React.Component { addNotification={this.addNotification} serverId={this.state.serverId} wasActiveList={this.state.wasActiveList} + key={this.state.serverId} /> </TabPane> </TabContent>
0
9b779ed84db0d123b64b8ce0a8e43e77316b128e
389ds/389-ds-base
Issue 50853 - Fix NULL pointer deref in config setting Description: Need to check if the config init function is defined for the attribute before blindly calling it. This fixes a regression from issue 48707. relates: https://pagure.io/389-ds-base/issue/50853 Reviewed by: tbordaz & mhonek (Thanks!)
commit 9b779ed84db0d123b64b8ce0a8e43e77316b128e Author: Mark Reynolds <[email protected]> Date: Fri Jan 24 10:34:43 2020 -0500 Issue 50853 - Fix NULL pointer deref in config setting Description: Need to check if the config init function is defined for the attribute before blindly calling it. This fixes a regression from issue 48707. relates: https://pagure.io/389-ds-base/issue/50853 Reviewed by: tbordaz & mhonek (Thanks!) diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c index 41c9bbd6b..c43c5eebd 100644 --- a/ldap/servers/slapd/libglobs.c +++ b/ldap/servers/slapd/libglobs.c @@ -7957,7 +7957,7 @@ config_set(const char *attr, struct berval **values, char *errorbuf, int apply) initval = (void *)config_initvalue_to_onoff(cgas, initvalbuf, sizeof(initvalbuf)); } else if (cgas->config_var_type == CONFIG_SPECIAL_FILTER_VERIFY) { initval = (void *)config_initvalue_to_special_filter_verify(cgas, initvalbuf, sizeof(initvalbuf)); - } else { + } else if (cgas->geninitfunc) { initval = cgas->geninitfunc(); } PR_ASSERT(initval);
0
347b3fee61f77623b9e88855b5618d46660d7ed5
389ds/389-ds-base
Ticket 48824 - Cleanup rpm.mk and 389 specfile Description: Removed the jeamlloc bundling code. Set a version requirement for srvcore. Set ASAN to off by default. Removed incorrect comparison: %if %0{?VAR:1} which only checks if the VAR is defined, not what it is set to. So those checks always returned true, even if the VAR was set to 0. https://fedorahosted.org/389/ticket/48824 Reviewed by: nhosoi(Thanks!)
commit 347b3fee61f77623b9e88855b5618d46660d7ed5 Author: Mark Reynolds <[email protected]> Date: Fri May 6 17:28:27 2016 -0400 Ticket 48824 - Cleanup rpm.mk and 389 specfile Description: Removed the jeamlloc bundling code. Set a version requirement for srvcore. Set ASAN to off by default. Removed incorrect comparison: %if %0{?VAR:1} which only checks if the VAR is defined, not what it is set to. So those checks always returned true, even if the VAR was set to 0. https://fedorahosted.org/389/ticket/48824 Reviewed by: nhosoi(Thanks!) diff --git a/rpm.mk b/rpm.mk index c58c3655e..a880e6200 100644 --- a/rpm.mk +++ b/rpm.mk @@ -4,12 +4,10 @@ RPM_RELEASE ?= $(shell $(PWD)/rpm/rpmverrel.sh release) PACKAGE = 389-ds-base RPM_NAME_VERSION = $(PACKAGE)-$(RPM_VERSION) TARBALL = $(RPM_NAME_VERSION).tar.bz2 -NUNC_STANS_URL ?= $(shell rpmspec -P -D 'use_nunc_stans 1' $(RPMBUILD)/SPECS/389-ds-base.spec | awk '/^Source4:/ {print $$2}') +NUNC_STANS_URL ?= $(shell rpmspec -P -D 'use_nunc_stans 1' $(RPMBUILD)/SPECS/389-ds-base.spec | awk '/^Source3:/ {print $$2}') NUNC_STANS_TARBALL ?= $(shell basename "$(NUNC_STANS_URL)") -JEMALLOC_URL ?= $(shell rpmspec -P $(RPMBUILD)/SPECS/389-ds-base.spec | awk '/^Source3:/ {print $$2}') -JEMALLOC_TARBALL ?= $(shell basename "$(JEMALLOC_URL)") NUNC_STANS_ON = 1 -BUNDLE_JEMALLOC = 0 +ASAN_ON = 0 clean: rm -rf dist @@ -27,9 +25,6 @@ tarballs: local-archive if [ $(NUNC_STANS_ON) -eq 1 ]; then \ wget $(NUNC_STANS_URL) ; \ fi ; \ - if [ $(BUNDLE_JEMALLOC) -eq 1 ]; then \ - wget $(JEMALLOC_URL) ; \ - fi rpmroot: rm -rf $(RPMBUILD) @@ -40,7 +35,7 @@ rpmroot: mkdir -p $(RPMBUILD)/SRPMS sed -e s/__VERSION__/$(RPM_VERSION)/ -e s/__RELEASE__/$(RPM_RELEASE)/ \ -e s/__NUNC_STANS_ON__/$(NUNC_STANS_ON)/ \ - -e s/__BUNDLE_JEMALLOC__/$(BUNDLE_JEMALLOC)/ \ + -e s/__ASAN_ON__/$(ASAN_ON)/ \ rpm/$(PACKAGE).spec.in > $(RPMBUILD)/SPECS/$(PACKAGE).spec rpmdistdir: @@ -54,9 +49,6 @@ rpmbuildprep: if [ $(NUNC_STANS_ON) -eq 1 ]; then \ cp dist/sources/$(NUNC_STANS_TARBALL) $(RPMBUILD)/SOURCES/ ; \ fi - if [ $(BUNDLE_JEMALLOC) -eq 1 ]; then \ - cp dist/sources/$(JEMALLOC_TARBALL) $(RPMBUILD)/SOURCES/ ; \ - fi cp rpm/$(PACKAGE)-* $(RPMBUILD)/SOURCES/ diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in index e3f7e1d2d..02b188dee 100644 --- a/rpm/389-ds-base.spec.in +++ b/rpm/389-ds-base.spec.in @@ -17,24 +17,16 @@ # nunc-stans only builds on x86_64 for now # To build without nunc-stans, set use_nunc_stans to 0. %global use_nunc_stans __NUNC_STANS_ON__ -%if 0%{?use_nunc_stans:1} +%if %{use_nunc_stans} %global nunc_stans_ver 0.1.8 %endif -# Are we bundling jemalloc? -%global bundle_jemalloc __BUNDLE_JEMALLOC__ -%if 0%{?bundle_jemalloc:1} -# The version used in the source tarball -%global jemalloc_ver 3.6.0 -%endif - # This enables an ASAN build. This should not go to production, so we rename. %global use_asan __ASAN_ON__ -%if 0%{?use_asan:1} +%if %{use_asan} %global variant base-asan %endif - # fedora 15 and later uses tmpfiles.d # otherwise, comment this out %{!?with_tmpfiles_d: %global with_tmpfiles_d %{_sysconfdir}/tmpfiles.d} @@ -60,7 +52,7 @@ Provides: ldif2ldbm BuildRequires: nspr-devel BuildRequires: nss-devel -BuildRequires: svrcore-devel +BuildRequires: svrcore-devel >= 4.1.2 %if %{use_openldap} BuildRequires: openldap-devel %else @@ -89,7 +81,7 @@ BuildRequires: tcp_wrappers BuildRequires: pam-devel BuildRequires: systemd-units BuildRequires: systemd-devel -%if 0%{?use_asan:1} +%if %{use_asan} BuildRequires: libasan %endif @@ -138,7 +130,7 @@ Requires: perl-Socket Requires: perl-NetAddr-IP Requires: systemd-libs -%if 0%{?use_asan:1} +%if %{use_asan} Requires: libasan Requires: llvm %endif @@ -147,15 +139,11 @@ Source0: http://port389.org/sources/%{name}-%{version}%{?prerel}.tar.bz # 389-ds-git.sh should be used to generate the source tarball from git Source1: %{name}-git.sh Source2: %{name}-devel.README - -%if 0%{?bundle_jemalloc:1} -Source3: http://www.port389.org/binaries/jemalloc-%{jemalloc_ver}.tar.bz2 -%endif -%if 0%{?use_nunc_stans:1} -Source4: https://git.fedorahosted.org/cgit/nunc-stans.git/snapshot/nunc-stans-%{nunc_stans_ver}.tar.xz +%if %{use_nunc_stans} +Source3: https://git.fedorahosted.org/cgit/nunc-stans.git/snapshot/nunc-stans-%{nunc_stans_ver}.tar.xz %endif -%if 0%{?use_asan:1} +%if %{use_asan} %description 389 Directory Server is an LDAPv3 compliant server. The base package includes the LDAP server and command line utilities for server administration. @@ -187,17 +175,11 @@ BuildRequires: libdb-devel BuildRequires: cyrus-sasl-devel BuildRequires: libicu-devel BuildRequires: pcre-devel -%if 0%{?use_nunc_stans:1} +%if %{use_nunc_stans} BuildRequires: libtalloc-devel BuildRequires: libevent-devel BuildRequires: libtevent-devel %endif -%if 0%{?bundle_jemalloc:1} -BuildRequires: /usr/bin/xsltproc -%ifnarch s390 -BuildRequires: valgrind-devel -%endif -%endif BuildRequires: systemd-devel %description libs @@ -240,16 +222,13 @@ The lib389 CI tests that can be run against the Directory Server. %prep %setup -q -n %{name}-%{version}%{?prerel} -%if 0%{?bundle_jemalloc:1} +%if %{use_nunc_stans} %setup -q -n %{name}-%{version}%{?prerel} -T -D -b 3 %endif -%if 0%{?use_nunc_stans:1} -%setup -q -n %{name}-%{version}%{?prerel} -T -D -b 4 -%endif cp %{SOURCE2} README.devel %build -%if 0%{?use_nunc_stans:1} +%if %{use_nunc_stans} pushd ../nunc-stans-%{nunc_stans_ver} %configure --with-fhs --libdir=%{_libdir}/%{pkgname} make %{?_smp_mflags} @@ -260,13 +239,6 @@ cp nunc-stans.h include/nunc-stans/nunc-stans.h popd %endif -%if 0%{?bundle_jemalloc:1} -pushd ../jemalloc-%{jemalloc_ver} -%configure CFLAGS='%{optflags} -msse2' --libdir=%{_libdir}/%{pkgname} -make %{?_smp_mflags} -popd -%endif - %if %{use_openldap} OPENLDAP_FLAG="--with-openldap" %endif @@ -278,7 +250,7 @@ NSSARGS="--with-svrcore-inc=%{_includedir} --with-svrcore-lib=%{_libdir} --with- NUNC_STANS_FLAGS="--enable-nunc-stans --with-nunc-stans=../nunc-stans-%{nunc_stans_ver}" %endif -%if 0%{?use_asan:1} +%if %{use_asan} ASAN_FLAGS="--enable-asan --enable-debug" %endif @@ -301,7 +273,7 @@ make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT -%if 0%{?use_nunc_stans:1} +%if %{use_nunc_stans} pushd ../nunc-stans-%{nunc_stans_ver} make DESTDIR="$RPM_BUILD_ROOT" install rm -rf $RPM_BUILD_ROOT%{_includedir} $RPM_BUILD_ROOT%{_datadir} \ @@ -309,12 +281,6 @@ rm -rf $RPM_BUILD_ROOT%{_includedir} $RPM_BUILD_ROOT%{_datadir} \ popd %endif -%if 0%{?bundle_jemalloc:1} -pushd ../jemalloc-%{jemalloc_ver} -cp --preserve=links lib/libjemalloc.so* $RPM_BUILD_ROOT%{_libdir}/%{pkgname} -popd -%endif - make DESTDIR="$RPM_BUILD_ROOT" install mkdir -p $RPM_BUILD_ROOT/var/log/%{pkgname} @@ -474,12 +440,9 @@ fi %doc LICENSE LICENSE.GPLv3+ LICENSE.openssl README.devel %{_includedir}/%{pkgname} %{_libdir}/%{pkgname}/libslapd.so -%if 0%{?use_nunc_stans:1} +%if %{use_nunc_stans} %{_libdir}/%{pkgname}/libnunc-stans.so %endif -%if 0%{?bundle_jemalloc:1} -%{_libdir}/%{pkgname}/libjemalloc.so -%endif %{_libdir}/pkgconfig/* %files libs @@ -488,12 +451,9 @@ fi %dir %{_libdir}/%{pkgname} %{_libdir}/%{pkgname}/libslapd.so.* %{_libdir}/%{pkgname}/libns-dshttpd.so* -%if 0%{?use_nunc_stans:1} +%if %{use_nunc_stans} %{_libdir}/%{pkgname}/libnunc-stans.so* %endif -%if 0%{?bundle_jemalloc:1} -%{_libdir}/%{pkgname}/libjemalloc.so* -%endif %files tests %defattr(-,root,root,-)
0
555744f79d26e11394d83784ab6d6bb50949ddfd
389ds/389-ds-base
Ticket 47840 - Fix regression Description: The previous commit switched to using the start/stop scripts from /sbin, instead of the instance scripts. However, when using the sbin scripts you should specify the instance: /sbin/start-dirsrv localhost This is automatically done in the instance scripts, and this behavior needs to be followed when using the sbin scripts. Note - this only seems to break when there are more than one instance on the system https://fedorahosted.org/389/ticket/47840 Reviewed by: wibrown(Thanks!)
commit 555744f79d26e11394d83784ab6d6bb50949ddfd Author: Mark Reynolds <[email protected]> Date: Fri Nov 20 12:22:55 2015 -0500 Ticket 47840 - Fix regression Description: The previous commit switched to using the start/stop scripts from /sbin, instead of the instance scripts. However, when using the sbin scripts you should specify the instance: /sbin/start-dirsrv localhost This is automatically done in the instance scripts, and this behavior needs to be followed when using the sbin scripts. Note - this only seems to break when there are more than one instance on the system https://fedorahosted.org/389/ticket/47840 Reviewed by: wibrown(Thanks!) diff --git a/src/lib389/lib389/tools.py b/src/lib389/lib389/tools.py index f1b8c88b5..7436dfbbd 100644 --- a/src/lib389/lib389/tools.py +++ b/src/lib389/lib389/tools.py @@ -192,10 +192,10 @@ class DirSrvTools(object): #fullCmd = instanceDir + "/" + cmd + "-slapd" fullCmd = None if cmd == 'start': - fullCmd = os.path.join(sbinDir, 'start-dirsrv') + fullCmd = os.path.join(sbinDir, 'start-dirsrv %s' % self.serverid) cmdPat = 'slapd started.' else: - fullCmd = os.path.join(sbinDir, 'stop-dirsrv') + fullCmd = os.path.join(sbinDir, 'stop-dirsrv %s' % self.serverid) cmdPat = 'slapd stopped.' if "USE_GDB" in os.environ or "USE_VALGRIND" in os.environ: @@ -215,8 +215,8 @@ class DirSrvTools(object): pos = logfp.tell() # get current position logfp.seek(pos, os.SEEK_SET) # reset the EOF flag - log.warn("Running command: %r %s" % (fullCmd, self.serverid )) - rc = os.system(fullCmd) + log.warn("Running command: %r" % (fullCmd)) + rc = os.system("%s" % (fullCmd)) while not done and int(time.time()) < timeout: line = logfp.readline() while not done and line: @@ -229,12 +229,12 @@ class DirSrvTools(object): done = True elif line.find("Initialization Failed") >= 0: # sometimes the server fails to start - try again - rc = os.system("%s %s" % (fullCmd, self.serverid)) + rc = os.system("%s %s" % (fullCmd)) pos = logfp.tell() break elif line.find("exiting.") >= 0: # possible transient condition - try again - rc = os.system("%s %s" % (fullCmd, self.serverid)) + rc = os.system("%s %s" % (fullCmd)) pos = logfp.tell() break pos = logfp.tell()
0
0a399a2b4bd3c414035e8b91ea767614a3ef6504
389ds/389-ds-base
Issue 4734 - import of entry with no parent warning (#4735) Description: Online import of ldif file that contains an entry with no parent doesnt generate a task warning. Fixes: https://github.com/389ds/389-ds-base/issues/4734 Author: [email protected] (Thanks) Reviewed by: mreynolds, jchapma
commit 0a399a2b4bd3c414035e8b91ea767614a3ef6504 Author: James Chapman <[email protected]> Date: Sat Apr 24 21:37:54 2021 +0100 Issue 4734 - import of entry with no parent warning (#4735) Description: Online import of ldif file that contains an entry with no parent doesnt generate a task warning. Fixes: https://github.com/389ds/389-ds-base/issues/4734 Author: [email protected] (Thanks) Reviewed by: mreynolds, jchapma diff --git a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_import_threads.c b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_import_threads.c index b02b17f49..452c5cfb2 100644 --- a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_import_threads.c +++ b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_import_threads.c @@ -2767,8 +2767,14 @@ import_foreman(void *param) if (job->flags & FLAG_ABORT) { goto error; } + + /* capture skipped entry warnings for this task */ + if((job) && (job->skipped)) { + slapi_task_set_warning(job->task, WARN_SKIPPED_IMPORT_ENTRY); + } } + slapi_pblock_destroy(pb); info->state = FINISHED; return;
0
92ac8f48c1e5a8a049f4cfd1912fd570c628408f
389ds/389-ds-base
Ticket 47533 logconv: some stats do not work across server restarts https://fedorahosted.org/389/ticket/47533 Reviewed by: mreynolds (Thanks!) Branch: master Fix Description: Most of the stat hashes use connid,opid as the hash key. The connid,opid are not unique because the server recycles connection ids when the server restarts. The solution is to use a triplet of $serverRestartCount,$connid,$opid as the hash key. This uniquely identifies a particular log event over restarts. There is also some additional cleanup that needs to be done when the server is reset - returning fds, marking connections as closed, etc. Also fixed some gmtime handling - we were doing too many conversions. This fix adds another command line option - -U - for a summary of search filters which are unindexed or have unindexed components. The full detailed report is just too much data. Platforms tested: RHEL6 x86_64 Flag Day: no Doc impact: no
commit 92ac8f48c1e5a8a049f4cfd1912fd570c628408f Author: Rich Megginson <[email protected]> Date: Fri Sep 27 11:08:29 2013 -0600 Ticket 47533 logconv: some stats do not work across server restarts https://fedorahosted.org/389/ticket/47533 Reviewed by: mreynolds (Thanks!) Branch: master Fix Description: Most of the stat hashes use connid,opid as the hash key. The connid,opid are not unique because the server recycles connection ids when the server restarts. The solution is to use a triplet of $serverRestartCount,$connid,$opid as the hash key. This uniquely identifies a particular log event over restarts. There is also some additional cleanup that needs to be done when the server is reset - returning fds, marking connections as closed, etc. Also fixed some gmtime handling - we were doing too many conversions. This fix adds another command line option - -U - for a summary of search filters which are unindexed or have unindexed components. The full detailed report is just too much data. Platforms tested: RHEL6 x86_64 Flag Day: no Doc impact: no diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl index ca07a3a68..275ce34e1 100755 --- a/ldap/admin/src/logconv.pl +++ b/ldap/admin/src/logconv.pl @@ -86,7 +86,8 @@ my $xi = 0; my $bindReportDN; my $usage = ""; my @latency; -my @openConnection; +# key is conn number - val is IP address +my %openConnection; my @errorCode; my @errtext; my @errornum; @@ -133,7 +134,8 @@ GetOptions( 'u' => sub { $usage = $usage . "u"; }, 'r' => sub { $usage = $usage . "r"; }, 'y' => sub { $usage = $usage . "y"; }, - 'p' => sub { $usage = $usage . "p"; } + 'p' => sub { $usage = $usage . "p"; }, + 'U' => sub { $usage = $usage . "U"; } ); # @@ -657,7 +659,7 @@ print "Paged Searches: $pagedSearchCount\n"; print "Unindexed Searches: $unindexedSrchCountNotesA\n"; print "Unindexed Components: $unindexedSrchCountNotesU\n"; -if ($verb eq "yes" || $usage =~ /u/){ +if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){ if ($unindexedSrchCountNotesA > 0){ my $conn_hash = $hashes->{conn_hash}; my $notesa_conn_op = $hashes->{notesa_conn_op}; @@ -670,28 +672,39 @@ if ($verb eq "yes" || $usage =~ /u/){ my $notesCount = 1; my $unindexedIp; - while (my ($conn_op, $count) = each %{$notesa_conn_op}) { - my ($conn, $op) = split(",", $conn_op); - if (exists($conn_hash->{$conn}) && defined($conn_hash->{$conn})) { - $unindexedIp = $conn_hash->{$conn}; - } else { - $unindexedIp = "?"; - } - print "\n Unindexed Components #".$notesCount."\n"; $notesCount++; - print " - Date/Time: $time_conn_op->{$conn_op}\n"; - print " - Connection Number: $conn\n"; - print " - Operation Number: $op\n"; - print " - Etime: $etime_conn_op->{$conn_op}\n"; - print " - Nentries: $nentries_conn_op->{$conn_op}\n"; - print " - IP Address: $unindexedIp\n"; - if (exists($base_conn_op->{$conn_op}) && defined($base_conn_op->{$conn_op})) { - print " - Search Base: $base_conn_op->{$conn_op}\n"; + my %uniqFilt = (); # hash of unique filters + while (my ($srcnt_conn_op, $count) = each %{$notesa_conn_op}) { + my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op); + $unindexedIp = getIPfromConn($conn, $srvRstCnt); + if ($usage =~ /u/) { + print "\n Unindexed Search #".$notesCount."\n"; + print " - Date/Time: $time_conn_op->{$srcnt_conn_op}\n"; + print " - Connection Number: $conn\n"; + print " - Operation Number: $op\n"; + print " - Etime: $etime_conn_op->{$srcnt_conn_op}\n"; + print " - Nentries: $nentries_conn_op->{$srcnt_conn_op}\n"; + print " - IP Address: $unindexedIp\n"; + if (exists($base_conn_op->{$srcnt_conn_op}) && defined($base_conn_op->{$srcnt_conn_op})) { + print " - Search Base: $base_conn_op->{$srcnt_conn_op}\n"; + } + if (exists($scope_conn_op->{$srcnt_conn_op}) && defined($scope_conn_op->{$srcnt_conn_op})) { + print " - Search Scope: $scope_conn_op->{$srcnt_conn_op}\n"; + } } - if (exists($scope_conn_op->{$conn_op}) && defined($scope_conn_op->{$conn_op})) { - print " - Search Scope: $scope_conn_op->{$conn_op}\n"; + if (exists($filter_conn_op->{$srcnt_conn_op}) && defined($filter_conn_op->{$srcnt_conn_op})) { + if ($usage =~ /u/) { + print " - Search Filter: $filter_conn_op->{$srcnt_conn_op}\n"; + } + $uniqFilt{$filter_conn_op->{$srcnt_conn_op}}++; } - if (exists($filter_conn_op->{$conn_op}) && defined($filter_conn_op->{$conn_op})) { - print " - Search Filter: $filter_conn_op->{$conn_op}\n"; + $notesCount++; + } + if ($usage =~ /U/) { + print "\n Unindexed Search Summary - $notesCount total unindexed searches\n"; + foreach my $key (sort { $uniqFilt{$b} <=> $uniqFilt{$a} } keys %uniqFilt) { + if ($uniqFilt{$key} > 0) { + printf " - Number of times used unindexed: %10d Filter: $key\n", $uniqFilt{$key}; + } } } } @@ -707,28 +720,39 @@ if ($verb eq "yes" || $usage =~ /u/){ my $notesCount = 1; my $unindexedIp; - while (my ($conn_op, $count) = each %{$notesu_conn_op}) { - my ($conn, $op) = split(",", $conn_op); - if (exists($conn_hash->{$conn}) && defined($conn_hash->{$conn})) { - $unindexedIp = $conn_hash->{$conn}; - } else { - $unindexedIp = "?"; - } - print "\n Unindexed Components #".$notesCount."\n"; $notesCount++; - print " - Date/Time: $time_conn_op->{$conn_op}\n"; - print " - Connection Number: $conn\n"; - print " - Operation Number: $op\n"; - print " - Etime: $etime_conn_op->{$conn_op}\n"; - print " - Nentries: $nentries_conn_op->{$conn_op}\n"; - print " - IP Address: $unindexedIp\n"; - if (exists($base_conn_op->{$conn_op}) && defined($base_conn_op->{$conn_op})) { - print " - Search Base: $base_conn_op->{$conn_op}\n"; + my %uniqFilt = (); # hash of unique filters + while (my ($srcnt_conn_op, $count) = each %{$notesu_conn_op}) { + my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op); + $unindexedIp = getIPfromConn($conn, $srvRstCnt); + if ($usage =~ /u/) { + print "\n Unindexed Component #".$notesCount."\n"; + print " - Date/Time: $time_conn_op->{$srcnt_conn_op}\n"; + print " - Connection Number: $conn\n"; + print " - Operation Number: $op\n"; + print " - Etime: $etime_conn_op->{$srcnt_conn_op}\n"; + print " - Nentries: $nentries_conn_op->{$srcnt_conn_op}\n"; + print " - IP Address: $unindexedIp\n"; + if (exists($base_conn_op->{$srcnt_conn_op}) && defined($base_conn_op->{$srcnt_conn_op})) { + print " - Search Base: $base_conn_op->{$srcnt_conn_op}\n"; + } + if (exists($scope_conn_op->{$srcnt_conn_op}) && defined($scope_conn_op->{$srcnt_conn_op})) { + print " - Search Scope: $scope_conn_op->{$srcnt_conn_op}\n"; + } } - if (exists($scope_conn_op->{$conn_op}) && defined($scope_conn_op->{$conn_op})) { - print " - Search Scope: $scope_conn_op->{$conn_op}\n"; + if (exists($filter_conn_op->{$srcnt_conn_op}) && defined($filter_conn_op->{$srcnt_conn_op})) { + if ($usage =~ /u/) { + print " - Search Filter: $filter_conn_op->{$srcnt_conn_op}\n"; + } + $uniqFilt{$filter_conn_op->{$srcnt_conn_op}}++; } - if (exists($filter_conn_op->{$conn_op}) && defined($filter_conn_op->{$conn_op})) { - print " - Search Filter: $filter_conn_op->{$conn_op}\n"; + $notesCount++; + } + if ($usage =~ /U/) { + print "\n Unindexed Component Summary - $notesCount total unindexed components\n"; + foreach my $key (sort { $uniqFilt{$b} <=> $uniqFilt{$a} } keys %uniqFilt) { + if ($uniqFilt{$key} > 0) { + printf " - Number of times used unindexed: %10d Filter: $key\n", $uniqFilt{$key}; + } } } } @@ -829,12 +853,10 @@ if ($verb eq "yes" || $usage =~ /y/){ ################################### if ($verb eq "yes" || $usage =~ /p/){ - if (@openConnection > 0){ + if (%openConnection){ print "\n\n----- Current Open Connection IDs ----- \n\n"; - for (my $i=0; $i <= $#openConnection ; $i++) { - if ($openConnection[$i]) { - print "Conn Number: $i (" . getIPfromConn($i) . ")\n"; - } + while (my ($connid, $ip) = each %openConnection) { + print "Conn Number: $connid ($ip)\n"; } } } @@ -904,13 +926,13 @@ if ($verb eq "yes" || $usage =~ /f/ ){ my $badpwd_conn_op = $hashes->{badpwd_conn_op}; # key is binddn - val is count my %badPassword = (); - my @badPasswordIp = (); - while (my ($conn_op, $count) = each %{$badpwd_conn_op}) { - my ($conn, $op) = split(",", $conn_op); - if (exists($bind_conn_op->{$conn_op}) && defined($bind_conn_op->{$conn_op})) { - my $binddn = $bind_conn_op->{$conn_op}; + my %badPasswordIp = (); + while (my ($srcnt_conn_op, $ip) = each %{$badpwd_conn_op}) { + my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op); + if (exists($bind_conn_op->{$srcnt_conn_op}) && defined($bind_conn_op->{$srcnt_conn_op})) { + my $binddn = $bind_conn_op->{$srcnt_conn_op}; $badPassword{$binddn}++; - push @badPasswordIp, getIPfromConn($conn); + $badPasswordIp{$ip}++; } } # sort the new hash of $badPassword{} @@ -923,8 +945,11 @@ if ($verb eq "yes" || $usage =~ /f/ ){ printf "%-4s %-40s\n", $badPassword{"$badpw"}, $badpw; } print "\nFrom the IP address(s) :\n\n"; - for (my $i=0; $i<$badPwdCount; $i++) { - print "\t\t$badPasswordIp[$i]\n"; + $bpCount = 0; + foreach my $ip (sort {$badPassword{$b} <=> $badPassword{$a} } keys %badPasswordIp){ + if ($bpCount > $sizeCount){ last;} + $bpCount++; + printf "%-4s %-16s\n", $badPasswordIp{$ip}, $ip; } if ($bpTotal > $badPwdCount){ print "\n** Warning : Wrongly reported failed login attempts : ". ($bpTotal - $badPwdCount) . "\n"; @@ -1220,33 +1245,28 @@ if ($usage =~ /g/i || $verb eq "yes"){ print "\n\n----- Abandon Request Stats -----\n\n"; - while (my ($conn_op, $targ_msgid) = each %{$abandon_conn_op}) { - my ($conn, $op) = split(",", $conn_op); + while (my ($srcnt_conn_op, $targ_msgid) = each %{$abandon_conn_op}) { + my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op); my ($targetop, $msgid) = split(",", $targ_msgid); - my $conn_targ = "$conn,$targetop"; - my $clientIP; - if (exists($conn_hash->{$conn}) && defined($conn_hash->{$conn})) { - $clientIP = $conn_hash->{$conn}; - } else { - $clientIP = "Unknown"; - } - if (exists($srch_conn_op->{$conn_targ}) && defined($srch_conn_op->{$conn_targ})) { + my $srcnt_conn_targ = "$srvRstCnt,$conn,$targetop"; + my $clientIP = getIPfromConn($conn, $srvRstCnt); + if (exists($srch_conn_op->{$srcnt_conn_targ}) && defined($srch_conn_op->{$srcnt_conn_targ})) { print " - SRCH conn=$conn op=$targetop msgid=$msgid client=$clientIP\n"; - } elsif (exists($del_conn_op->{$conn_targ}) && defined($del_conn_op->{$conn_targ})) { + } elsif (exists($del_conn_op->{$srcnt_conn_targ}) && defined($del_conn_op->{$srcnt_conn_targ})) { print " - DEL conn=$conn op=$targetop msgid=$msgid client=$clientIP\n"; - } elsif (exists($add_conn_op->{$conn_targ}) && defined($add_conn_op->{$conn_targ})) { + } elsif (exists($add_conn_op->{$srcnt_conn_targ}) && defined($add_conn_op->{$srcnt_conn_targ})) { print " - ADD conn=$conn op=$targetop msgid=$msgid client=$clientIP\n"; - } elsif (exists($mod_conn_op->{$conn_targ}) && defined($mod_conn_op->{$conn_targ})) { + } elsif (exists($mod_conn_op->{$srcnt_conn_targ}) && defined($mod_conn_op->{$srcnt_conn_targ})) { print " - MOD conn=$conn op=$targetop msgid=$msgid client=$clientIP\n"; - } elsif (exists($cmp_conn_op->{$conn_targ}) && defined($cmp_conn_op->{$conn_targ})) { + } elsif (exists($cmp_conn_op->{$srcnt_conn_targ}) && defined($cmp_conn_op->{$srcnt_conn_targ})) { print " - CMP conn=$conn op=$targetop msgid=$msgid client=$clientIP\n"; - } elsif (exists($mdn_conn_op->{$conn_targ}) && defined($mdn_conn_op->{$conn_targ})) { + } elsif (exists($mdn_conn_op->{$srcnt_conn_targ}) && defined($mdn_conn_op->{$srcnt_conn_targ})) { print " - MODRDN conn=$conn op=$targetop msgid=$msgid client=$clientIP\n"; - } elsif (exists($bind_conn_op->{$conn_targ}) && defined($bind_conn_op->{$conn_targ})) { + } elsif (exists($bind_conn_op->{$srcnt_conn_targ}) && defined($bind_conn_op->{$srcnt_conn_targ})) { print " - BIND conn=$conn op=$targetop msgid=$msgid client=$clientIP\n"; - } elsif (exists($unbind_conn_op->{$conn_targ}) && defined($unbind_conn_op->{$conn_targ})) { + } elsif (exists($unbind_conn_op->{$srcnt_conn_targ}) && defined($unbind_conn_op->{$srcnt_conn_targ})) { print " - UNBIND conn=$conn op=$targetop msgid=$msgid client=$clientIP\n"; - } elsif (exists($ext_conn_op->{$conn_targ}) && defined($ext_conn_op->{$conn_targ})) { + } elsif (exists($ext_conn_op->{$srcnt_conn_targ}) && defined($ext_conn_op->{$srcnt_conn_targ})) { print " - EXT conn=$conn op=$targetop msgid=$msgid client=$clientIP\n"; } else { print " - UNKNOWN conn=$conn op=$targetop msgid=$msgid client=$clientIP\n"; @@ -1521,6 +1541,44 @@ processOpForBindReport } my ($last_tm, $lastzone, $last_min, $gmtime, $tzoff); +sub handleConnClose +{ + my $connID = shift; + $fdReturned++; + $simConnection--; + + delete $openConnection{$connID}; + if ($reportStats or ($verb eq "yes") || ($usage =~ /y/)) { + # if we didn't see the start time of this connection + # i.e. due to truncation or log rotation + # then just set to 0 + my $stoc = $hashes->{start_time_of_connection}->{$connID} || 0; + $hashes->{end_time_of_connection}->{$connID} = $gmtime || 0; + my $diff = $hashes->{end_time_of_connection}->{$connID} - $stoc; + $hashes->{start_time_of_connection}->{$connID} = $hashes->{end_time_of_connection}->{$connID} = 0; + if ($diff <= 1) { $latency[0]++;} + if ($diff == 2) { $latency[1]++;} + if ($diff == 3) { $latency[2]++;} + if ($diff >= 4 && $diff <=5 ) { $latency[3]++;} + if ($diff >= 6 && $diff <=10 ) { $latency[4]++;} + if ($diff >= 11 && $diff <=15 ) { $latency[5]++;} + if ($diff >= 16) { $latency[6] ++;} + } +} + +sub handleRestart +{ + # there are some stats which depend on restarts + if ($verb eq "yes") { + print "Found a restart - resetting stats that depend on restarts"; + } + for my $connID (keys %openConnection) { + handleConnClose($connID); + } + %openConnection = (); # reset open connections + $serverRestartCount++; +} + sub parseLineNormal { local $_ = $logline; @@ -1612,42 +1670,42 @@ sub parseLineNormal $anyAttrs++; } if ($verb eq "yes"){ - if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{srch_conn_op}->{"$1,$2"}++;} + if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{srch_conn_op}->{"$serverRestartCount,$1,$2"}++;} } } if (m/ DEL/){ $delCount++; if($reportStats){ inc_stats('del',$s_stats,$m_stats); } if ($verb eq "yes"){ - if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{del_conn_op}->{"$1,$2"}++;} + if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{del_conn_op}->{"$serverRestartCount,$1,$2"}++;} } } if (m/ MOD dn=/){ $modCount++; if($reportStats){ inc_stats('mod',$s_stats,$m_stats); } if ($verb eq "yes"){ - if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{mod_conn_op}->{"$1,$2"}++;} + if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{mod_conn_op}->{"$serverRestartCount,$1,$2"}++;} } } if (m/ ADD/){ $addCount++; if($reportStats){ inc_stats('add',$s_stats,$m_stats); } if ($verb eq "yes"){ - if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{add_conn_op}->{"$1,$2"}++;} + if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{add_conn_op}->{"$serverRestartCount,$1,$2"}++;} } } if (m/ MODRDN/){ $modrdnCount++; if($reportStats){ inc_stats('modrdn',$s_stats,$m_stats); } if ($verb eq "yes"){ - if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{mdn_conn_op}->{"$1,$2"}++;} + if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{mdn_conn_op}->{"$serverRestartCount,$1,$2"}++;} } } if (m/ CMP dn=/){ $cmpCount++; if($reportStats){ inc_stats('cmp',$s_stats,$m_stats); } if ($verb eq "yes" || $usage =~ /g/i){ - if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{cmp_conn_op}->{"$1,$2"}++;} + if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{cmp_conn_op}->{"$serverRestartCount,$1,$2"}++;} } } if (m/ ABANDON /){ @@ -1662,7 +1720,7 @@ sub parseLineNormal if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+) +ABANDON +targetop= *([0-9a-zA-Z]+) +msgid= *([0-9\-]+)/i ){ # abandon_conn_op - key is the conn,op of the ABANDON request # the value is the targetop,msgid of the ABANDON request - $hashes->{abandon_conn_op}->{"$1,$2"} = "$3,$4"; # targetop,msgid + $hashes->{abandon_conn_op}->{"$serverRestartCount,$1,$2"} = "$3,$4"; # targetop,msgid } } if (m/ VLV /){ @@ -1676,7 +1734,9 @@ sub parseLineNormal if (m/ SORT /){$vlvSortCount++} if (m/ version=2/){$v2BindCount++} if (m/ version=3/){$v3BindCount++} - if (m/ conn=1 fd=/){$serverRestartCount++} + if (m/ conn=1 fd=/){ + handleRestart(); + } if (m/ SSL connection from/){$sslCount++; if($reportStats){ inc_stats('sslconns',$s_stats,$m_stats); }} if (m/ connection from local to /){$ldapiCount++;} if($_ =~ /AUTOBIND dn=\"(.*)\"/){ @@ -1697,9 +1757,11 @@ sub parseLineNormal } } if (m/ connection from/){ + my $ip; if ($_ =~ /connection from *([0-9A-Fa-f\.\:]+)/i ){ + $ip = $1; for (my $xxx =0; $xxx < $#excludeIP; $xxx++){ - if ($excludeIP[$xxx] eq $1){$exc = "yes";} + if ($excludeIP[$xxx] eq $ip){$exc = "yes";} } if ($exc ne "yes"){ $connectionCount++; @@ -1711,40 +1773,17 @@ sub parseLineNormal $maxsimConnection = $simConnection; } ($connID) = $_ =~ /conn=(\d*)\s/; - $openConnection[$connID]++; + $openConnection{$connID} = $ip; if ($reportStats or ($verb eq "yes") || ($usage =~ /y/)) { - my ($time, $tzone) = split (' ', $_); - my ($date, $hr, $min, $sec) = split (':', $time); - my ($day, $mon, $yr) = split ('/', $date); - $day =~ s/\[//; - $hashes->{start_time_of_connection}->{$connID} = timegm($sec, $min, $hr, $day, $monthname{$mon}, $yr); + $hashes->{start_time_of_connection}->{$connID} = $gmtime; } } if (m/ SSL client bound as /){$sslClientBindCount++;} if (m/ SSL failed to map client certificate to LDAP DN/){$sslClientFailedCount++;} if (m/ fd=/ && m/slot=/){$fdTaken++} if (m/ fd=/ && m/closed/){ - $fdReturned++; - $simConnection--; - ($connID) = $_ =~ /conn=(\d*)\s/; - $openConnection[$connID]--; - if ($reportStats or ($verb eq "yes") || ($usage =~ /y/)) { - # if we didn't see the start time of this connection - # i.e. due to truncation or log rotation - # then just set to 0 - my $stoc = $hashes->{start_time_of_connection}->{$connID} || 0; - $hashes->{end_time_of_connection}->{$connID} = $gmtime || 0; - my $diff = $hashes->{end_time_of_connection}->{$connID} - $stoc; - $hashes->{start_time_of_connection}->{$connID} = $hashes->{end_time_of_connection}->{$connID} = 0; - if ($diff <= 1) { $latency[0]++;} - if ($diff == 2) { $latency[1]++;} - if ($diff == 3) { $latency[2]++;} - if ($diff >= 4 && $diff <=5 ) { $latency[3]++;} - if ($diff >= 6 && $diff <=10 ) { $latency[4]++;} - if ($diff >= 11 && $diff <=15 ) { $latency[5]++;} - if ($diff >= 16) { $latency[6] ++;} - } + handleConnClose($connID); } if (m/ BIND/ && $_ =~ /dn=\"(.*)\" method/i ){ my $binddn = $1; @@ -1761,13 +1800,13 @@ sub parseLineNormal $tmpp =~ tr/A-Z/a-z/; $hashes->{bindlist}->{$tmpp}++; if($usage =~ /f/ || $verb eq "yes"){ - $hashes->{bind_conn_op}->{"$conn,$op"} = $tmpp; + $hashes->{bind_conn_op}->{"$serverRestartCount,$conn,$op"} = $tmpp; } } else { $anonymousBindCount++; $hashes->{bindlist}->{"Anonymous Binds"}++; if($usage =~ /f/ || $verb eq "yes"){ - $hashes->{bind_conn_op}->{"$conn,$op"} = ""; + $hashes->{bind_conn_op}->{"$serverRestartCount,$conn,$op"} = ""; } inc_stats('anonbind',$s_stats,$m_stats); } @@ -1775,7 +1814,7 @@ sub parseLineNormal if (m/ UNBIND/){ $unbindCount++; if ($verb eq "yes"){ - if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{unbind_conn_op}->{"$1,$2"}++;} + if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{unbind_conn_op}->{"$serverRestartCount,$1,$2"}++;} } } if (m/ RESULT err=/ && m/ notes=[A-Z,]*P/){ @@ -1795,11 +1834,11 @@ sub parseLineNormal # unindexed search stat, as VLV unindexed searches aren't that bad $unindexedSrchCountNotesA++; if($reportStats){ inc_stats('notesA',$s_stats,$m_stats); } - if ($usage =~ /u/ || $verb eq "yes"){ - $hashes->{notesa_conn_op}->{"$con,$op"}++; - if ($_ =~ /etime= *([0-9.]+)/i ){ $hashes->{etime_conn_op}->{"$con,$op"} = $1; } - if ($_ =~ / *([0-9a-z:\/]+)/i){ $hashes->{time_conn_op}->{"$con,$op"} = $1; } - if ($_ =~ /nentries= *([0-9]+)/i ){ $hashes->{nentries_conn_op}->{"$con,$op"} = $1; } + if ($usage =~ /u/ || $usage =~ /U/ || $verb eq "yes"){ + $hashes->{notesa_conn_op}->{"$serverRestartCount,$con,$op"}++; + if ($_ =~ /etime= *([0-9.]+)/i ){ $hashes->{etime_conn_op}->{"$serverRestartCount,$con,$op"} = $1; } + if ($_ =~ / *([0-9a-z:\/]+)/i){ $hashes->{time_conn_op}->{"$serverRestartCount,$con,$op"} = $1; } + if ($_ =~ /nentries= *([0-9]+)/i ){ $hashes->{nentries_conn_op}->{"$serverRestartCount,$con,$op"} = $1; } } } $isVlvNotes = 0; @@ -1818,11 +1857,11 @@ sub parseLineNormal # unindexed search stat, as VLV unindexed searches aren't that bad $unindexedSrchCountNotesU++; if($reportStats){ inc_stats('notesU',$s_stats,$m_stats); } - if ($usage =~ /u/ || $verb eq "yes"){ - $hashes->{notesu_conn_op}->{"$con,$op"}++; - if ($_ =~ /etime= *([0-9.]+)/i ){ $hashes->{etime_conn_op}->{"$con,$op"} = $1; } - if ($_ =~ / *([0-9a-z:\/]+)/i){ $hashes->{time_conn_op}->{"$con,$op"} = $1; } - if ($_ =~ /nentries= *([0-9]+)/i ){ $hashes->{nentries_conn_op}->{"$con,$op"} = $1; } + if ($usage =~ /u/ || $usage =~ /U/ || $verb eq "yes"){ + $hashes->{notesu_conn_op}->{"$serverRestartCount,$con,$op"}++; + if ($_ =~ /etime= *([0-9.]+)/i ){ $hashes->{etime_conn_op}->{"$serverRestartCount,$con,$op"} = $1; } + if ($_ =~ / *([0-9a-z:\/]+)/i){ $hashes->{time_conn_op}->{"$serverRestartCount,$con,$op"} = $1; } + if ($_ =~ /nentries= *([0-9]+)/i ){ $hashes->{nentries_conn_op}->{"$serverRestartCount,$con,$op"} = $1; } } } $isVlvNotes = 0; @@ -1885,14 +1924,14 @@ sub parseLineNormal $hashes->{ip_hash}->{$ip}++; if ($_ =~ /conn= *([0-9A-Z]+)/i ){ if ($exc ne "yes"){ - $hashes->{conn_hash}->{$1} = $ip; + $hashes->{conn_hash}->{"$serverRestartCount,$1"} = $ip; } } } if (m/- A1/){ if ($_ =~ /conn= *([0-9A-Z]+)/i) { $exc = "no"; - $ip = getIPfromConn($1); + $ip = getIPfromConn($1, $serverRestartCount); for (my $xxx = 0; $xxx < $#excludeIP; $xxx++){ if ($ip eq $excludeIP[$xxx]){$exc = "yes";} } @@ -1906,7 +1945,7 @@ sub parseLineNormal if (m/- B1/){ if ($_ =~ /conn= *([0-9A-Z]+)/i) { $exc = "no"; - $ip = getIPfromConn($1); + $ip = getIPfromConn($1, $serverRestartCount); for (my $xxx = 0; $xxx < $#excludeIP; $xxx++){ if ($ip eq $excludeIP[$xxx]){$exc = "yes";} } @@ -1920,7 +1959,7 @@ sub parseLineNormal if (m/- B4/){ if ($_ =~ /conn= *([0-9A-Z]+)/i) { $exc = "no"; - $ip = getIPfromConn($1); + $ip = getIPfromConn($1, $serverRestartCount); for (my $xxx = 0; $xxx < $#excludeIP; $xxx++){ if ($ip eq $excludeIP[$xxx]){$exc = "yes";} } @@ -1934,7 +1973,7 @@ sub parseLineNormal if (m/- T1/){ if ($_ =~ /conn= *([0-9A-Z]+)/i) { $exc = "no"; - $ip = getIPfromConn($1); + $ip = getIPfromConn($1, $serverRestartCount); for (my $xxx = 0; $xxx < $#excludeIP; $xxx++){ if ($ip eq $excludeIP[$xxx]){$exc = "yes";} } @@ -1948,7 +1987,7 @@ sub parseLineNormal if (m/- T2/){ if ($_ =~ /conn= *([0-9A-Z]+)/i) { $exc = "no"; - $ip = getIPfromConn($1); + $ip = getIPfromConn($1, $serverRestartCount); for (my $xxx = 0; $xxx < $#excludeIP; $xxx++){ if ($ip eq $excludeIP[$xxx]){$exc = "yes";} } @@ -1962,7 +2001,7 @@ sub parseLineNormal if (m/- B2/){ if ($_ =~ /conn= *([0-9A-Z]+)/i) { $exc = "no"; - $ip = getIPfromConn($1); + $ip = getIPfromConn($1, $serverRestartCount); $maxBerSizeCount++; for (my $xxx = 0; $xxx < $#excludeIP; $xxx++){ if ($ip eq $excludeIP[$xxx]){$exc = "yes";} @@ -1977,7 +2016,7 @@ sub parseLineNormal if (m/- B3/){ if ($_ =~ /conn= *([0-9A-Z]+)/i) { $exc = "no"; - $ip = getIPfromConn($1); + $ip = getIPfromConn($1, $serverRestartCount); for (my $xxx = 0; $xxx < $#excludeIP; $xxx++){ if ($ip eq $excludeIP[$xxx]){$exc = "yes";} } @@ -1991,7 +2030,7 @@ sub parseLineNormal if (m/- R1/){ if ($_ =~ /conn= *([0-9A-Z]+)/i) { $exc = "no"; - $ip = getIPfromConn($1); + $ip = getIPfromConn($1, $serverRestartCount); for (my $xxx = 0; $xxx < $#excludeIP; $xxx++){ if ($ip eq $excludeIP[$xxx]){$exc = "yes";} } @@ -2005,7 +2044,7 @@ sub parseLineNormal if (m/- P1/){ if ($_ =~ /conn= *([0-9A-Z]+)/i) { $exc = "no"; - $ip = getIPfromConn($1); + $ip = getIPfromConn($1, $serverRestartCount); for (my $xxx = 0; $xxx < $#excludeIP; $xxx++){ if ($ip eq $excludeIP[$xxx]){$exc = "yes";} } @@ -2019,7 +2058,7 @@ sub parseLineNormal if (m/- P2/){ if ($_ =~ /conn= *([0-9A-Z]+)/i) { $exc = "no"; - $ip = getIPfromConn($1); + $ip = getIPfromConn($1, $serverRestartCount); for (my $xxx = 0; $xxx < $#excludeIP; $xxx++){ if ($ip eq $excludeIP[$xxx]){$exc = "yes";} } @@ -2033,7 +2072,7 @@ sub parseLineNormal if (m/- U1/){ if ($_ =~ /conn= *([0-9A-Z]+)/i) { $exc = "no"; - $ip = getIPfromConn($1); + $ip = getIPfromConn($1, $serverRestartCount); for (my $xxx = 0; $xxx < $#excludeIP; $xxx++){ if ($ip eq $excludeIP[$xxx]){$exc = "yes";} } @@ -2062,10 +2101,10 @@ sub parseLineNormal if ($_ =~ /oid=\" *([0-9\.]+)/i ){ $hashes->{oid}->{$1}++; } if ($1 && $1 eq $startTLSoid){$startTLSCount++;} if ($verb eq "yes"){ - if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{ext_conn_op}->{"$1,$2"}++;} + if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{ext_conn_op}->{"$serverRestartCount,$1,$2"}++;} } } - if (($usage =~ /l/ || $verb eq "yes") and / SRCH /){ + if (($usage =~ /l/ || $verb eq "yes" || $usage =~ /u/ || $usage =~ /U/) and / SRCH /){ my ($filterConn, $filterOp); if (/ SRCH / && / attrs=/ && $_ =~ /filter=\"(.*)\" /i ){ $tmpp = $1; @@ -2083,13 +2122,13 @@ sub parseLineNormal if ($_ =~ /op= *([0-9\-]+)/i) { $filterOp = $1; } } $filterCount++; - if($usage =~ /u/ || $verb eq "yes"){ + if($usage =~ /u/ || $usage =~ /U/ || $verb eq "yes"){ # we only need this for the unindexed search report - $hashes->{filter_conn_op}->{"$filterConn,$filterOp"} = $tmpp; + $hashes->{filter_conn_op}->{"$serverRestartCount,$filterConn,$filterOp"} = $tmpp; } } - if ($usage =~ /a/ || $verb eq "yes"){ - if (/ SRCH / && $_ =~ /base=\"(.*)\" scope/i ){ + if (($usage =~ /a/ || $verb eq "yes" || $usage =~ /u/ || $usage =~ /U/) and / SRCH /){ + if ($_ =~ /base=\"(.*)\" scope/i ){ my ($conn, $op, $scopeVal); if ($1 eq ""){ $tmpp = "Root DSE"; @@ -2110,10 +2149,10 @@ sub parseLineNormal if ($_ =~ /op= *([0-9\-]+)/i) { $op = $1; } - if($usage =~ /u/ || $verb eq "yes"){ + if($usage =~ /u/ || $usage =~ /U/ || $verb eq "yes"){ # we only need this for the unindexed search report - $hashes->{base_conn_op}->{"$conn,$op"} = $tmpp; - $hashes->{scope_conn_op}->{"$conn,$op"} = $scopeTxt[$scopeVal]; + $hashes->{base_conn_op}->{"$serverRestartCount,$conn,$op"} = $tmpp; + $hashes->{scope_conn_op}->{"$serverRestartCount,$conn,$op"} = $scopeTxt[$scopeVal]; } $baseCount++; $scopeCount++; @@ -2133,7 +2172,9 @@ sub parseLineNormal $badPwdCount++; } elsif (/ err=49 tag=/ ){ $badPwdCount++; - if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ $hashes->{badpwd_conn_op}->{"$1,$2"}++;} + if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){ + $hashes->{badpwd_conn_op}->{"$serverRestartCount,$1,$2"} = getIPfromConn($1, $serverRestartCount); + } } } if (/ BIND / && /method=sasl/i){ @@ -2394,9 +2435,11 @@ sub getIPfromConn { my $connid = shift; - if (exists($hashes->{conn_hash}->{$connid}) && - defined($hashes->{conn_hash}->{$connid})) { - return $hashes->{conn_hash}->{$connid}; + my $serverRestartCount = shift; + my $key = "$serverRestartCount,$connid"; + if (exists($hashes->{conn_hash}->{$key}) && + defined($hashes->{conn_hash}->{$key})) { + return $hashes->{conn_hash}->{$key}; } return "Unknown_Host"; diff --git a/man/man1/logconv.pl.1 b/man/man1/logconv.pl.1 index c2a8cd820..46e7c96d5 100644 --- a/man/man1/logconv.pl.1 +++ b/man/man1/logconv.pl.1 @@ -21,7 +21,7 @@ logconv.pl \- analyzes Directory Server access log files .B logconv.pl [\fI\-h\fR] [\fI\-d <rootDN>\fR] [\fI\-s <size limit>\fR] [\fI\-v\fR] [\fI\-V\fR] [\fI\-S <start time>\fR] [\fI\-E <end time>\fR] -[\fI\-efcibaltnxgju\fR] [\fI access log ... ... \fR] +[\fI\-efcibaltnxgjuU\fR] [\fI access log ... ... \fR] .PP .SH DESCRIPTION Analyzes Directory Server access log files for specific information defined on the command @@ -68,10 +68,10 @@ This option creates a CSV report for spreadsheets. .B \fB\-B, \-\-bind\fR <ALL | ANONYMOUS | "Bind DN"> This generates a report based on either ALL bind dn's, anonymous binds, or a specific DN. .TP -\fB\-V, \-\-verbose\fR <enable verbose output \- includes all stats listed below> +\fB\-V, \-\-verbose\fR <enable verbose output \- includes all stats listed below except U> Verbose output .TP -.B \fB\-[efcibaltnxgju]\fR +.B \fB\-[efcibaltnxgjuU]\fR .br \fBe\fR Error Code stats .br @@ -99,11 +99,13 @@ Verbose output .br \fBj\fR Recommendations .br -\fBu\fR Unindexed Search Stats +\fBu\fR Unindexed Search Stats (very detailed) .br \fBy\fR Connection Latency Stats .br \fBp\fR Open Connection ID Stats +.br +\fBU\fR Unindexed Search Summary .PP .SH USAGE Examples:
0
a5dde495a7df7b19fd71cccdb0eb1b91d1f73b58
389ds/389-ds-base
Ticket 47411 - Replace substring search with plain search in referint plugin Bug Description: RI plugin uses a substring search by default, which is much more expensive than an equality search filter. Fix Description: Only use the substring search if the operation is a modrdn. https://fedorahosted.org/389/ticket/47411 Reveiwed by: richm(Thanks!)
commit a5dde495a7df7b19fd71cccdb0eb1b91d1f73b58 Author: Mark Reynolds <[email protected]> Date: Wed Jul 31 12:21:19 2013 -0400 Ticket 47411 - Replace substring search with plain search in referint plugin Bug Description: RI plugin uses a substring search by default, which is much more expensive than an equality search filter. Fix Description: Only use the substring search if the operation is a modrdn. https://fedorahosted.org/389/ticket/47411 Reveiwed by: richm(Thanks!) diff --git a/ldap/servers/plugins/referint/referint.c b/ldap/servers/plugins/referint/referint.c index d31f53cb1..3d5bba86f 100644 --- a/ldap/servers/plugins/referint/referint.c +++ b/ldap/servers/plugins/referint/referint.c @@ -742,7 +742,12 @@ update_integrity(char **argv, Slapi_DN *origSDN, search_base = slapi_sdn_get_dn( sdn ); for(i = 3; argv[i] != NULL; i++){ - filter = slapi_filter_sprintf("(%s=*%s%s)", argv[i], ESC_NEXT_VAL, origDN); + if(newrDN){ + /* we need to check the children of the old dn, so use a wildcard */ + filter = slapi_filter_sprintf("(%s=*%s%s)", argv[i], ESC_NEXT_VAL, origDN); + } else { + filter = slapi_filter_sprintf("(%s=%s%s)", argv[i], ESC_NEXT_VAL, origDN); + } if ( filter ) { /* Need only the current attribute and its subtypes */ attrs[0] = argv[i];
0
4c66307c88d74ada36ebdbcfca4b97b1d71fd93b
389ds/389-ds-base
Ticket 48801 - ASAN errors during tests Bug Description: ERROR: AddressSanitizer: stack-buffer-overflow was detected during the stress tests of DS Fix Description: passthru auth was using an int rather than a ber_tag_t for the pointer into slapi_pblock_get causing a buffer overflow. https://fedorahosted.org/389/ticket/48801 Author: wibrown Review by: nhosoi
commit 4c66307c88d74ada36ebdbcfca4b97b1d71fd93b Author: William Brown <[email protected]> Date: Fri Apr 22 12:12:59 2016 +1000 Ticket 48801 - ASAN errors during tests Bug Description: ERROR: AddressSanitizer: stack-buffer-overflow was detected during the stress tests of DS Fix Description: passthru auth was using an int rather than a ber_tag_t for the pointer into slapi_pblock_get causing a buffer overflow. https://fedorahosted.org/389/ticket/48801 Author: wibrown Review by: nhosoi diff --git a/ldap/servers/plugins/passthru/ptpreop.c b/ldap/servers/plugins/passthru/ptpreop.c index 1fc8b1f6b..95b3b33b0 100644 --- a/ldap/servers/plugins/passthru/ptpreop.c +++ b/ldap/servers/plugins/passthru/ptpreop.c @@ -120,7 +120,8 @@ passthru_bindpreop_close( Slapi_PBlock *pb ) static int passthru_bindpreop( Slapi_PBlock *pb ) { - int rc, method, freeresctrls=1; + int rc, freeresctrls=1; + ber_tag_t method = 0; char *matcheddn; const char *normbinddn = NULL; Slapi_DN *sdn = NULL;
0
5df6f4b0c4e28651b86bea3b8a58e6687bee47e9
389ds/389-ds-base
Ticket 5 - Integrate asan support for code quality checking Bug Description: Coverity found a number of defects that could have been detected with asan use during testing. Fix Description: Include the --enable-asan flag to make it easier to run with stricter checks during development. https://pagure.io/svrcore/issue/5 Author: wibrown Review by: nhosoi (Thanks!)
commit 5df6f4b0c4e28651b86bea3b8a58e6687bee47e9 Author: William Brown <[email protected]> Date: Tue Apr 12 13:33:13 2016 +1000 Ticket 5 - Integrate asan support for code quality checking Bug Description: Coverity found a number of defects that could have been detected with asan use during testing. Fix Description: Include the --enable-asan flag to make it easier to run with stricter checks during development. https://pagure.io/svrcore/issue/5 Author: wibrown Review by: nhosoi (Thanks!) diff --git a/configure.ac b/configure.ac index ec0d03ab5..4ca7d25db 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,30 @@ m4_include(m4/nss.m4) m4_include(m4/nspr.m4) m4_include(m4/systemd.m4) +AC_MSG_CHECKING(for --enable-debug) +AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Enable debug features (default: no)]), +[ + AC_MSG_RESULT(yes) + debug_defs="-g3 -DDEBUG" +], +[ + AC_MSG_RESULT(no) + debug_defs="" +]) +AC_SUBST([debug_defs]) + +AC_MSG_CHECKING(for --enable-asan) +AC_ARG_ENABLE(asan, AS_HELP_STRING([--enable-asan], [Enable gcc address sanitizer options (default: no)]), +[ + AC_MSG_RESULT(yes) + asan_defs="-fsanitize=address -fno-omit-frame-pointer" +], +[ + AC_MSG_RESULT(no) + asan_defs="" +]) +AC_SUBST([asan_defs]) + AC_SUBST([NSPR_CFLAGS]) AC_SUBST([NSPR_LIBS]) AC_SUBST([NSPR_MIN_VER]) diff --git a/src/Makefile.am b/src/Makefile.am index 5e8d97726..fba358366 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,9 @@ +ASAN_DEFINES = @asan_defs@ +DEBUG_DEFINES = @debug_defs@ + +AM_CPPFLAGS = $(ASAN_DEFINES) $(DEBUG_DEFINES) +AM_LDFLAGS = $(ASAN_DEFINES) $(DEBUG_DEFINES) + EXTRA_DIST = key.ico \ logo.ico \ manifest.mn \
0
a468073b669918666b3626456c7fcef2bc5ad461
389ds/389-ds-base
Security fix for CVE-2024-6237 Description: A flaw was found in the 389 Directory Server. This flaw allows an unauthenticated user to cause a systematic server crash while sending a specific extended search request, leading to a denial of service. Fix Description: Add missing parameter to `slapi_log_err` function call. References: - https://nvd.nist.gov/vuln/detail/CVE-2024-6237 - https://access.redhat.com/security/cve/CVE-2024-6237 - https://bugzilla.redhat.com/show_bug.cgi?id=2293579 - https://github.com/389ds/389-ds-base/issues/5989
commit a468073b669918666b3626456c7fcef2bc5ad461 Author: Thierry Bordaz <[email protected]> Date: Mon Jun 24 15:51:28 2024 +0200 Security fix for CVE-2024-6237 Description: A flaw was found in the 389 Directory Server. This flaw allows an unauthenticated user to cause a systematic server crash while sending a specific extended search request, leading to a denial of service. Fix Description: Add missing parameter to `slapi_log_err` function call. References: - https://nvd.nist.gov/vuln/detail/CVE-2024-6237 - https://access.redhat.com/security/cve/CVE-2024-6237 - https://bugzilla.redhat.com/show_bug.cgi?id=2293579 - https://github.com/389ds/389-ds-base/issues/5989 diff --git a/ldap/servers/plugins/syntaxes/inchain.c b/ldap/servers/plugins/syntaxes/inchain.c index df19c973b..0a6a04e9f 100644 --- a/ldap/servers/plugins/syntaxes/inchain.c +++ b/ldap/servers/plugins/syntaxes/inchain.c @@ -277,7 +277,7 @@ inchain_values2keys(Slapi_PBlock *pb, Slapi_Value **vals, Slapi_Value ***ivals, slapi_pblock_get(pb, SLAPI_SEARCH_TARGET_SDN, &base_sdn); if (! slapi_attr_is_dn_syntax_type(mrTYPE)) { - slapi_log_err(SLAPI_LOG_ERR, "inchain", "Requires distinguishedName syntax. AttributeDescription %s is not distinguishedName\n"); + slapi_log_err(SLAPI_LOG_ERR, "inchain", "Requires distinguishedName syntax. AttributeDescription %s is not distinguishedName\n", mrTYPE); result = (Slapi_Value **)slapi_ch_calloc(1, sizeof(Slapi_Value *)); *ivals = result; return(0);
0
c35b2451f5ec6c56384c1596b860975ca5d0a120
389ds/389-ds-base
Fix Windows SSL replication in-order processing of operatations
commit c35b2451f5ec6c56384c1596b860975ca5d0a120 Author: David Boreham <[email protected]> Date: Thu May 12 03:43:15 2005 +0000 Fix Windows SSL replication in-order processing of operatations diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c index e7a852435..b0fc7e056 100644 --- a/ldap/servers/slapd/connection.c +++ b/ldap/servers/slapd/connection.c @@ -64,6 +64,7 @@ static void op_copy_identity(Connection *conn, Operation *op); static int is_ber_too_big(const Connection *conn,unsigned long ber_len); static void log_ber_too_big_error(const Connection *conn, unsigned long ber_len, unsigned long maxbersize); +static int add_to_select_set(Connection *conn); /* * We maintain a global work queue of Slapi_PBlock's that have not yet @@ -765,7 +766,12 @@ static int handle_read_data(Connection *conn,Operation **op, if (replication_session) { /* Initiate any deferred I/O here */ if (defer_io) { - return_value2 = issue_new_read(conn); + if (conn->c_flags & CONN_FLAG_SSL) { + add_to_select_set(conn); + return_value2 = 0; + } else { + return_value2 = issue_new_read(conn); + } } if (defer_pushback) { return_value2 = queue_pushed_back_data(conn); @@ -1152,7 +1158,11 @@ static int read_the_data(Connection *conn, int *process_op, int *defer_io, int * priv->c_current_op = NULL; priv->c_flags = 0; return_value = 0; - add_to_select_set(conn); + if (!conn->c_isreplication_session) { + add_to_select_set(conn); + } else { + *defer_io = 1; + } } return return_value;
0
410d3bb916c50cc7d8b609995278a30825981b3b
389ds/389-ds-base
Ticket 50128 - NS Stress fails without ipv6 Bug Description: Docker for osx doesn't support ipv6, which means that in ipv4 only environments this test fails. We aren't trying to test ipv4/ipv6 here, only that NS handles load, so swapping to ipv4 is not a change to the test Fix Description: Change the PR_AF_INET6 to PR_AF_INET https://pagure.io/389-ds-base/issue/50128 Author: William Brown <[email protected]> Review by: ???
commit 410d3bb916c50cc7d8b609995278a30825981b3b Author: William Brown <[email protected]> Date: Tue Jan 8 12:17:30 2019 +1000 Ticket 50128 - NS Stress fails without ipv6 Bug Description: Docker for osx doesn't support ipv6, which means that in ipv4 only environments this test fails. We aren't trying to test ipv4/ipv6 here, only that NS handles load, so swapping to ipv4 is not a change to the test Fix Description: Change the PR_AF_INET6 to PR_AF_INET https://pagure.io/389-ds-base/issue/50128 Author: William Brown <[email protected]> Review by: ??? diff --git a/src/nunc-stans/test/test_nuncstans_stress_core.c b/src/nunc-stans/test/test_nuncstans_stress_core.c index ae6c4a36f..0b8454026 100644 --- a/src/nunc-stans/test/test_nuncstans_stress_core.c +++ b/src/nunc-stans/test/test_nuncstans_stress_core.c @@ -352,7 +352,7 @@ client_initiate_connection_cb(struct ns_job_t *job) PRNetAddr netaddr = {{0}}; char *data = "this is a test!\n"; - sock = PR_OpenTCPSocket(PR_AF_INET6); + sock = PR_OpenTCPSocket(PR_AF_INET); if (sock == NULL) { char *err = NULL; PR_GetErrorText(err); @@ -361,7 +361,7 @@ client_initiate_connection_cb(struct ns_job_t *job) goto done; } - PR_SetNetAddr(PR_IpAddrLoopback, PR_AF_INET6, 12345, &netaddr); + PR_SetNetAddr(PR_IpAddrLoopback, PR_AF_INET, 12345, &netaddr); /* Connect */ /* */ @@ -459,7 +459,7 @@ ns_stress_test(void **state) PRNetAddr netaddr; PRSocketOptionData prsod = {PR_SockOpt_Nonblocking, {PR_TRUE}}; - PR_SetNetAddr(PR_IpAddrAny, PR_AF_INET6, 12345, &netaddr); + PR_SetNetAddr(PR_IpAddrAny, PR_AF_INET, 12345, &netaddr); listenfd = PR_OpenTCPSocket(PR_NetAddrFamily(&netaddr)); PR_SetSocketOption(listenfd, &prsod);
0
1c0c6b135ae8a54ef6d0ccff0eb797b9b32a66fa
389ds/389-ds-base
Ticket #565 - turbo mode and replication - allow disable of turbo mode https://fedorahosted.org/389/ticket/565 Reviewed by: mreynolds (Thanks!) Branch: master Fix Description: Add nsslapd-enable-turbo-mode configuration attribute. This allows the user to disable turbo mode. The default for this setting is on. Platforms tested: RHEL6 x86_64 Flag Day: no Doc impact: yes - document new config parameter
commit 1c0c6b135ae8a54ef6d0ccff0eb797b9b32a66fa Author: Rich Megginson <[email protected]> Date: Wed Feb 13 07:18:27 2013 -0700 Ticket #565 - turbo mode and replication - allow disable of turbo mode https://fedorahosted.org/389/ticket/565 Reviewed by: mreynolds (Thanks!) Branch: master Fix Description: Add nsslapd-enable-turbo-mode configuration attribute. This allows the user to disable turbo mode. The default for this setting is on. Platforms tested: RHEL6 x86_64 Flag Day: no Doc impact: yes - document new config parameter diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c index 7750bfe2e..26ac20b6b 100644 --- a/ldap/servers/slapd/connection.c +++ b/ldap/servers/slapd/connection.c @@ -2253,12 +2253,16 @@ connection_threadmain() #if defined(DB_PERF_TURBO) /* If it's been a while since we last did it ... */ if (curtime - conn->c_private->previous_count_check_time > CONN_TURBO_CHECK_INTERVAL) { - int new_turbo_flag = 0; - /* Check the connection's activity level */ - connection_check_activity_level(conn); - /* And if appropriate, change into or out of turbo mode */ - connection_enter_leave_turbo(conn,thread_turbo_flag,&new_turbo_flag); - thread_turbo_flag = new_turbo_flag; + if (config_get_enable_turbo_mode()) { + int new_turbo_flag = 0; + /* Check the connection's activity level */ + connection_check_activity_level(conn); + /* And if appropriate, change into or out of turbo mode */ + connection_enter_leave_turbo(conn,thread_turbo_flag,&new_turbo_flag); + thread_turbo_flag = new_turbo_flag; + } else { + thread_turbo_flag = 0; + } } /* turn off turbo mode immediately if any pb waiting in global queue */ diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c index b7bc99975..fbbb4f966 100644 --- a/ldap/servers/slapd/libglobs.c +++ b/ldap/servers/slapd/libglobs.c @@ -256,6 +256,7 @@ slapi_onoff_t init_disk_preserve_logging; slapi_onoff_t init_ndn_cache_enabled; slapi_onoff_t init_sasl_mapping_fallback; slapi_onoff_t init_return_orig_type; +slapi_onoff_t init_enable_turbo_mode; #ifdef MEMPOOL_EXPERIMENTAL slapi_onoff_t init_mempool_switch; #endif @@ -1043,7 +1044,11 @@ static struct config_get_and_set { {CONFIG_SEARCH_RETURN_ORIGINAL_TYPE, config_set_return_orig_type_switch, NULL, 0, (void**)&global_slapdFrontendConfig.return_orig_type, - CONFIG_ON_OFF, (ConfigGetFunc)config_get_return_orig_type_switch, &init_return_orig_type} + CONFIG_ON_OFF, (ConfigGetFunc)config_get_return_orig_type_switch, &init_return_orig_type}, + {CONFIG_ENABLE_TURBO_MODE, config_set_enable_turbo_mode, + NULL, 0, + (void**)&global_slapdFrontendConfig.enable_turbo_mode, + CONFIG_ON_OFF, (ConfigGetFunc)config_get_enable_turbo_mode, &init_enable_turbo_mode} #ifdef MEMPOOL_EXPERIMENTAL ,{CONFIG_MEMPOOL_SWITCH_ATTRIBUTE, config_set_mempool_switch, NULL, 0, @@ -1478,6 +1483,7 @@ FrontendConfig_init () { cfg->sasl_max_bufsize = SLAPD_DEFAULT_SASL_MAXBUFSIZE; cfg->unhashed_pw_switch = SLAPD_UNHASHED_PW_ON; init_return_orig_type = cfg->return_orig_type = LDAP_OFF; + init_enable_turbo_mode = cfg->enable_turbo_mode = LDAP_ON; #ifdef MEMPOOL_EXPERIMENTAL init_mempool_switch = cfg->mempool_switch = LDAP_ON; @@ -6886,6 +6892,19 @@ config_set_unhashed_pw_switch(const char *attrname, char *value, } CFG_UNLOCK_WRITE(slapdFrontendConfig); + + return retVal; +} + +int +config_get_enable_turbo_mode(void) +{ + int retVal; + slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); + CFG_ONOFF_LOCK_READ(slapdFrontendConfig); + retVal = (int)slapdFrontendConfig->enable_turbo_mode; + CFG_ONOFF_UNLOCK_READ(slapdFrontendConfig); + return retVal; } @@ -6907,6 +6926,19 @@ config_get_unhashed_pw_switch() return retVal; } +int +config_set_enable_turbo_mode( const char *attrname, char *value, + char *errorbuf, int apply ) +{ + int retVal = LDAP_SUCCESS; + slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); + + retVal = config_set_onoff(attrname, value, + &(slapdFrontendConfig->enable_turbo_mode), + errorbuf, apply); + return retVal; +} + /* * This function is intended to be used from the dse code modify callback. It * is "optimized" for that case because it takes a berval** of values, which is diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h index 53d356994..4077daa89 100644 --- a/ldap/servers/slapd/proto-slap.h +++ b/ldap/servers/slapd/proto-slap.h @@ -567,6 +567,8 @@ int config_set_sasl_mapping_fallback(const char *attrname, char *value, char *er int config_get_sasl_mapping_fallback(); int config_get_unhashed_pw_switch(); int config_get_sasl_maxbufsize(); +int config_get_enable_turbo_mode(); +int config_set_enable_turbo_mode(const char *attrname, char *value, char *errorbuf, int apply); PLHashNumber hashNocaseString(const void *key); PRIntn hashNocaseCompare(const void *v1, const void *v2); diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h index a19e19201..c8381da7c 100644 --- a/ldap/servers/slapd/slap.h +++ b/ldap/servers/slapd/slap.h @@ -2075,6 +2075,7 @@ typedef struct _slapdEntryPoints { #define CONFIG_SASL_MAPPING_FALLBACK "nsslapd-sasl-mapping-fallback" #define CONFIG_SASL_MAXBUFSIZE "nsslapd-sasl-max-buffer-size" #define CONFIG_SEARCH_RETURN_ORIGINAL_TYPE "nsslapd-search-return-original-type-switch" +#define CONFIG_ENABLE_TURBO_MODE "nsslapd-enable-turbo-mode" #ifdef MEMPOOL_EXPERIMENTAL #define CONFIG_MEMPOOL_SWITCH_ATTRIBUTE "nsslapd-mempool" @@ -2317,6 +2318,7 @@ typedef struct _slapdFrontendConfig { Slapi_Counter *ignore_vattrs; Slapi_Counter *sasl_mapping_fallback; slapi_onoff_t unhashed_pw_switch; /* switch to on/off/nolog unhashed pw */ + slapi_onoff_t enable_turbo_mode; } slapdFrontendConfig_t; /* possible values for slapdFrontendConfig_t.schemareplace */
0
a95889def41d3869692d7259a9213b1f9238f3c8
389ds/389-ds-base
Issue 49122 - Filtered nsrole that uses nsrole crashes the server Bug Description: When evaluating a filter role that uses "nsrole" in the filter crashes the server due infinite loop that leads to a stack overflow. Fix Description: Virtual attributes are not allowed to be used in role filters. We were already checking for COS attributes, but not nsrole. Also did some minor code cleanup https://pagure.io/389-ds-base/issue/49122 Reviewed by: nhosoi(Thanks!)
commit a95889def41d3869692d7259a9213b1f9238f3c8 Author: Mark Reynolds <[email protected]> Date: Mon Feb 27 07:59:30 2017 -0500 Issue 49122 - Filtered nsrole that uses nsrole crashes the server Bug Description: When evaluating a filter role that uses "nsrole" in the filter crashes the server due infinite loop that leads to a stack overflow. Fix Description: Virtual attributes are not allowed to be used in role filters. We were already checking for COS attributes, but not nsrole. Also did some minor code cleanup https://pagure.io/389-ds-base/issue/49122 Reviewed by: nhosoi(Thanks!) diff --git a/dirsrvtests/tests/tickets/ticket49122_test.py b/dirsrvtests/tests/tickets/ticket49122_test.py new file mode 100644 index 000000000..bd553f2e4 --- /dev/null +++ b/dirsrvtests/tests/tickets/ticket49122_test.py @@ -0,0 +1,73 @@ +import time +import ldap +import logging +import pytest +from lib389 import DirSrv, Entry, tools, tasks +from lib389.tools import DirSrvTools +from lib389._constants import * +from lib389.properties import * +from lib389.tasks import * +from lib389.utils import * +from lib389.topologies import topology_st as topo + +DEBUGGING = os.getenv("DEBUGGING", default=False) +if DEBUGGING: + logging.getLogger(__name__).setLevel(logging.DEBUG) +else: + logging.getLogger(__name__).setLevel(logging.INFO) +log = logging.getLogger(__name__) + +USER_DN = 'uid=user,' + DEFAULT_SUFFIX +ROLE_DN = 'cn=Filtered_Role_That_Includes_Empty_Role,' + DEFAULT_SUFFIX + + +def test_ticket49122(topo): + """Search for non-existant role and make sure the server does not crash + """ + + # Enable roles plugin + topo.standalone.plugins.enable(name=PLUGIN_ROLES) + topo.standalone.restart() + + # Add invalid role + try: + topo.standalone.add_s(Entry(( + ROLE_DN, {'objectclass': ['top', 'ldapsubentry', 'nsroledefinition', + 'nscomplexroledefinition', 'nsfilteredroledefinition'], + 'cn': 'Filtered_Role_That_Includes_Empty_Role', + 'nsRoleFilter': '(!(nsrole=cn=This_Is_An_Empty_Managed_NsRoleDefinition,dc=example,dc=com))', + 'description': 'A filtered role with filter that will crash the server'}))) + except ldap.LDAPError as e: + topo.standalone.log.fatal('Failed to add filtered role: error ' + e.message['desc']) + assert False + + # Add test user + try: + topo.standalone.add_s(Entry(( + USER_DN, {'objectclass': "top extensibleObject".split(), + 'uid': 'user'}))) + except ldap.LDAPError as e: + topo.standalone.log.fatal('Failed to add test user: error ' + str(e)) + assert False + + if DEBUGGING: + # Add debugging steps(if any)... + print "Attach gdb" + time.sleep(20) + + # Search for the role + try: + topo.standalone.search_s(USER_DN, ldap.SCOPE_SUBTREE, 'objectclass=*', ['nsrole']) + except ldap.LDAPError as e: + topo.standalone.log.fatal('Search failed: error ' + str(e)) + assert False + + topo.standalone.log.info('Test Passed') + + +if __name__ == '__main__': + # Run isolated + # -s for DEBUG mode + CURRENT_FILE = os.path.realpath(__file__) + pytest.main("-s %s" % CURRENT_FILE) + diff --git a/ldap/servers/plugins/roles/roles_cache.c b/ldap/servers/plugins/roles/roles_cache.c index b7303de8a..4f27c4c0d 100644 --- a/ldap/servers/plugins/roles/roles_cache.c +++ b/ldap/servers/plugins/roles/roles_cache.c @@ -1072,6 +1072,26 @@ static int roles_cache_create_role_under(roles_cache_def** roles_cache_suffix, S return(rc); } +/* + * Check that we are not using nsrole in the filter + */ +static int roles_check_filter(Slapi_Filter *filter_list) +{ + Slapi_Filter *f; + char *type = NULL; + + for ( f = slapi_filter_list_first( filter_list ); + f != NULL; + f = slapi_filter_list_next( filter_list, f ) ) + { + slapi_filter_get_attribute_type(f, &type); + if (strcasecmp(type, NSROLEATTR) == 0){ + return -1; + } + } + + return 0; +} /* roles_cache_create_object_from_entry ------------------------------------ @@ -1087,17 +1107,17 @@ static int roles_cache_create_object_from_entry(Slapi_Entry *role_entry, role_ob int rc = 0; int type = 0; role_object *this_role = NULL; - char *rolescopeDN = NULL; + char *rolescopeDN = NULL; slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_create_object_from_entry\n"); - *result = NULL; + *result = NULL; - /* Do not allow circular dependencies */ - if ( hint > MAX_NESTED_ROLES ) + /* Do not allow circular dependencies */ + if ( hint > MAX_NESTED_ROLES ) { - char *ndn = NULL; + char *ndn = NULL; ndn = slapi_entry_get_ndn( role_entry ); slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, @@ -1108,85 +1128,83 @@ static int roles_cache_create_object_from_entry(Slapi_Entry *role_entry, role_ob return (0); } - /* Create the role cache definition */ - this_role = (role_object*)slapi_ch_calloc(1, sizeof(role_object)); - if (this_role == NULL ) + /* Create the role cache definition */ + this_role = (role_object*)slapi_ch_calloc(1, sizeof(role_object)); + if (this_role == NULL ) { - return ENOMEM; - } + return ENOMEM; + } - /* Check the entry is OK */ - /* Determine role type and assign to structure */ - /* We determine the role type by reading the objectclass */ + /* Check the entry is OK */ + /* Determine role type and assign to structure */ + /* We determine the role type by reading the objectclass */ if ( roles_cache_is_role_entry(role_entry) == 0 ) { - /* Bad type */ - slapi_ch_free((void**)&this_role); - return SLAPI_ROLE_DEFINITION_ERROR; - } + /* Bad type */ + slapi_ch_free((void**)&this_role); + return SLAPI_ROLE_DEFINITION_ERROR; + } - type = roles_cache_determine_class(role_entry); + type = roles_cache_determine_class(role_entry); - if (type != 0) + if (type != 0) { - this_role->type = type; - } + this_role->type = type; + } else { - /* Bad type */ - slapi_ch_free((void**)&this_role); - return SLAPI_ROLE_DEFINITION_ERROR; - } + /* Bad type */ + slapi_ch_free((void**)&this_role); + return SLAPI_ROLE_DEFINITION_ERROR; + } this_role->dn = slapi_sdn_new(); slapi_sdn_copy(slapi_entry_get_sdn(role_entry),this_role->dn); - - rolescopeDN = slapi_entry_attr_get_charptr(role_entry, ROLE_SCOPE_DN); - if (rolescopeDN) { - Slapi_DN *rolescopeSDN; - Slapi_DN *top_rolescopeSDN, *top_this_roleSDN; - - /* Before accepting to use this scope, first check if it belongs to the same suffix */ - rolescopeSDN = slapi_sdn_new_dn_byref(rolescopeDN); - if ((strlen((char *) slapi_sdn_get_ndn(rolescopeSDN)) > 0) && - (slapi_dn_syntax_check(NULL, (char *) slapi_sdn_get_ndn(rolescopeSDN), 1) == 0)) { - top_rolescopeSDN = roles_cache_get_top_suffix(rolescopeSDN); - top_this_roleSDN = roles_cache_get_top_suffix(this_role->dn); - if (slapi_sdn_compare(top_rolescopeSDN, top_this_roleSDN) == 0) { - /* rolescopeDN belongs to the same suffix as the role, we can use this scope */ - this_role->rolescopedn = rolescopeSDN; - } else { - slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, - "roles_cache_create_object_from_entry - %s: invalid %s - %s not in the same suffix. Scope skipped.\n", - (char*) slapi_sdn_get_dn(this_role->dn), - ROLE_SCOPE_DN, - rolescopeDN); - slapi_sdn_free(&rolescopeSDN); - } - slapi_sdn_free(&top_rolescopeSDN); - slapi_sdn_free(&top_this_roleSDN); - } else { - /* this is an invalid DN, just ignore this parameter*/ - slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, - "roles_cache_create_object_from_entry - %s: invalid %s - %s not a valid DN. Scope skipped.\n", - (char*) slapi_sdn_get_dn(this_role->dn), - ROLE_SCOPE_DN, - rolescopeDN); - slapi_sdn_free(&rolescopeSDN); - } - } + + rolescopeDN = slapi_entry_attr_get_charptr(role_entry, ROLE_SCOPE_DN); + if (rolescopeDN) { + Slapi_DN *rolescopeSDN; + Slapi_DN *top_rolescopeSDN, *top_this_roleSDN; + + /* Before accepting to use this scope, first check if it belongs to the same suffix */ + rolescopeSDN = slapi_sdn_new_dn_byref(rolescopeDN); + if ((strlen((char *) slapi_sdn_get_ndn(rolescopeSDN)) > 0) && + (slapi_dn_syntax_check(NULL, (char *) slapi_sdn_get_ndn(rolescopeSDN), 1) == 0)) { + top_rolescopeSDN = roles_cache_get_top_suffix(rolescopeSDN); + top_this_roleSDN = roles_cache_get_top_suffix(this_role->dn); + if (slapi_sdn_compare(top_rolescopeSDN, top_this_roleSDN) == 0) { + /* rolescopeDN belongs to the same suffix as the role, we can use this scope */ + this_role->rolescopedn = rolescopeSDN; + } else { + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + "roles_cache_create_object_from_entry - %s: invalid %s - %s not in the same suffix. Scope skipped.\n", + (char*) slapi_sdn_get_dn(this_role->dn), + ROLE_SCOPE_DN, + rolescopeDN); + slapi_sdn_free(&rolescopeSDN); + } + slapi_sdn_free(&top_rolescopeSDN); + slapi_sdn_free(&top_this_roleSDN); + } else { + /* this is an invalid DN, just ignore this parameter*/ + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + "roles_cache_create_object_from_entry - %s: invalid %s - %s not a valid DN. Scope skipped.\n", + (char*) slapi_sdn_get_dn(this_role->dn), + ROLE_SCOPE_DN, + rolescopeDN); + slapi_sdn_free(&rolescopeSDN); + } + } - /* Depending upon role type, pull out the remaining information we need */ + /* Depending upon role type, pull out the remaining information we need */ switch (this_role->type) { case ROLE_TYPE_MANAGED: - /* Nothing further needed */ break; case ROLE_TYPE_FILTERED: { - Slapi_Filter *filter = NULL; char *filter_attr_value = NULL; Slapi_PBlock *pb = NULL; @@ -1200,6 +1218,7 @@ static int roles_cache_create_object_from_entry(Slapi_Entry *role_entry, role_ob slapi_ch_free((void**)&this_role); return SLAPI_ROLE_ERROR_NO_FILTER_SPECIFIED; } + /* search (&(objectclass=costemplate)(filter_attr_value))*/ /* if found, reject it (returning SLAPI_ROLE_ERROR_FILTER_BAD) */ pb = slapi_pblock_new(); @@ -1208,33 +1227,33 @@ static int roles_cache_create_object_from_entry(Slapi_Entry *role_entry, role_ob Slapi_Entry **cosentries = NULL; char *costmpl_filter = NULL; if ((*filter_attr_value == '(') && - (*(filter_attr_value+strlen(filter_attr_value)-1) == ')')) { + (*(filter_attr_value+strlen(filter_attr_value)-1) == ')')) { costmpl_filter = - slapi_ch_smprintf("(&(objectclass=costemplate)%s)", - filter_attr_value); + slapi_ch_smprintf("(&(objectclass=costemplate)%s)", + filter_attr_value); } else { costmpl_filter = - slapi_ch_smprintf("(&(objectclass=costemplate)(%s))", - filter_attr_value); + slapi_ch_smprintf("(&(objectclass=costemplate)(%s))", + filter_attr_value); } slapi_search_internal_set_pb(pb, parent, LDAP_SCOPE_SUBTREE, - costmpl_filter, NULL, 0, NULL, - NULL, roles_get_plugin_identity(), - 0); + costmpl_filter, NULL, 0, NULL, + NULL, roles_get_plugin_identity(), + 0); slapi_search_internal_pb(pb); slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, - &cosentries); + &cosentries); slapi_ch_free_string(&costmpl_filter); slapi_ch_free_string(&parent); if (cosentries && *cosentries) { slapi_free_search_results_internal(pb); slapi_pblock_destroy(pb); slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, - "roles_cache_create_object_from_entry - %s: not allowed to refer virtual attribute " - "in the value of %s %s. The %s is disabled.\n", - (char*)slapi_sdn_get_ndn(this_role->dn), - ROLE_FILTER_ATTR_NAME, filter_attr_value, - ROLE_FILTER_ATTR_NAME); + "roles_cache_create_object_from_entry - %s: not allowed to refer virtual attribute " + "in the value of %s %s. The %s is disabled.\n", + (char*)slapi_sdn_get_ndn(this_role->dn), + ROLE_FILTER_ATTR_NAME, filter_attr_value, + ROLE_FILTER_ATTR_NAME); slapi_ch_free_string(&filter_attr_value); slapi_ch_free((void**)&this_role); return SLAPI_ROLE_ERROR_FILTER_BAD; @@ -1245,16 +1264,27 @@ static int roles_cache_create_object_from_entry(Slapi_Entry *role_entry, role_ob /* Turn it into a slapi filter object */ filter = slapi_str2filter(filter_attr_value); - slapi_ch_free_string(&filter_attr_value); - - if ( filter == NULL ) + if ( filter == NULL ) { /* An error has occured */ slapi_ch_free((void**)&this_role); + slapi_ch_free_string(&filter_attr_value); + return SLAPI_ROLE_ERROR_FILTER_BAD; + } + if (roles_check_filter(filter)) { + slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, + "roles_cache_create_object_from_entry - \"%s\": not allowed to use \"nsrole\" " + "in the role filter \"%s\". %s is disabled.\n", + (char*)slapi_sdn_get_ndn(this_role->dn), + filter_attr_value, + ROLE_FILTER_ATTR_NAME); + slapi_ch_free((void**)&this_role); + slapi_ch_free_string(&filter_attr_value); return SLAPI_ROLE_ERROR_FILTER_BAD; } /* Store on the object */ this_role->filter = filter; + slapi_ch_free_string(&filter_attr_value); break; } @@ -1273,50 +1303,49 @@ static int roles_cache_create_object_from_entry(Slapi_Entry *role_entry, role_ob int i = 0; char *string = NULL; Slapi_DN nested_role_dn; - role_object_nested *nested_role_object = NULL; + role_object_nested *nested_role_object = NULL; - for ( i = 0; va[i] != NULL; i++ ) + for ( i = 0; va[i] != NULL; i++ ) { - string = (char*)slapi_value_get_string(va[i]); + string = (char*)slapi_value_get_string(va[i]); - /* Make a DN from the string */ - slapi_sdn_init_dn_byref(&nested_role_dn,string); + /* Make a DN from the string */ + slapi_sdn_init_dn_byref(&nested_role_dn,string); slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "roles_cache_create_object_from_entry - dn %s, nested %s\n", (char*)slapi_sdn_get_ndn(this_role->dn),string); - /* Make a role object nested from the DN */ - rc = roles_cache_object_nested_from_dn(&nested_role_dn,&nested_role_object); + /* Make a role object nested from the DN */ + rc = roles_cache_object_nested_from_dn(&nested_role_dn,&nested_role_object); - /* Insert it into the nested list */ - if ( (rc == 0) && nested_role_object) + /* Insert it into the nested list */ + if ( (rc == 0) && nested_role_object) { /* Add to the tree where avl_data is a role_object_nested struct */ - rc = roles_cache_insert_object_nested(&(this_role->avl_tree),nested_role_object); - } - slapi_sdn_done(&nested_role_dn); - } - } - + rc = roles_cache_insert_object_nested(&(this_role->avl_tree),nested_role_object); + } + slapi_sdn_done(&nested_role_dn); + } + } + break; } default: slapi_log_err(SLAPI_LOG_ERR, ROLES_PLUGIN_SUBSYSTEM, - "roles_cache_create_object_from_entry - wrong role type\n"); + "roles_cache_create_object_from_entry - wrong role type\n"); } - if ( rc == 0 ) + if ( rc == 0 ) { - *result = this_role; - } + *result = this_role; + } slapi_log_err(SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, - "<-- roles_cache_create_object_from_entry\n"); - + "<-- roles_cache_create_object_from_entry\n"); - return rc; + return rc; } /* roles_cache_determine_class:
0
0394b2bb9cae3016eeb975ed194e8c7258ed868b
389ds/389-ds-base
Ticket 47513 - tmpfiles.d references /var/lock when they should reference /run/lock The previous patch was using numeric comparison instead of string comparison to check if localrundir was empty. This was causing our tmpfiles.d configuration to use the settings from the inf file, which evaluates to /var/run when using --with-fhs. This patch uses a proper string comparison which results in using /run in the tmpfiles.d config as desired.
commit 0394b2bb9cae3016eeb975ed194e8c7258ed868b Author: Nathan Kinder <[email protected]> Date: Thu Oct 10 16:50:51 2013 -0700 Ticket 47513 - tmpfiles.d references /var/lock when they should reference /run/lock The previous patch was using numeric comparison instead of string comparison to check if localrundir was empty. This was causing our tmpfiles.d configuration to use the settings from the inf file, which evaluates to /var/run when using --with-fhs. This patch uses a proper string comparison which results in using /run in the tmpfiles.d config as desired. diff --git a/ldap/admin/src/scripts/DSCreate.pm.in b/ldap/admin/src/scripts/DSCreate.pm.in index fd1941be6..58408c17f 100644 --- a/ldap/admin/src/scripts/DSCreate.pm.in +++ b/ldap/admin/src/scripts/DSCreate.pm.in @@ -1104,7 +1104,7 @@ sub updateTmpfilesDotD { # d /var/run/user 0755 root root 10d # we don't use age my $localrundir = set_localrundir("@localrundir@", $inf->{General}->{prefix}); - if( $localrundir != "" && -d "$localrundir"){ + if( $localrundir ne "" && -d "$localrundir"){ $rundir = "$localrundir/@PACKAGE_NAME@"; $lockdir = "$localrundir/lock/@PACKAGE_NAME@/slapd-$inf->{slapd}->{ServerIdentifier}"; $parentdir = "$localrundir/lock/@PACKAGE_NAME@";
0
6aa7a6d5bf8b1d774087e8a5d0e147f4c636a7ad
389ds/389-ds-base
Issue 5413 - Allow mutliple MemberOf fixup tasks with different bases/filters Description: A change was made to only allow a single fixup task at a time, but there are cases where you would want to run mutliple tasks but on different branches/filters. Now we maintain a linked list of bases/filters of the current running tasks to monitor this. relates: https://github.com/389ds/389-ds-base/issues/5413 Reviewed by: tbordaz(Thanks!)
commit 6aa7a6d5bf8b1d774087e8a5d0e147f4c636a7ad Author: Mark Reynolds <[email protected]> Date: Tue Dec 13 09:41:34 2022 -0500 Issue 5413 - Allow mutliple MemberOf fixup tasks with different bases/filters Description: A change was made to only allow a single fixup task at a time, but there are cases where you would want to run mutliple tasks but on different branches/filters. Now we maintain a linked list of bases/filters of the current running tasks to monitor this. relates: https://github.com/389ds/389-ds-base/issues/5413 Reviewed by: tbordaz(Thanks!) diff --git a/dirsrvtests/tests/suites/memberof_plugin/fixup_test.py b/dirsrvtests/tests/suites/memberof_plugin/fixup_test.py index 7681cdc58..5aac40d2b 100644 --- a/dirsrvtests/tests/suites/memberof_plugin/fixup_test.py +++ b/dirsrvtests/tests/suites/memberof_plugin/fixup_test.py @@ -67,12 +67,15 @@ def test_fixup_task_limit(topo): with pytest.raises(ldap.UNWILLING_TO_PERFORM): memberof.fixup(DEFAULT_SUFFIX) + # Add second task but on different suffix which should be allowed + memberof.fixup("ou=people," + DEFAULT_SUFFIX) + # Wait for first task to complete task.wait() # Add new task which should be allowed now memberof.fixup(DEFAULT_SUFFIX) - + if __name__ == '__main__': # Run isolated diff --git a/ldap/servers/plugins/memberof/memberof.c b/ldap/servers/plugins/memberof/memberof.c index 0b8cfe95c..a14617044 100644 --- a/ldap/servers/plugins/memberof/memberof.c +++ b/ldap/servers/plugins/memberof/memberof.c @@ -52,7 +52,6 @@ static Slapi_DN* _pluginDN = NULL; MemberOfConfig *qsortConfig = 0; static int usetxn = 0; static int premodfn = 0; -static PRBool fixup_running = PR_FALSE; static PRLock *fixup_lock = NULL; static int32_t fixup_progress_count = 0; static int64_t fixup_progress_elapsed = 0; @@ -65,6 +64,15 @@ typedef struct _memberofstringll void *next; } memberofstringll; +typedef struct _fixup_ll +{ + Slapi_DN *sdn; + char *filter_str; + void *next; +} mo_fixup_ll; + +static mo_fixup_ll *fixup_list = NULL; + typedef struct _memberof_get_groups_data { MemberOfConfig *config; @@ -438,6 +446,15 @@ memberof_postop_close(Slapi_PBlock *pb __attribute__((unused))) PR_DestroyLock(fixup_lock); fixup_lock = NULL; + mo_fixup_ll *fixup_task = fixup_list; + while (fixup_task != NULL) { + mo_fixup_ll *tmp = fixup_task; + fixup_task = fixup_task->next; + slapi_sdn_free(&tmp->sdn); + slapi_ch_free_string(&tmp->filter_str); + slapi_ch_free((void**)&tmp); + } + slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "<-- memberof_postop_close\n"); return 0; @@ -2817,7 +2834,6 @@ memberof_fixup_task_thread(void *arg) } PR_Lock(fixup_lock); - fixup_running = PR_TRUE; fixup_progress_count = 0; fixup_progress_elapsed = slapi_current_rel_time_t(); fixup_start_time = slapi_current_rel_time_t(); @@ -2849,11 +2865,10 @@ memberof_fixup_task_thread(void *arg) /* Mark this as a task operation */ configCopy.fixup_task = 1; configCopy.task = task; - + Slapi_DN *sdn = slapi_sdn_new_dn_byref(td->dn); if (usetxn) { - Slapi_DN *sdn = slapi_sdn_new_dn_byref(td->dn); Slapi_Backend *be = slapi_be_select_exact(sdn); - slapi_sdn_free(&sdn); + if (be) { fixup_pb = slapi_pblock_new(); slapi_pblock_set(fixup_pb, SLAPI_BACKEND, be); @@ -2894,14 +2909,37 @@ done: fixup_progress_count, slapi_current_rel_time_t() - fixup_start_time); slapi_task_inc_progress(task); + /* Cleanup task linked list */ + PR_Lock(fixup_lock); + mo_fixup_ll *prev = NULL; + for (mo_fixup_ll *curr = fixup_list; curr; curr = curr->next) { + mo_fixup_ll *next = curr->next; + if (slapi_sdn_compare(curr->sdn, sdn) == 0 && + strcasecmp(curr->filter_str, td->filter_str) == 0) + { + /* free current code */ + slapi_sdn_free(&curr->sdn); + slapi_ch_free_string(&curr->filter_str); + slapi_ch_free((void**)&curr); + + /* update linked list */ + if (prev == NULL) { + /* first node */ + fixup_list = next; + } else { + prev->next = next; + } + break; + } + prev = curr; + } + PR_Unlock(fixup_lock); + slapi_sdn_free(&sdn); + /* this will queue the destruction of the task */ slapi_task_finish(task, rc); slapi_task_dec_refcount(task); - PR_Lock(fixup_lock); - fixup_running = PR_FALSE; - PR_Unlock(fixup_lock); - slapi_log_err(SLAPI_LOG_INFO, MEMBEROF_PLUGIN_SUBSYSTEM, "memberof_fixup_task_thread - Memberof task finished (processed %d entries in %ld seconds)\n", fixup_progress_count, slapi_current_rel_time_t() - fixup_start_time); @@ -2919,23 +2957,13 @@ memberof_task_add(Slapi_PBlock *pb, int rv = SLAPI_DSE_CALLBACK_OK; task_data *mytaskdata = NULL; Slapi_Task *task = NULL; + Slapi_DN *sdn = NULL; char *bind_dn; const char *filter; const char *dn = 0; *returncode = LDAP_SUCCESS; - PR_Lock(fixup_lock); - if (fixup_running) { - PR_Unlock(fixup_lock); - *returncode = LDAP_UNWILLING_TO_PERFORM; - slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, - "memberof_task_add - there is already a fixup task running\n"); - rv = SLAPI_DSE_CALLBACK_ERROR; - goto out; - } - PR_Unlock(fixup_lock); - /* get arg(s) */ if ((dn = slapi_entry_attr_get_ref(e, "basedn")) == NULL) { *returncode = LDAP_OBJECT_CLASS_VIOLATION; @@ -2949,6 +2977,39 @@ memberof_task_add(Slapi_PBlock *pb, goto out; } + PR_Lock(fixup_lock); + sdn = slapi_sdn_new_dn_byval(dn); + if (fixup_list == NULL) { + fixup_list = (mo_fixup_ll *)slapi_ch_calloc(1, sizeof(mo_fixup_ll)); + fixup_list->sdn = sdn; + fixup_list->filter_str = slapi_ch_strdup(filter); + } else { + for (mo_fixup_ll *fixup_task = fixup_list; fixup_task; fixup_task = fixup_task->next) { + if (slapi_sdn_compare(sdn, fixup_task->sdn) == 0 && + strcasecmp(filter, fixup_task->filter_str) == 0) + { + /* Found an identical running task, reject it */ + PR_Unlock(fixup_lock); + slapi_log_err(SLAPI_LOG_ERR, MEMBEROF_PLUGIN_SUBSYSTEM, + "memberof_task_add - there is already an identical fixup task running: base: %s filter: %s\n", + slapi_sdn_get_dn(sdn), filter); + slapi_sdn_free(&sdn); + *returncode = LDAP_UNWILLING_TO_PERFORM; + rv = SLAPI_DSE_CALLBACK_ERROR; + goto out; + } + } + /* Add the new task DN to the top of the list */ + mo_fixup_ll *head = fixup_list; + mo_fixup_ll *new_task = (mo_fixup_ll *)slapi_ch_calloc(1, sizeof(mo_fixup_ll)); + new_task->sdn = sdn; + new_task->filter_str = slapi_ch_strdup(filter); + new_task->next = head; + fixup_list = new_task; + } + PR_Unlock(fixup_lock); + + /* setup our task data */ slapi_pblock_get(pb, SLAPI_REQUESTOR_DN, &bind_dn); mytaskdata = (task_data *)slapi_ch_malloc(sizeof(task_data));
0
caa351ae0cc81cbf2309a43c5f74b359cda152d0
389ds/389-ds-base
Bug 1347760 - CVE-2016-4992 389-ds-base: Information disclosure via repeated use of LDAP ADD operation, etc. Description: do not overwrite rc used to decide if bind was successful. When the bind is through ldapi/autobind, an entry does not exist to be checked with slapi_check_account_lock. In that case, a variable rc is not supposed to be modified which confuses the following code path. Reviewed by [email protected].
commit caa351ae0cc81cbf2309a43c5f74b359cda152d0 Author: Ludwig Krispenz <[email protected]> Date: Thu Aug 4 11:45:49 2016 -0700 Bug 1347760 - CVE-2016-4992 389-ds-base: Information disclosure via repeated use of LDAP ADD operation, etc. Description: do not overwrite rc used to decide if bind was successful. When the bind is through ldapi/autobind, an entry does not exist to be checked with slapi_check_account_lock. In that case, a variable rc is not supposed to be modified which confuses the following code path. Reviewed by [email protected]. diff --git a/ldap/servers/slapd/bind.c b/ldap/servers/slapd/bind.c index c2715774f..3054c1ffa 100644 --- a/ldap/servers/slapd/bind.c +++ b/ldap/servers/slapd/bind.c @@ -775,10 +775,12 @@ do_bind( Slapi_PBlock *pb ) */ if (!slapi_be_is_flag_set(be, SLAPI_BE_FLAG_REMOTE_DATA)) { bind_target_entry = get_entry(pb, slapi_sdn_get_ndn(sdn)); - rc = slapi_check_account_lock(pb, bind_target_entry, pw_response_requested, 1, 1); - if (1 == rc) { /* account is locked */ + myrc = slapi_check_account_lock(pb, bind_target_entry, pw_response_requested, 1, 1); + if (1 == myrc) { /* account is locked */ + rc = myrc; goto account_locked; } + myrc = 0; } if (!auto_bind) { /*
0
cf849cc36fd94358c5b024ddfc421d8b42e59dfc
389ds/389-ds-base
Issue 50599 - Fix memory leak when removing db region files Description: An unnecessary flag was set in glob() that was resulting in a memory leak in the DS code. Removing this flag eliminated the leak. relates: https://pagure.io/389-ds-base/issue/50599 Reviewed by:
commit cf849cc36fd94358c5b024ddfc421d8b42e59dfc Author: Mark Reynolds <[email protected]> Date: Thu Jan 16 15:11:34 2020 -0500 Issue 50599 - Fix memory leak when removing db region files Description: An unnecessary flag was set in glob() that was resulting in a memory leak in the DS code. Removing this flag eliminated the leak. relates: https://pagure.io/389-ds-base/issue/50599 Reviewed by: diff --git a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c index a929c8836..167852991 100644 --- a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c +++ b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c @@ -1072,7 +1072,7 @@ bdb_start(struct ldbminfo *li, int dbmode) /* Better wipe out the region files to help ensure a clean start */ PR_snprintf(file_pattern, MAXPATHLEN, "%s/%s", region_dir, "__db.*"); - if (glob(file_pattern, GLOB_DOOFFS, NULL, &globbuf) == 0) { + if (glob(file_pattern, 0, NULL, &globbuf) == 0) { for (size_t i = 0; i < globbuf.gl_pathc; i++) { remove(globbuf.gl_pathv[i]); }
0
958be1271ab440a15649046e7927b44b57a4e19a
389ds/389-ds-base
Ticket 47928 - CI test: added test cases for ticket 47928 Description: test_ticket47928_run_0 - Test Case 13 - No SSL version config parameters test_ticket47928_run_1 - Test Case 14 - No nsSSL3, nsTLS1; sslVersionMin > sslVersionMax test_ticket47928_run_2 - Test Case 15 - nsSSL3: on; sslVersionMin: TLS1.1; sslVersionMax: TLS1.2 test_ticket47928_run_3 - Test Case 16 - nsSSL3: on; nsTLS1: off; sslVersionMin: TLS1.1; sslVersionMax: TLS1.2
commit 958be1271ab440a15649046e7927b44b57a4e19a Author: Noriko Hosoi <[email protected]> Date: Wed Oct 22 17:11:17 2014 -0700 Ticket 47928 - CI test: added test cases for ticket 47928 Description: test_ticket47928_run_0 - Test Case 13 - No SSL version config parameters test_ticket47928_run_1 - Test Case 14 - No nsSSL3, nsTLS1; sslVersionMin > sslVersionMax test_ticket47928_run_2 - Test Case 15 - nsSSL3: on; sslVersionMin: TLS1.1; sslVersionMax: TLS1.2 test_ticket47928_run_3 - Test Case 16 - nsSSL3: on; nsTLS1: off; sslVersionMin: TLS1.1; sslVersionMax: TLS1.2 diff --git a/dirsrvtests/tickets/ticket47838_test.py b/dirsrvtests/tickets/ticket47838_test.py index c98c36ee2..50a4b508d 100644 --- a/dirsrvtests/tickets/ticket47838_test.py +++ b/dirsrvtests/tickets/ticket47838_test.py @@ -201,7 +201,8 @@ def test_ticket47838_init(topology): log.info("\n######################### enable SSL in the directory server with all ciphers ######################\n") topology.standalone.simple_bind_s(DN_DM, PASSWORD) - topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'nsSSL3', 'on'), + topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'nsSSL3', 'off'), + (ldap.MOD_REPLACE, 'nsTLS1', 'on'), (ldap.MOD_REPLACE, 'nsSSLClientAuth', 'allowed'), (ldap.MOD_REPLACE, 'allowWeakCipher', 'on'), (ldap.MOD_REPLACE, 'nsSSL3Ciphers', '+all')]) @@ -645,19 +646,171 @@ def test_ticket47838_run_11(topology): comp_nsSSLEnableCipherCount(topology, 0) +def test_ticket47928_run_0(topology): + """ + No SSL version config parameters. + Check SSL3 (TLS1.0) is off. + """ + _header(topology, 'Test Case 13 - No SSL version config parameters') + + topology.standalone.simple_bind_s(DN_DM, PASSWORD) + # add them once and remove them + topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'nsSSL3', 'off'), + (ldap.MOD_REPLACE, 'nsTLS1', 'on'), + (ldap.MOD_REPLACE, 'sslVersionMin', 'TLS1.1'), + (ldap.MOD_REPLACE, 'sslVersionMax', 'TLS1.2')]) + topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_DELETE, 'nsSSL3', None), + (ldap.MOD_DELETE, 'nsTLS1', None), + (ldap.MOD_DELETE, 'sslVersionMin', None), + (ldap.MOD_DELETE, 'sslVersionMax', None)]) + topology.standalone.modify_s(CONFIG_DN, [(ldap.MOD_REPLACE, 'nsslapd-errorlog-level', '64')]) + + log.info("\n######################### Restarting the server ######################\n") + topology.standalone.stop(timeout=10) + os.system('mv %s %s.47838_11' % (topology.standalone.errlog, topology.standalone.errlog)) + os.system('touch %s' % (topology.standalone.errlog)) + topology.standalone.start(timeout=120) + + errmsg = os.popen('egrep "SSL alert:" %s | egrep "Default SSL Version settings; Configuring the version range as min: TLS1.1"' % topology.standalone.errlog) + if errmsg != "": + log.info("Expected message:") + log.info("%s" % errmsg.readline()) + else: + log.info("Expected message was not found") + assert False + +def test_ticket47928_run_1(topology): + """ + No nsSSL3, nsTLS1; sslVersionMin > sslVersionMax + Check sslVersionMax is ignored. + """ + _header(topology, 'Test Case 14 - No nsSSL3, nsTLS1; sslVersionMin > sslVersionMax') + + topology.standalone.simple_bind_s(DN_DM, PASSWORD) + topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'sslVersionMin', 'TLS1.2'), + (ldap.MOD_REPLACE, 'sslVersionMax', 'TLS1.1')]) + + log.info("\n######################### Restarting the server ######################\n") + topology.standalone.stop(timeout=10) + os.system('mv %s %s.47838_12' % (topology.standalone.errlog, topology.standalone.errlog)) + os.system('touch %s' % (topology.standalone.errlog)) + topology.standalone.start(timeout=120) + + errmsg = os.popen('egrep "SSL alert:" %s | egrep "The min value of NSS version range"' % topology.standalone.errlog) + if errmsg != "": + log.info("Expected message:") + log.info("%s" % errmsg.readline()) + else: + log.info("Expected message was not found") + assert False + + errmsg = os.popen('egrep "SSL Initialization" %s | egrep "Configured SSL version range: min: TLS1.2, max: TLS1"' % topology.standalone.errlog) + if errmsg != "": + log.info("Expected message:") + log.info("%s" % errmsg.readline()) + else: + log.info("Expected message was not found") + assert False + +def test_ticket47928_run_2(topology): + """ + nsSSL3: on; sslVersionMin: TLS1.1; sslVersionMax: TLS1.2 + Conflict between nsSSL3 and range; nsSSL3 is disabled + """ + _header(topology, 'Test Case 15 - nsSSL3: on; sslVersionMin: TLS1.1; sslVersionMax: TLS1.2') + + topology.standalone.simple_bind_s(DN_DM, PASSWORD) + topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'sslVersionMin', 'TLS1.1'), + (ldap.MOD_REPLACE, 'sslVersionMax', 'TLS1.2'), + (ldap.MOD_REPLACE, 'nsSSL3', 'on')]) + + log.info("\n######################### Restarting the server ######################\n") + topology.standalone.stop(timeout=10) + os.system('mv %s %s.47838_13' % (topology.standalone.errlog, topology.standalone.errlog)) + os.system('touch %s' % (topology.standalone.errlog)) + topology.standalone.start(timeout=120) + + errmsg = os.popen('egrep "SSL alert:" %s | egrep "Found unsecure configuration: nsSSL3: on"' % topology.standalone.errlog) + if errmsg != "": + log.info("Expected message:") + log.info("%s" % errmsg.readline()) + else: + log.info("Expected message was not found") + assert False + + errmsg = os.popen('egrep "SSL alert:" %s | egrep "Respect the supported range."' % topology.standalone.errlog) + if errmsg != "": + log.info("Expected message:") + log.info("%s" % errmsg.readline()) + else: + log.info("Expected message was not found") + assert False + + errmsg = os.popen('egrep "SSL Initialization" %s | egrep "Configured SSL version range: min: TLS1.1, max: TLS1"' % topology.standalone.errlog) + if errmsg != "": + log.info("Expected message:") + log.info("%s" % errmsg.readline()) + else: + log.info("Expected message was not found") + assert False + +def test_ticket47928_run_3(topology): + """ + nsSSL3: on; nsTLS1: off; sslVersionMin: TLS1.1; sslVersionMax: TLS1.2 + Conflict between nsSSL3/nsTLS1 and range; nsSSL3 is disabled; nsTLS1 is enabled. + """ + _header(topology, 'Test Case 16 - nsSSL3: on; nsTLS1: off; sslVersionMin: TLS1.1; sslVersionMax: TLS1.2') + + topology.standalone.simple_bind_s(DN_DM, PASSWORD) + topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'sslVersionMin', 'TLS1.1'), + (ldap.MOD_REPLACE, 'sslVersionMax', 'TLS1.2'), + (ldap.MOD_REPLACE, 'nsSSL3', 'on'), + (ldap.MOD_REPLACE, 'nsTLS1', 'off')]) + + log.info("\n######################### Restarting the server ######################\n") + topology.standalone.stop(timeout=10) + os.system('mv %s %s.47838_14' % (topology.standalone.errlog, topology.standalone.errlog)) + os.system('touch %s' % (topology.standalone.errlog)) + topology.standalone.start(timeout=120) + + errmsg = os.popen('egrep "SSL alert:" %s | egrep "Found unsecure configuration: nsSSL3: on"' % topology.standalone.errlog) + if errmsg != "": + log.info("Expected message:") + log.info("%s" % errmsg.readline()) + else: + log.info("Expected message was not found") + assert False + + errmsg = os.popen('egrep "SSL alert:" %s | egrep "Respect the configured range."' % topology.standalone.errlog) + if errmsg != "": + log.info("Expected message:") + log.info("%s" % errmsg.readline()) + else: + log.info("Expected message was not found") + assert False + + errmsg = os.popen('egrep "SSL Initialization" %s | egrep "Configured SSL version range: min: TLS1.1, max: TLS1"' % topology.standalone.errlog) + if errmsg != "": + log.info("Expected message:") + log.info("%s" % errmsg.readline()) + else: + log.info("Expected message was not found") + assert False + def test_ticket47838_run_last(topology): """ Check nssSSL3Chiphers: all <== invalid value All ciphers are disabled. """ - _header(topology, 'Test Case 13 - Check nssSSL3Chiphers: all, which is invalid') + _header(topology, 'Test Case 17 - Check nssSSL3Chiphers: all, which is invalid') topology.standalone.simple_bind_s(DN_DM, PASSWORD) + topology.standalone.modify_s(CONFIG_DN, [(ldap.MOD_REPLACE, 'nsslapd-errorlog-level', None)]) topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'nsSSL3Ciphers', 'all')]) log.info("\n######################### Restarting the server ######################\n") topology.standalone.stop(timeout=10) - os.system('mv %s %s.47838_10' % (topology.standalone.errlog, topology.standalone.errlog)) + os.system('mv %s %s.47838_15' % (topology.standalone.errlog, topology.standalone.errlog)) os.system('touch %s' % (topology.standalone.errlog)) topology.standalone.start(timeout=120) @@ -671,7 +824,7 @@ def test_ticket47838_run_last(topology): comp_nsSSLEnableCipherCount(topology, 0) - topology.standalone.log.info("ticket47838, 47880, 47908 were successfully verified."); + topology.standalone.log.info("ticket47838, 47880, 47908, 47928 were successfully verified."); def test_ticket47838_final(topology): topology.standalone.simple_bind_s(DN_DM, PASSWORD) @@ -706,6 +859,10 @@ def run_isolated(): test_ticket47838_run_9(topo) test_ticket47838_run_10(topo) test_ticket47838_run_11(topo) + test_ticket47928_run_0(topo) + test_ticket47928_run_1(topo) + test_ticket47928_run_2(topo) + test_ticket47928_run_3(topo) test_ticket47838_run_last(topo)
0
76c33394c21a64a7c20047f72196b31dfdf233f0
389ds/389-ds-base
Bug 639289 - Adding a new CN entry with UpperCase UTF-8 Character https://bugzilla.redhat.com/show_bug.cgi?id=639289 Description: There was a bug in the utf8 uppe2Lower table: Character İ (LATIN CAPITAL LETTER I WITH DOT ABOVE) did not map to the corresponding LATIN SMALL LETTER DOTLESS I (2 bytes) but to ascii 'i' (1 byte). The shortened DN tailed with a garbage character and the entry was treated as an orphan entry which does not belong to any suffix. This patch fixes the mapping table mismatch as well as adds a code to dn_ignore_case_to_end to force to NULL terminate the converted string.
commit 76c33394c21a64a7c20047f72196b31dfdf233f0 Author: Noriko Hosoi <[email protected]> Date: Tue Oct 5 09:31:15 2010 -0700 Bug 639289 - Adding a new CN entry with UpperCase UTF-8 Character https://bugzilla.redhat.com/show_bug.cgi?id=639289 Description: There was a bug in the utf8 uppe2Lower table: Character İ (LATIN CAPITAL LETTER I WITH DOT ABOVE) did not map to the corresponding LATIN SMALL LETTER DOTLESS I (2 bytes) but to ascii 'i' (1 byte). The shortened DN tailed with a garbage character and the entry was treated as an orphan entry which does not belong to any suffix. This patch fixes the mapping table mismatch as well as adds a code to dn_ignore_case_to_end to force to NULL terminate the converted string. diff --git a/ldap/servers/slapd/dn.c b/ldap/servers/slapd/dn.c index 54ddac101..7cf58c4e6 100644 --- a/ldap/servers/slapd/dn.c +++ b/ldap/servers/slapd/dn.c @@ -1250,6 +1250,9 @@ dn_ignore_case_to_end( char *dn, char *end ) s += ssz, d += dsz) { slapi_utf8ToLower( s, d, &ssz, &dsz ); } + if (d) { + *d = '\0'; /* utf8ToLower result may be shorter than the original */ + } return( dn ); } diff --git a/ldap/servers/slapd/utf8compare.c b/ldap/servers/slapd/utf8compare.c index 5d28b8c33..12cdf220e 100644 --- a/ldap/servers/slapd/utf8compare.c +++ b/ldap/servers/slapd/utf8compare.c @@ -133,7 +133,7 @@ UpperLowerTbl_t Upper2LowerTbl21[] = { {"\304\252", "\304\253", 2}, {"\304\254", "\304\255", 2}, {"\304\256", "\304\257", 2}, - {"\304\260", "\151", 1}, + {"\304\260", "\304\261", 2}, {"\304\262", "\304\263", 2}, {"\304\264", "\304\265", 2}, {"\304\266", "\304\267", 2},
0
b7d11180552b495ec34079a5578054c4d5e89473
389ds/389-ds-base
Ticket - 50349 - additional fix: filter schema check must handle subtypes Bug: if the filter did contain an attribute with a subtype eg givenname;lang-de then the schema lookup failed. Fix: The subtype needs to be removed befor asi lookup Reviewed by: William, Thiery, Mark - thanks
commit b7d11180552b495ec34079a5578054c4d5e89473 Author: Ludwig Krispenz <[email protected]> Date: Wed Oct 9 16:31:13 2019 +0200 Ticket - 50349 - additional fix: filter schema check must handle subtypes Bug: if the filter did contain an attribute with a subtype eg givenname;lang-de then the schema lookup failed. Fix: The subtype needs to be removed befor asi lookup Reviewed by: William, Thiery, Mark - thanks diff --git a/ldap/servers/slapd/attrsyntax.c b/ldap/servers/slapd/attrsyntax.c index 8d218d4a3..7de006c00 100644 --- a/ldap/servers/slapd/attrsyntax.c +++ b/ldap/servers/slapd/attrsyntax.c @@ -394,11 +394,33 @@ attr_syntax_get_by_name_locking_optional(const char *name, PRBool use_lock, PRUi * The main reason to use this over attr_syntax_get_by_name_locking_optional is to * avoid the reference count increment/decrement cycle when we only need a boolean * of existance, rather than retriving the reference to the attribute itself. + * + * But we do need to strip subtypes */ int32_t attr_syntax_exist_by_name_nolock(char *name) { struct asyntaxinfo *asi = NULL; - asi = (struct asyntaxinfo *)PL_HashTableLookup_const(name2asi, name); + char *check_name = NULL; + char *p = NULL; + int free_attr = 0; + + /* Ignore any attribute subtypes. */ + if ((p = strchr(name, ';'))) { + int check_len = p - name + 1; + + check_name = (char *)slapi_ch_malloc(check_len); + PR_snprintf(check_name, check_len, "%s", name); + free_attr = 1; + } else { + check_name = name; + } + + asi = (struct asyntaxinfo *)PL_HashTableLookup_const(name2asi, check_name); + + if (free_attr) { + slapi_ch_free_string(&check_name); + } + if (asi != NULL) { return 1; }
0
7ece306092df8db2c51aeb637d69771f5dc77d02
389ds/389-ds-base
Bug 646381 - Faulty password for nsmultiplexorcredentials does not give any error message in logs https://bugzilla.redhat.com/show_bug.cgi?id=646381 Description: Chaning db plugin was terse not to reveal the config error to end users as well as to prevent error log overflow by every single error possibly caused by end users. This patch returns this generic error text to end users: ldap_add: Operations error (1) additional info: database configuration error - \ please contact the system administrator And more detailed messages are logged in the errors log. E.g., chaining database - Internal credentials decoding error; password storage schemes do not match or encrypted password is corrupted. chaining database - cb_get_connection failed (49) Invalid credentials Note: the messages are logged just once in the errors log.
commit 7ece306092df8db2c51aeb637d69771f5dc77d02 Author: Noriko Hosoi <[email protected]> Date: Tue Jan 25 15:34:15 2011 -0800 Bug 646381 - Faulty password for nsmultiplexorcredentials does not give any error message in logs https://bugzilla.redhat.com/show_bug.cgi?id=646381 Description: Chaning db plugin was terse not to reveal the config error to end users as well as to prevent error log overflow by every single error possibly caused by end users. This patch returns this generic error text to end users: ldap_add: Operations error (1) additional info: database configuration error - \ please contact the system administrator And more detailed messages are logged in the errors log. E.g., chaining database - Internal credentials decoding error; password storage schemes do not match or encrypted password is corrupted. chaining database - cb_get_connection failed (49) Invalid credentials Note: the messages are logged just once in the errors log. diff --git a/ldap/servers/plugins/chainingdb/cb.h b/ldap/servers/plugins/chainingdb/cb.h index d787c0cb6..80e991e19 100644 --- a/ldap/servers/plugins/chainingdb/cb.h +++ b/ldap/servers/plugins/chainingdb/cb.h @@ -503,4 +503,6 @@ char* get_localhost_DNS(); /* this function is called when state of a backend changes */ void cb_be_state_change (void *handle, char *be_name, int old_be_state, int new_be_state); +#define ENDUSERMSG "database configuration error - please contact the system administrator" + #endif diff --git a/ldap/servers/plugins/chainingdb/cb_add.c b/ldap/servers/plugins/chainingdb/cb_add.c index 720c48fec..501865adb 100644 --- a/ldap/servers/plugins/chainingdb/cb_add.c +++ b/ldap/servers/plugins/chainingdb/cb_add.c @@ -110,16 +110,24 @@ chaining_back_add ( Slapi_PBlock *pb ) } /* Grab a connection handle */ - if ((rc = cb_get_connection(cb->pool,&ld,&cnx,NULL,&cnxerrbuf)) != LDAP_SUCCESS) { - cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR,NULL,cnxerrbuf, 0, NULL); - ldap_mods_free(mods,1); - if (cnxerrbuf) { - PR_smprintf_free(cnxerrbuf); + rc = cb_get_connection(cb->pool, &ld, &cnx, NULL, &cnxerrbuf); + if (LDAP_SUCCESS != rc) { + static int warned_get_conn = 0; + if (!warned_get_conn) { + slapi_log_error(SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "cb_get_connection failed (%d) %s\n", + rc, ldap_err2string(rc)); + warned_get_conn = 1; } - /* ping the farm. If the farm is unreachable, we increment the counter */ - cb_ping_farm(cb,NULL,0); + cb_send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, + cnxerrbuf, 0, NULL); + ldap_mods_free(mods, 1); + slapi_ch_free_string(&cnxerrbuf); + /* ping the farm. + * If the farm is unreachable, we increment the counter */ + cb_ping_farm(cb, NULL, 0); - return -1; + return -1; } /* Control management */ @@ -149,12 +157,14 @@ chaining_back_add ( Slapi_PBlock *pb ) ldap_controls_free(ctrls); if ( rc != LDAP_SUCCESS ) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "ldap_add_ext failed -- %s\n", ldap_err2string(rc) ); - cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, - ldap_err2string(rc), 0, NULL); + cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, + ENDUSERMSG, 0, NULL ); cb_release_op_connection(cb->pool,ld,CB_LDAP_CONN_ERROR(rc)); ldap_mods_free(mods,1); - return -1; + return -1; } /* @@ -208,35 +218,53 @@ chaining_back_add ( Slapi_PBlock *pb ) parse_rc = ldap_parse_result( ld, res, &rc, &matched_msg, &error_msg, &referrals, &serverctrls, 1 ); - if ( parse_rc != LDAP_SUCCESS ) { - cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, - ldap_err2string(parse_rc), 0, NULL); + if ( parse_rc != LDAP_SUCCESS ) { + static int warned_parse_rc = 0; + if (!warned_parse_rc) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "%s%s%s\n", + matched_msg?matched_msg:"", + (matched_msg&&(*matched_msg!='\0'))?": ":"", + ldap_err2string(parse_rc)); + warned_parse_rc = 1; + } + cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, + ENDUSERMSG, 0, NULL ); cb_release_op_connection(cb->pool,ld,CB_LDAP_CONN_ERROR(parse_rc)); ldap_mods_free(mods,1); - slapi_ch_free((void **)&matched_msg); + slapi_ch_free((void **)&matched_msg); slapi_ch_free((void **)&error_msg); if (serverctrls) - ldap_controls_free(serverctrls); + ldap_controls_free(serverctrls); /* jarnou: free referrals */ - if (referrals) - charray_free(referrals); - return -1; + if (referrals) + charray_free(referrals); + return -1; } - if ( rc != LDAP_SUCCESS ) { + if ( rc != LDAP_SUCCESS ) { struct berval ** refs = referrals2berval(referrals); - cb_send_ldap_result( pb, rc, matched_msg, error_msg, 0, refs); + static int warned_rc = 0; + if (!warned_rc && error_msg) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "%s%s%s\n", + matched_msg?matched_msg:"", + (matched_msg&&(*matched_msg!='\0'))?": ":"", + error_msg ); + warned_rc = 1; + } + cb_send_ldap_result( pb, rc, matched_msg, ENDUSERMSG, 0, refs); cb_release_op_connection(cb->pool,ld,CB_LDAP_CONN_ERROR(rc)); ldap_mods_free(mods,1); slapi_ch_free((void **)&matched_msg); - slapi_ch_free((void **)&error_msg); + slapi_ch_free((void **)&error_msg); if (refs) ber_bvecfree(refs); if (referrals) charray_free(referrals); if (serverctrls) - ldap_controls_free(serverctrls); - return -1; + ldap_controls_free(serverctrls); + return -1; } ldap_mods_free(mods,1 ); diff --git a/ldap/servers/plugins/chainingdb/cb_bind.c b/ldap/servers/plugins/chainingdb/cb_bind.c index 71d1aded2..027791f83 100644 --- a/ldap/servers/plugins/chainingdb/cb_bind.c +++ b/ldap/servers/plugins/chainingdb/cb_bind.c @@ -94,8 +94,8 @@ static int cb_sasl_bind_once_s( cb_conn_pool *pool, char *dn, int method, char * mechanism, struct berval *creds, LDAPControl **reqctrls, char **matcheddnp, char **errmsgp, struct berval ***refurlsp, - LDAPControl ***resctrlsp , int * status) { - + LDAPControl ***resctrlsp , int * status ) +{ int rc, msgid; char **referrals; struct timeval timeout_copy, *timeout; @@ -112,10 +112,18 @@ cb_sasl_bind_once_s( cb_conn_pool *pool, char *dn, int method, char * mechanism, timeout_copy.tv_usec = pool->conn.bind_timeout.tv_usec; PR_RWLock_Unlock(pool->rwl_config_lock); - if (( rc = cb_get_connection( pool, &ld ,&cnx, NULL, &cnxerrbuf)) != LDAP_SUCCESS ) { - *errmsgp=cnxerrbuf; - goto release_and_return; - } + rc = cb_get_connection(pool, &ld, &cnx, NULL, &cnxerrbuf); + if (LDAP_SUCCESS != rc) { + static int warned_get_conn = 0; + if (!warned_get_conn) { + slapi_log_error(SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "cb_get_connection failed (%d) %s\n", + rc, ldap_err2string(rc)); + warned_get_conn = 1; + } + *errmsgp = cnxerrbuf; + goto release_and_return; + } /* Send the bind operation (need to retry on LDAP_SERVER_DOWN) */ @@ -171,8 +179,15 @@ cb_sasl_bind_once_s( cb_conn_pool *pool, char *dn, int method, char * mechanism, *errmsgp=slapi_ch_strdup(errmsgp2); if ( LDAP_SUCCESS != rc ) { - slapi_log_error( SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, - "cb_sasl_bind_once_s failed (%s)\n",ldap_err2string(rc)); + static int warned_bind_once = 0; + if (!warned_bind_once) { + slapi_log_error(SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "cb_sasl_bind_once_s failed (%s%s%s)\n", + matcheddnp?matcheddnp:"", + (matcheddnp&&(*matcheddnp!='\0'))?": ":"", + ldap_err2string(rc)); + warned_bind_once = 1; + } } } else { @@ -274,29 +289,30 @@ chainingdb_bind( Slapi_PBlock *pb ) { bind_retry=cb->bind_retry; PR_RWLock_Unlock(cb->rwl_config_lock); - if ( LDAP_SUCCESS == (rc = cb_sasl_bind_s(pb, cb->bind_pool, bind_retry, dn,method,mechanism, - creds,reqctrls,&matcheddn,&errmsg,&urls,&resctrls, &status))) { - rc = status; - allocated_errmsg = 1; - } else - if ( LDAP_USER_CANCELLED != rc ) { - errmsg = ldap_err2string( rc ); + rc = cb_sasl_bind_s(pb, cb->bind_pool, bind_retry, dn, method, + mechanism, creds, reqctrls, &matcheddn, &errmsg, + &urls, &resctrls, &status); + if ( LDAP_SUCCESS == rc ) { + rc = status; + allocated_errmsg = 1; + } else if ( LDAP_USER_CANCELLED != rc ) { + errmsg = ldap_err2string( rc ); if (rc == LDAP_TIMEOUT) { - cb_ping_farm(cb,NULL,0); + cb_ping_farm(cb,NULL,0); } - rc = LDAP_OPERATIONS_ERROR; + rc = LDAP_OPERATIONS_ERROR; } - if ( rc != LDAP_USER_CANCELLED ) { /* not abandoned */ - if ( resctrls != NULL ) { - slapi_pblock_set( pb, SLAPI_RESCONTROLS, resctrls ); + if ( rc != LDAP_USER_CANCELLED ) { /* not abandoned */ + if ( resctrls != NULL ) { + slapi_pblock_set( pb, SLAPI_RESCONTROLS, resctrls ); freectrls=0; - } + } if ( rc != LDAP_SUCCESS ) { - cb_send_ldap_result( pb, rc, matcheddn, errmsg, 0, urls ); + cb_send_ldap_result( pb, rc, matcheddn, errmsg, 0, urls ); } - } + } if ( urls != NULL ) { cb_free_bervals( urls ); diff --git a/ldap/servers/plugins/chainingdb/cb_compare.c b/ldap/servers/plugins/chainingdb/cb_compare.c index 57235fc0f..ccbc175fd 100644 --- a/ldap/servers/plugins/chainingdb/cb_compare.c +++ b/ldap/servers/plugins/chainingdb/cb_compare.c @@ -111,15 +111,22 @@ chaining_back_compare ( Slapi_PBlock *pb ) /* * Grab a connection handle */ - - if ((rc = cb_get_connection(cb->pool,&ld,&cnx,NULL,&cnxerrbuf)) != LDAP_SUCCESS) { - cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, cnxerrbuf, 0, NULL); - if (cnxerrbuf) { - PR_smprintf_free(cnxerrbuf); - } - /* ping the farm. If the farm is unreachable, we increment the counter */ - cb_ping_farm(cb,NULL,0); - return 1; + rc = cb_get_connection(cb->pool, &ld, &cnx, NULL, &cnxerrbuf); + if (LDAP_SUCCESS != rc) { + static int warned_get_conn = 0; + if (!warned_get_conn) { + slapi_log_error(SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "cb_get_connection failed (%d) %s\n", + rc, ldap_err2string(rc)); + warned_get_conn = 1; + } + cb_send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, + cnxerrbuf, 0, NULL); + slapi_ch_free_string(&cnxerrbuf); + /* ping the farm. + * If the farm is unreachable, we increment the counter */ + cb_ping_farm(cb, NULL, 0); + return 1; } /* @@ -195,20 +202,28 @@ chaining_back_compare ( Slapi_PBlock *pb ) default: matched_msg=error_msg=NULL; parse_rc = ldap_parse_result( ld, res, &rc, &matched_msg, - &error_msg, &referrals, &serverctrls, 1 ); - if ( parse_rc != LDAP_SUCCESS ) { - - cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, - ldap_err2string(parse_rc), 0, NULL); + &error_msg, &referrals, &serverctrls, 1 ); + if ( parse_rc != LDAP_SUCCESS ) { + static int warned_parse_rc = 0; + if (!warned_parse_rc) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "%s%s%s\n", + matched_msg?matched_msg:"", + (matched_msg&&(*matched_msg!='\0'))?": ":"", + ldap_err2string(parse_rc)); + warned_parse_rc = 1; + } + cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, + ENDUSERMSG, 0, NULL ); cb_release_op_connection(cb->pool,ld,CB_LDAP_CONN_ERROR(parse_rc)); - slapi_ch_free((void **)&matched_msg); - slapi_ch_free((void **)&error_msg); + slapi_ch_free((void **)&matched_msg); + slapi_ch_free((void **)&error_msg); if (serverctrls) - ldap_controls_free(serverctrls); + ldap_controls_free(serverctrls); /* jarnou: free referrals */ - if (referrals) - charray_free(referrals); - return 1; + if (referrals) + charray_free(referrals); + return 1; } switch ( rc ) { diff --git a/ldap/servers/plugins/chainingdb/cb_conn_stateless.c b/ldap/servers/plugins/chainingdb/cb_conn_stateless.c index a3dfe36b4..d84d657d5 100644 --- a/ldap/servers/plugins/chainingdb/cb_conn_stateless.c +++ b/ldap/servers/plugins/chainingdb/cb_conn_stateless.c @@ -151,8 +151,13 @@ void cb_close_conn_pool(cb_conn_pool * pool) { * NOTE : if maxtime NULL, use operation timeout */ -int cb_get_connection(cb_conn_pool * pool, LDAP ** lld, cb_outgoing_conn ** cc,struct timeval * maxtime, char **errmsg) { - +int +cb_get_connection(cb_conn_pool * pool, + LDAP ** lld, + cb_outgoing_conn ** cc, + struct timeval * maxtime, + char **errmsg) +{ int rc=LDAP_SUCCESS; /* optimistic */ cb_outgoing_conn *conn=NULL; cb_outgoing_conn *connprev=NULL; @@ -213,13 +218,17 @@ int cb_get_connection(cb_conn_pool * pool, LDAP ** lld, cb_outgoing_conn ** cc,s /* For stupid admins */ if (maxconnections <=0) { - slapi_log_error( SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, - "<== cb_get_connection error (no connection available)\n"); + static int warned_maxconn = 0; + if (!warned_maxconn) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "<== cb_get_connection error (no connection available)\n"); + warned_maxconn = 1; + } if ( errmsg ) { - *errmsg = PR_smprintf(error1, "no connection available"); + *errmsg = slapi_ch_smprintf("%s", ENDUSERMSG); } return LDAP_CONNECT_ERROR; - } + } if (maxtime) { if (maxtime->tv_sec != 0) { @@ -324,13 +333,17 @@ int cb_get_connection(cb_conn_pool * pool, LDAP ** lld, cb_outgoing_conn ** cc,s */ /* No need to lock. url can't be changed dynamically */ - if ((ld=slapi_ldap_init(hostname,port,secure,isMultiThread))== NULL) { - if (cb_debug_on()) { - slapi_log_error( SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, - "Can't contact server <%s> port <%d>.\n", hostname, port); + ld = slapi_ldap_init(hostname, port, secure, isMultiThread); + if (NULL == ld) { + static int warned_init = 0; + if (!warned_init) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "Can't contact server <%s> port <%d>.\n", + hostname, port ); + warned_init = 1; } if ( errmsg ) { - *errmsg = PR_smprintf(error1,"unknown reason"); + *errmsg = slapi_ch_smprintf("%s", ENDUSERMSG); } rc = LDAP_CONNECT_ERROR; goto unlock_and_return; @@ -363,11 +376,18 @@ int cb_get_connection(cb_conn_pool * pool, LDAP ** lld, cb_outgoing_conn ** cc,s /* Pb occured in decryption: stop now, binding will fail */ if ( ret == -1 ) { - if (cb_debug_on()) { - slapi_log_error( SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, - "Internal credentials decoding error\n."); + static int warned_pw = 0; + if (!warned_pw) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "Internal credentials decoding error; " + "password storage schemes do not match or " + "encrypted password is corrupted.\n"); + warned_pw = 1; + } + if ( errmsg ) { + *errmsg = slapi_ch_smprintf("%s", ENDUSERMSG); } - rc = LDAP_LOCAL_ERROR; + rc = LDAP_INVALID_CREDENTIALS; goto unlock_and_return; } @@ -378,26 +398,33 @@ int cb_get_connection(cb_conn_pool * pool, LDAP ** lld, cb_outgoing_conn ** cc,s if ( ret == 0 ) slapi_ch_free_string(&plain); /* free plain only if it has been duplicated */ if ( rc == LDAP_TIMEOUT ) { - if (cb_debug_on()) { - slapi_log_error( SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, - "Can't bind to server <%s> port <%d>. (%s)\n", - hostname, port, "time-out expired"); + static int warned_bind_timeout = 0; + if (!warned_bind_timeout) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "Can't bind to server <%s> port <%d>. (%s)\n", + hostname, port, "time-out expired"); + warned_bind_timeout = 1; + } + if ( errmsg ) { + *errmsg = slapi_ch_smprintf("%s", ENDUSERMSG); } rc = LDAP_CONNECT_ERROR; goto unlock_and_return; } else if ( rc != LDAP_SUCCESS ) { prerr=PR_GetError(); - if (cb_debug_on()) { - slapi_log_error( SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + static int warned_bind_err = 0; + if (!warned_bind_err) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, "Can't bind to server <%s> port <%d>. " "(LDAP error %d - %s; " SLAPI_COMPONENT_NAME_NSPR " error %d - %s)\n", hostname, port, rc, ldap_err2string(rc), prerr, slapd_pr_strerror(prerr)); + warned_bind_err = 1; } if ( errmsg ) { - *errmsg = PR_smprintf(error2, ldap_err2string(rc)); + *errmsg = slapi_ch_smprintf("%s", ENDUSERMSG); } rc = LDAP_CONNECT_ERROR; goto unlock_and_return; diff --git a/ldap/servers/plugins/chainingdb/cb_delete.c b/ldap/servers/plugins/chainingdb/cb_delete.c index dcca630ff..992f6065b 100644 --- a/ldap/servers/plugins/chainingdb/cb_delete.c +++ b/ldap/servers/plugins/chainingdb/cb_delete.c @@ -105,15 +105,22 @@ chaining_back_delete ( Slapi_PBlock *pb ) /* * Grab a connection handle */ - - if ((rc = cb_get_connection(cb->pool,&ld,&cnx,NULL,&cnxerrbuf)) != LDAP_SUCCESS) { - cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, cnxerrbuf, 0, NULL); - if (cnxerrbuf) { - PR_smprintf_free(cnxerrbuf); - } - /* ping the farm. If the farm is unreachable, we increment the counter */ - cb_ping_farm(cb,NULL,0); - return -1; + rc = cb_get_connection(cb->pool, &ld, &cnx, NULL, &cnxerrbuf); + if (LDAP_SUCCESS != rc) { + static int warned_get_conn = 0; + if (!warned_get_conn) { + slapi_log_error(SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "cb_get_connection failed (%d) %s\n", + rc, ldap_err2string(rc)); + warned_get_conn = 1; + } + cb_send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, + cnxerrbuf, 0, NULL); + slapi_ch_free_string(&cnxerrbuf); + /* ping the farm. + * If the farm is unreachable, we increment the counter */ + cb_ping_farm(cb, NULL, 0); + return -1; } /* @@ -188,35 +195,52 @@ chaining_back_delete ( Slapi_PBlock *pb ) default: matched_msg=error_msg=NULL; parse_rc = ldap_parse_result( ld, res, &rc, &matched_msg, - &error_msg, &referrals, &serverctrls, 1 ); - if ( parse_rc != LDAP_SUCCESS ) { - cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, - ldap_err2string(parse_rc), 0, NULL); + &error_msg, &referrals, &serverctrls, 1 ); + if ( parse_rc != LDAP_SUCCESS ) { + static int warned_parse_rc = 0; + if (!warned_parse_rc) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "%s%s%s\n", + matched_msg?matched_msg:"", + (matched_msg&&(*matched_msg!='\0'))?": ":"", + ldap_err2string(parse_rc) ); + warned_parse_rc = 1; + } + cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, + ENDUSERMSG, 0, NULL ); cb_release_op_connection(cb->pool,ld,CB_LDAP_CONN_ERROR(parse_rc)); - slapi_ch_free((void **)&matched_msg); - slapi_ch_free((void **)&error_msg); - if (serverctrls) - ldap_controls_free(serverctrls); + slapi_ch_free((void **)&matched_msg); + slapi_ch_free((void **)&error_msg); + if (serverctrls) + ldap_controls_free(serverctrls); /* jarnou: free referrals */ - if (referrals) - charray_free(referrals); - return -1; + if (referrals) + charray_free(referrals); + return -1; } - if ( rc != LDAP_SUCCESS ) { + if ( rc != LDAP_SUCCESS ) { struct berval ** refs = referrals2berval(referrals); - - cb_send_ldap_result( pb, rc, matched_msg, error_msg, 0, refs); + static int warned_rc = 0; + if (!warned_rc && error_msg) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "%s%s%s\n", + matched_msg?matched_msg:"", + (matched_msg&&(*matched_msg!='\0'))?": ":"", + error_msg ); + warned_rc = 1; + } + cb_send_ldap_result( pb, rc, matched_msg, ENDUSERMSG, 0, refs); cb_release_op_connection(cb->pool,ld,CB_LDAP_CONN_ERROR(rc)); - slapi_ch_free((void **)&matched_msg); - slapi_ch_free((void **)&error_msg); + slapi_ch_free((void **)&matched_msg); + slapi_ch_free((void **)&error_msg); if (refs) ber_bvecfree(refs); if (referrals) charray_free(referrals); - if (serverctrls) - ldap_controls_free(serverctrls); - return -1; + if (serverctrls) + ldap_controls_free(serverctrls); + return -1; } cb_release_op_connection(cb->pool,ld,0); diff --git a/ldap/servers/plugins/chainingdb/cb_modify.c b/ldap/servers/plugins/chainingdb/cb_modify.c index 8b50f6e75..f0b4e44bd 100644 --- a/ldap/servers/plugins/chainingdb/cb_modify.c +++ b/ldap/servers/plugins/chainingdb/cb_modify.c @@ -114,14 +114,22 @@ chaining_back_modify ( Slapi_PBlock *pb ) /* Grab a connection handle */ - if ((rc = cb_get_connection(cb->pool,&ld,&cnx,NULL,&cnxerrbuf)) != LDAP_SUCCESS) { - cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, cnxerrbuf, 0, NULL); - if (cnxerrbuf) { - PR_smprintf_free(cnxerrbuf); - } - /* ping the farm. If the farm is unreachable, we increment the counter */ - cb_ping_farm(cb,NULL,0); - return -1; + rc = cb_get_connection(cb->pool, &ld, &cnx, NULL, &cnxerrbuf); + if (LDAP_SUCCESS != rc) { + static int warned_get_conn = 0; + if (!warned_get_conn) { + slapi_log_error(SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "cb_get_connection failed (%d) %s\n", + rc, ldap_err2string(rc)); + warned_get_conn = 1; + } + cb_send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, + cnxerrbuf, 0, NULL); + slapi_ch_free_string(&cnxerrbuf); + /* ping the farm. + * If the farm is unreachable, we increment the counter */ + cb_ping_farm(cb, NULL, 0); + return -1; } /* Control management */ @@ -197,34 +205,52 @@ chaining_back_modify ( Slapi_PBlock *pb ) matched_msg=error_msg=NULL; serverctrls=NULL; parse_rc = ldap_parse_result( ld, res, &rc, &matched_msg, - &error_msg, &referrals, &serverctrls, 1 ); - if ( parse_rc != LDAP_SUCCESS ) { - cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, - ldap_err2string(parse_rc), 0, NULL); + &error_msg, &referrals, &serverctrls, 1 ); + if ( parse_rc != LDAP_SUCCESS ) { + static int warned_parse_rc = 0; + if (!warned_parse_rc) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "%s%s%s\n", + matched_msg?matched_msg:"", + (matched_msg&&(*matched_msg!='\0'))?": ":"", + ldap_err2string(parse_rc)); + warned_parse_rc = 1; + } + cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, + ENDUSERMSG, 0, NULL ); cb_release_op_connection(cb->pool,ld,CB_LDAP_CONN_ERROR(parse_rc)); - slapi_ch_free((void **)&matched_msg); - slapi_ch_free((void **)&error_msg); + slapi_ch_free((void **)&matched_msg); + slapi_ch_free((void **)&error_msg); if (serverctrls) - ldap_controls_free(serverctrls); + ldap_controls_free(serverctrls); /* jarnou: free referrals */ - if (referrals) - charray_free(referrals); - return -1; + if (referrals) + charray_free(referrals); + return -1; } - if ( rc != LDAP_SUCCESS ) { + if ( rc != LDAP_SUCCESS ) { struct berval ** refs = referrals2berval(referrals); - cb_send_ldap_result( pb, rc, matched_msg, error_msg, 0, refs); + static int warned_rc = 0; + if (!warned_rc && error_msg) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "%s%s%s\n", + matched_msg?matched_msg:"", + (matched_msg&&(*matched_msg!='\0'))?": ":"", + error_msg ); + warned_rc = 1; + } + cb_send_ldap_result( pb, rc, matched_msg, ENDUSERMSG, 0, refs); cb_release_op_connection(cb->pool,ld,CB_LDAP_CONN_ERROR(rc)); - slapi_ch_free((void **)&matched_msg); - slapi_ch_free((void **)&error_msg); + slapi_ch_free((void **)&matched_msg); + slapi_ch_free((void **)&error_msg); if (refs) ber_bvecfree(refs); if (referrals) charray_free(referrals); if (serverctrls) - ldap_controls_free(serverctrls); - return -1; + ldap_controls_free(serverctrls); + return -1; } cb_release_op_connection(cb->pool,ld,0); diff --git a/ldap/servers/plugins/chainingdb/cb_modrdn.c b/ldap/servers/plugins/chainingdb/cb_modrdn.c index aa0bcacd0..2efff02d7 100644 --- a/ldap/servers/plugins/chainingdb/cb_modrdn.c +++ b/ldap/servers/plugins/chainingdb/cb_modrdn.c @@ -139,15 +139,22 @@ chaining_back_modrdn ( Slapi_PBlock *pb ) /* * Grab a connection handle */ - - if ((rc = cb_get_connection(cb->pool,&ld,&cnx,NULL,&cnxerrbuf)) != LDAP_SUCCESS) { - cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, cnxerrbuf, 0, NULL); - if (cnxerrbuf) { - PR_smprintf_free(cnxerrbuf); - } - /* ping the farm. If the farm is unreachable, we increment the counter */ - cb_ping_farm(cb,NULL,0); - return -1; + rc = cb_get_connection(cb->pool, &ld, &cnx, NULL, &cnxerrbuf); + if (LDAP_SUCCESS != rc) { + static int warned_get_conn = 0; + if (!warned_get_conn) { + slapi_log_error(SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "cb_get_connection failed (%d) %s\n", + rc, ldap_err2string(rc)); + warned_get_conn = 1; + } + cb_send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, + cnxerrbuf, 0, NULL); + slapi_ch_free_string(&cnxerrbuf); + /* ping the farm. + * If the farm is unreachable, we increment the counter */ + cb_ping_farm(cb, NULL, 0); + return -1; } /* @@ -223,36 +230,53 @@ chaining_back_modrdn ( Slapi_PBlock *pb ) default: matched_msg=error_msg=NULL; parse_rc = ldap_parse_result( ld, res, &rc, &matched_msg, - &error_msg, &referrals, &serverctrls, 1 ); - - if ( parse_rc != LDAP_SUCCESS ) { - cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, - ldap_err2string(parse_rc), 0, NULL); + &error_msg, &referrals, &serverctrls, 1 ); + + if ( parse_rc != LDAP_SUCCESS ) { + static int warned_parse_rc = 0; + if (!warned_parse_rc) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "%s%s%s\n", + matched_msg?matched_msg:"", + (matched_msg&&(*matched_msg!='\0'))?": ":"", + ldap_err2string(parse_rc)); + warned_parse_rc = 1; + } + cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, + ENDUSERMSG, 0, NULL ); cb_release_op_connection(cb->pool,ld,CB_LDAP_CONN_ERROR(parse_rc)); - slapi_ch_free((void **)&matched_msg); - slapi_ch_free((void **)&error_msg); - if (serverctrls) - ldap_controls_free(serverctrls); + slapi_ch_free((void **)&matched_msg); + slapi_ch_free((void **)&error_msg); + if (serverctrls) + ldap_controls_free(serverctrls); /* jarnou: free referrals */ - if (referrals) - charray_free(referrals); - return -1; + if (referrals) + charray_free(referrals); + return -1; } - if ( rc != LDAP_SUCCESS ) { + if ( rc != LDAP_SUCCESS ) { struct berval ** refs = referrals2berval(referrals); - - cb_send_ldap_result( pb, rc, matched_msg, error_msg, 0, refs); + static int warned_rc = 0; + if (!warned_rc && error_msg) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "%s%s%s\n", + matched_msg?matched_msg:"", + (matched_msg&&(*matched_msg!='\0'))?": ":"", + error_msg ); + warned_rc = 1; + } + cb_send_ldap_result( pb, rc, matched_msg, ENDUSERMSG, 0, refs); cb_release_op_connection(cb->pool,ld,CB_LDAP_CONN_ERROR(rc)); - slapi_ch_free((void **)&matched_msg); - slapi_ch_free((void **)&error_msg); + slapi_ch_free((void **)&matched_msg); + slapi_ch_free((void **)&error_msg); if (refs) ber_bvecfree(refs); if (referrals) charray_free(referrals); - if (serverctrls) - ldap_controls_free(serverctrls); - return -1; + if (serverctrls) + ldap_controls_free(serverctrls); + return -1; } cb_release_op_connection(cb->pool,ld,0); diff --git a/ldap/servers/plugins/chainingdb/cb_search.c b/ldap/servers/plugins/chainingdb/cb_search.c index e2f25796f..e5d56ff6a 100644 --- a/ldap/servers/plugins/chainingdb/cb_search.c +++ b/ldap/servers/plugins/chainingdb/cb_search.c @@ -214,18 +214,25 @@ chainingdb_build_candidate_list ( Slapi_PBlock *pb ) } /* Grab a connection handle */ - - if ( LDAP_SUCCESS != (rc = cb_get_connection(cb->pool,&ld,&cnx,&timeout,&cnxerrbuf))) { - if (rc == LDAP_TIMELIMIT_EXCEEDED) - cb_send_ldap_result( pb, rc, NULL,cnxerrbuf, 0, NULL); - else - cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL,cnxerrbuf, 0, NULL); - - if (cnxerrbuf) { - PR_smprintf_free(cnxerrbuf); + rc = cb_get_connection(cb->pool, &ld, &cnx, &timeout, &cnxerrbuf); + if (LDAP_SUCCESS != rc) { + static int warned_get_conn = 0; + if (!warned_get_conn) { + slapi_log_error(SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "cb_get_connection failed (%d) %s\n", + rc, ldap_err2string(rc)); + warned_get_conn = 1; + } + if (rc == LDAP_TIMELIMIT_EXCEEDED) { + cb_send_ldap_result(pb, rc, NULL, cnxerrbuf, 0, NULL); + } else { + cb_send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, + cnxerrbuf, 0, NULL); } - /* ping the farm. If the farm is unreachable, we increment the counter */ - cb_ping_farm(cb,NULL,0); + slapi_ch_free_string(&cnxerrbuf); + /* ping the farm. + * If the farm is unreachable, we increment the counter */ + cb_ping_farm(cb, NULL, 0); return 1; } @@ -358,17 +365,34 @@ chainingdb_build_candidate_list ( Slapi_PBlock *pb ) error_msg=NULL; referrals=NULL; serverctrls=NULL; - parse_rc=ldap_parse_result(ld,res,&rc,&matched_msg, + parse_rc=ldap_parse_result(ld,res,&rc,&matched_msg, &error_msg,&referrals, &serverctrls, 0 ); - if ( parse_rc != LDAP_SUCCESS ) { - cb_send_ldap_result(pb,parse_rc, - matched_msg,error_msg,0,NULL); + if ( parse_rc != LDAP_SUCCESS ) { + static int warned_parse_rc = 0; + if (!warned_parse_rc && error_msg) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "%s%s%s\n", + matched_msg?matched_msg:"", + (matched_msg&&(*matched_msg!='\0'))?": ":"", + error_msg ); + warned_parse_rc = 1; + } + cb_send_ldap_result( pb, parse_rc, NULL, + ENDUSERMSG, 0, NULL ); rc=-1; - } else - if ( rc != LDAP_SUCCESS ) { - slapi_ldap_get_lderrno( ctx->ld, &matched_msg, &error_msg ); - cb_send_ldap_result( pb, rc, matched_msg, - error_msg,0,NULL); + } else if ( rc != LDAP_SUCCESS ) { + static int warned_rc = 0; + if (!warned_rc) { + slapi_ldap_get_lderrno( ctx->ld, + &matched_msg, &error_msg ); + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "%s%s%s\n", + matched_msg?matched_msg:"", + (matched_msg&&(*matched_msg!='\0'))?": ":"", + error_msg ); + warned_rc = 1; + } + cb_send_ldap_result( pb, rc, NULL, ENDUSERMSG, 0, NULL); /* BEWARE: matched_msg and error_msg points */ /* to ld fields. */ matched_msg=NULL; @@ -689,25 +713,42 @@ chainingdb_next_search_entry ( Slapi_PBlock *pb ) case LDAP_RES_SEARCH_RESULT: - /* Parse the final result received from the server. Note the last - * argument is a non-zero value, which indicates that the - * LDAPMessage structure will be freed when done. + /* Parse the final result received from the server. Note the last + * argument is a non-zero value, which indicates that the + * LDAPMessage structure will be freed when done. */ slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET,NULL); slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_ENTRY,NULL); - parse_rc = ldap_parse_result( ctx->ld, res, + parse_rc = ldap_parse_result( ctx->ld, res, &rc,&matched_msg,&error_msg, &referrals, &serverctrls, 1 ); - if ( parse_rc != LDAP_SUCCESS ) { - cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, matched_msg, - ldap_err2string( parse_rc ), 0, NULL); - + if ( parse_rc != LDAP_SUCCESS ) { + static int warned_parse_rc = 0; + if (!warned_parse_rc) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "%s%s%s\n", + matched_msg?matched_msg:"", + (matched_msg&&(*matched_msg!='\0'))?": ":"", + ldap_err2string( parse_rc )); + warned_parse_rc = 1; + } + cb_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, + ENDUSERMSG, 0, NULL ); retcode=-1; } else if ( rc != LDAP_SUCCESS ) { + static int warned_rc = 0; slapi_ldap_get_lderrno( ctx->ld, &matched_msg, &error_msg ); - cb_send_ldap_result( pb, rc, matched_msg, NULL, 0, NULL); + if (!warned_rc) { + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "%s%s%s\n", + matched_msg?matched_msg:"", + (matched_msg&&(*matched_msg!='\0'))?": ":"", + error_msg ); + warned_rc = 1; + } + cb_send_ldap_result( pb, rc, matched_msg, ENDUSERMSG, 0, NULL ); /* BEWARE: Don't free matched_msg && error_msg */ /* Points to the ld fields */ diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c index 22f818ee8..bcef4ff3b 100644 --- a/ldap/servers/slapd/pw.c +++ b/ldap/servers/slapd/pw.c @@ -457,7 +457,7 @@ pw_rever_decode(char *cipher, char **plain, const char * attr_name) if ( pwsp->pws_dec != NULL ) { /* check that the prefix of the cipher is the same name - as the schema name */ + as the scheme name */ prefixOK = checkPrefix(cipher, pwsp->pws_name, &encrypt); if ( prefixOK == -1 ) { @@ -468,7 +468,7 @@ pw_rever_decode(char *cipher, char **plain, const char * attr_name) } else if ( prefixOK == 1 ) { - /* schema names are different */ + /* scheme names are different */ ret_code = -1; goto free_and_return; }
0
32d45c74231545ad91934147962bfb676dcdd391
389ds/389-ds-base
Ticket #48203 - Fix coverity issues - 06/22/2015 Description: 13294 Uninitialized scalar variable -- retrocl_init_trimming (introduced by #47669) 13293 Resource leak -- retrocl_init_trimming (introduced by #47669) 2. Defect type: CHECKED_RETURN 50. ldap/servers/slapd/tools/ldclt/ldapfct.c:1945: 9. ldap/servers/slapd/tools/ldclt/ldapfct.c:952: check_return: Calling "addErrorStat" without checking return value (as is done elsewhere 26 out of 28 times). 1. Defect type: COMPILER_WARNING 2. ldap/servers/slapd/daemon.c:1412:21: warning: 'tp' may be used uninitialized in this function [-Wmaybe-uninitialized] https://fedorahosted.org/389/ticket/48203 Reviewed by [email protected] (Thank you, Rich!!)
commit 32d45c74231545ad91934147962bfb676dcdd391 Author: Noriko Hosoi <[email protected]> Date: Tue Jun 23 14:48:13 2015 -0700 Ticket #48203 - Fix coverity issues - 06/22/2015 Description: 13294 Uninitialized scalar variable -- retrocl_init_trimming (introduced by #47669) 13293 Resource leak -- retrocl_init_trimming (introduced by #47669) 2. Defect type: CHECKED_RETURN 50. ldap/servers/slapd/tools/ldclt/ldapfct.c:1945: 9. ldap/servers/slapd/tools/ldclt/ldapfct.c:952: check_return: Calling "addErrorStat" without checking return value (as is done elsewhere 26 out of 28 times). 1. Defect type: COMPILER_WARNING 2. ldap/servers/slapd/daemon.c:1412:21: warning: 'tp' may be used uninitialized in this function [-Wmaybe-uninitialized] https://fedorahosted.org/389/ticket/48203 Reviewed by [email protected] (Thank you, Rich!!) diff --git a/ldap/servers/plugins/retrocl/retrocl_trim.c b/ldap/servers/plugins/retrocl/retrocl_trim.c index 65f3015de..b09f66923 100644 --- a/ldap/servers/plugins/retrocl/retrocl_trim.c +++ b/ldap/servers/plugins/retrocl/retrocl_trim.c @@ -412,7 +412,7 @@ void retrocl_housekeeping ( time_t cur_time, void *noarg ) void retrocl_init_trimming (void) { const char *cl_maxage; - time_t ageval; + time_t ageval = 0; /* Don't trim, by default */ const char *cl_trim_interval; cl_maxage = retrocl_get_config_str(CONFIG_CHANGELOG_MAXAGE_ATTRIBUTE); @@ -425,6 +425,7 @@ void retrocl_init_trimming (void) "retrocl_init_trimming: ignoring invalid %s value %s; " "not trimming retro changelog.\n", CONFIG_CHANGELOG_MAXAGE_ATTRIBUTE, cl_maxage); + slapi_ch_free_string((char **)&cl_maxage); return; } } diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c index 436f3d587..ba73da395 100644 --- a/ldap/servers/slapd/daemon.c +++ b/ldap/servers/slapd/daemon.c @@ -1026,7 +1026,7 @@ void slapd_daemon( daemon_ports_t *ports ) int threads; int in_referral_mode = config_check_referral_mode(); #ifdef ENABLE_NUNC_STANS - ns_thrpool_t *tp; + ns_thrpool_t *tp = NULL; struct ns_thrpool_config tp_config; #endif int connection_table_size = get_configured_connection_table_size(); diff --git a/ldap/servers/slapd/tools/ldclt/ldapfct.c b/ldap/servers/slapd/tools/ldclt/ldapfct.c index bc8c89da9..f906c5ace 100644 --- a/ldap/servers/slapd/tools/ldclt/ldapfct.c +++ b/ldap/servers/slapd/tools/ldclt/ldapfct.c @@ -949,7 +949,7 @@ connectToServer ( fprintf (stderr, "ldclt[%d]: T%03d: cannot ldap_unbind(), error=%d (%s)\n", mctx.pid, tttctx->thrdNum, ret,strerror (ret)); fflush (stderr); - addErrorStat(ret); + (void)addErrorStat(ret); return (-1); } tttctx->ldapCtx = NULL; @@ -1942,7 +1942,7 @@ createMissingNodes ( printf ("ldclt[%d]: T%03d: Cannot add (%s), error=%d (%s)\n", mctx.pid, tttctx->thrdNum, nodeDN, ret, my_ldap_err2string (ret)); fflush (stdout); - addErrorStat(ret); + (void)addErrorStat(ret); return (-1); }
0
1ac740761588600939d4fba31740227780022bb9
389ds/389-ds-base
Issue 50638 - RecursionError: maximum recursion depth exceeded while calling a Python object Bug Description: DSLdapObject has an overridden `__getattr__` method. In case the requested attribute doesn't exist, `getattr()` goes into an infitite recursive loop, only to be interrupted by a `RecursionError` exception. `rename()` method has one such lookup for a non-existent attribute, and it's not used at all. Fix Description: * Restore the default behaviour of `getattr()` when attribute doesn't exist. * Remove unneeded attribute lookup in `rename()`. Fixes: https://pagure.io/389-ds-base/issue/50638 Reviewed by: mreynolds, mhonek, firstyear (Thanks!)
commit 1ac740761588600939d4fba31740227780022bb9 Author: Viktor Ashirov <[email protected]> Date: Mon Oct 7 12:44:22 2019 +0200 Issue 50638 - RecursionError: maximum recursion depth exceeded while calling a Python object Bug Description: DSLdapObject has an overridden `__getattr__` method. In case the requested attribute doesn't exist, `getattr()` goes into an infitite recursive loop, only to be interrupted by a `RecursionError` exception. `rename()` method has one such lookup for a non-existent attribute, and it's not used at all. Fix Description: * Restore the default behaviour of `getattr()` when attribute doesn't exist. * Remove unneeded attribute lookup in `rename()`. Fixes: https://pagure.io/389-ds-base/issue/50638 Reviewed by: mreynolds, mhonek, firstyear (Thanks!) diff --git a/src/lib389/lib389/_mapped_object.py b/src/lib389/lib389/_mapped_object.py index 578dda026..e331b3b27 100644 --- a/src/lib389/lib389/_mapped_object.py +++ b/src/lib389/lib389/_mapped_object.py @@ -197,7 +197,7 @@ class DSLdapObject(DSLogging): pfunc = partial(self._jsonify, getattr(self, int_name)) return pfunc else: - getattr(self, name) + raise AttributeError("'%s' object has no attribute '%s'" % (self.__class__.__name__, name)) # We make this a property so that we can over-ride dynamically if needed @property @@ -765,7 +765,6 @@ class DSLdapObject(DSLogging): self._instance.rename_s(self._dn, new_rdn, newsuperior, serverctrls=self._server_controls, clientctrls=self._client_controls, delold=deloldrdn, escapehatch='i am sure') - search_base = self._basedn if newsuperior is not None: # Well, the new DN should be rdn + newsuperior. self._dn = '%s,%s' % (new_rdn, newsuperior)
0
6abf7efe20225f6398415be8225b4ec711e466e4
389ds/389-ds-base
Ticket 49024 - Fix paths to the dbdir parent Description: The parameter inst_dir was installed into defaults.inf with a wrong value. It had caused critical failures during lib389 deployment. Correct paths to use the dbdir parent. https://fedorahosted.org/389/ticket/49024 Reviewed by: wibrown (Thanks!)
commit 6abf7efe20225f6398415be8225b4ec711e466e4 Author: Simon Pichugin <[email protected]> Date: Mon Nov 7 20:45:09 2016 +0100 Ticket 49024 - Fix paths to the dbdir parent Description: The parameter inst_dir was installed into defaults.inf with a wrong value. It had caused critical failures during lib389 deployment. Correct paths to use the dbdir parent. https://fedorahosted.org/389/ticket/49024 Reviewed by: wibrown (Thanks!) diff --git a/src/lib389/lib389/__init__.py b/src/lib389/lib389/__init__.py index cfcc968c4..4eca12fac 100644 --- a/src/lib389/lib389/__init__.py +++ b/src/lib389/lib389/__init__.py @@ -1408,8 +1408,8 @@ class DirSrv(SimpleLDAPObject): # # previous db (it may exists new db files not in the backup) - log.debug("restoreFS: remove subtree %s/*" % self.inst_dir) - for root, dirs, files in os.walk(self.inst_dir): + log.debug("restoreFS: remove subtree %s/*" % os.path.dirname(self.dbdir)) + for root, dirs, files in os.walk(os.path.dirname(self.dbdir)): for d in dirs: if d not in ("bak", "ldif"): log.debug("restoreFS: before restore remove directory" + diff --git a/src/lib389/lib389/changelog.py b/src/lib389/lib389/changelog.py index 2570513f3..66ced8c7e 100644 --- a/src/lib389/lib389/changelog.py +++ b/src/lib389/lib389/changelog.py @@ -45,7 +45,7 @@ class Changelog(object): """ dn = DN_CHANGELOG attribute, changelog_name = dn.split(",")[0].split("=", 1) - dirpath = os.path.join(self.conn.inst_dir, dbname) + dirpath = os.path.join(os.path.dirname(self.conn.dbdir), dbname) entry = Entry(dn) entry.update({ 'objectclass': ("top", "extensibleobject"), diff --git a/src/lib389/lib389/tools.py b/src/lib389/lib389/tools.py index 9babf444e..10cc7aa48 100644 --- a/src/lib389/lib389/tools.py +++ b/src/lib389/lib389/tools.py @@ -370,8 +370,8 @@ class DirSrvTools(object): # # previous db (it may exists new db files not in the backup) - log.debug("instanceRestoreFS: remove subtree %s/*" % dirsrv.inst_dir) - for root, dirs, files in os.walk(dirsrv.inst_dir): + log.debug("instanceRestoreFS: remove subtree %s/*" % os.path.dirname(dirsrv.dbdir)) + for root, dirs, files in os.walk(os.path.dirname(dirsrv.dbdir)): for d in dirs: if d not in ("bak", "ldif"): log.debug(
0
9835e2b94e675f2c7b0922e1084e292f44f98c92
389ds/389-ds-base
Ticket 49027 - on secfailure do not store cleartext password content Bug Description: During development of the pbkdf2 module, I noticed that when the backend was unable to hash the password content, the password was stored as {CLEAR}<password> into the database. This may be considered a leak of password material as we write it clear text to disk. Fix Description: If the pw_enc callback from the password module returns any value except 0, we return an unwilling to perform, and generate an error to the error log. This prevents the leak, and notifies the admin and user of the issue quickly. https://fedorahosted.org/389/ticket/49027 Author: wibrown Review by: nhosoi (Thanks!)
commit 9835e2b94e675f2c7b0922e1084e292f44f98c92 Author: William Brown <[email protected]> Date: Wed Jan 11 13:16:48 2017 +1000 Ticket 49027 - on secfailure do not store cleartext password content Bug Description: During development of the pbkdf2 module, I noticed that when the backend was unable to hash the password content, the password was stored as {CLEAR}<password> into the database. This may be considered a leak of password material as we write it clear text to disk. Fix Description: If the pw_enc callback from the password module returns any value except 0, we return an unwilling to perform, and generate an error to the error log. This prevents the leak, and notifies the admin and user of the issue quickly. https://fedorahosted.org/389/ticket/49027 Author: wibrown Review by: nhosoi (Thanks!) diff --git a/ldap/servers/slapd/add.c b/ldap/servers/slapd/add.c index 8e671bbba..1b994a090 100644 --- a/ldap/servers/slapd/add.c +++ b/ldap/servers/slapd/add.c @@ -567,7 +567,11 @@ static void op_shared_add (Slapi_PBlock *pb) valuearray_add_valuearray(&unhashed_password_vals, present_values, 0); valuearray_add_valuearray(&vals, present_values, 0); - pw_encodevals_ext(pb, slapi_entry_get_sdn (e), vals); + if (pw_encodevals_ext(pb, slapi_entry_get_sdn (e), vals) != 0) { + slapi_log_err(SLAPI_LOG_CRIT, "op_shared_add", "Unable to hash userPassword attribute for %s.\n", slapi_entry_get_dn_const(e)); + send_ldap_result(pb, LDAP_UNWILLING_TO_PERFORM, NULL, "Unable to store attribute \"userPassword\" correctly\n", 0, NULL); + goto done; + } add_password_attrs(pb, operation, e); slapi_entry_attr_replace_sv(e, SLAPI_USERPWD_ATTR, vals); valuearray_free(&vals); diff --git a/ldap/servers/slapd/modify.c b/ldap/servers/slapd/modify.c index 51bf05752..4bef90abc 100644 --- a/ldap/servers/slapd/modify.c +++ b/ldap/servers/slapd/modify.c @@ -959,7 +959,11 @@ static void op_shared_modify (Slapi_PBlock *pb, int pw_change, char *old_pw) valuearray_init_bervalarray(pw_mod->mod_bvalues, &va); /* encode password */ - pw_encodevals_ext(pb, sdn, va); + if (pw_encodevals_ext(pb, sdn, va) ) { + slapi_log_err(SLAPI_LOG_CRIT, "op_shared_modify", "Unable to hash userPassword attribute for %s.\n", slapi_entry_get_dn_const(e)); + send_ldap_result(pb, LDAP_UNWILLING_TO_PERFORM, NULL, "Unable to store attribute \"userPassword\" correctly\n", 0, NULL); + goto free_and_return; + } /* remove current clear value of userpassword */ ber_bvecfree(pw_mod->mod_bvalues);
0
ae44ed4093ebd02910d23c82a31f13233e2b8c22
389ds/389-ds-base
Ticket 49204 - Fix lower bounds on import autosize + On small VM, autotune breaks the access of the suffixes Bug Description: ldif2db in some cases may set a cache of 0, which may y break imports. Under memory pressure, the amount of available memory at startup can be so low that the configured cachememsize will be rejected (unwilling to perform). This should leave the cachememsize being "0" (default) This conduct to be unable to access the suffix pages. Fix Description: * autosize set an incorrect percentage which was too high. * we did not check the lower bound of the allocation so we now set that we must have a minimum allocation. * Set entrycache to a minimal value, even if it looks insane * add a cap on reduction of caches, so we always allocate a few pages at least, and prevent returning 0 to the caller. https://pagure.io/389-ds-base/issue/49204 Author: wibrown, tbordaz Review by: tbordaz (Thanks mate, great work with this :) )
commit ae44ed4093ebd02910d23c82a31f13233e2b8c22 Author: William Brown <[email protected]> Date: Mon Apr 10 13:47:20 2017 +1000 Ticket 49204 - Fix lower bounds on import autosize + On small VM, autotune breaks the access of the suffixes Bug Description: ldif2db in some cases may set a cache of 0, which may y break imports. Under memory pressure, the amount of available memory at startup can be so low that the configured cachememsize will be rejected (unwilling to perform). This should leave the cachememsize being "0" (default) This conduct to be unable to access the suffix pages. Fix Description: * autosize set an incorrect percentage which was too high. * we did not check the lower bound of the allocation so we now set that we must have a minimum allocation. * Set entrycache to a minimal value, even if it looks insane * add a cap on reduction of caches, so we always allocate a few pages at least, and prevent returning 0 to the caller. https://pagure.io/389-ds-base/issue/49204 Author: wibrown, tbordaz Review by: tbordaz (Thanks mate, great work with this :) ) diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c index 26a96f684..22e5ffb03 100644 --- a/ldap/servers/slapd/back-ldbm/dblayer.c +++ b/ldap/servers/slapd/back-ldbm/dblayer.c @@ -1387,12 +1387,17 @@ dblayer_start(struct ldbminfo *li, int dbmode) /* Sanity check on cache size on platforms which allow us to figure out * the available phys mem */ slapi_pal_meminfo *mi = spal_meminfo_get(); - if (!util_is_cachesize_sane(mi, &(priv->dblayer_cachesize))) { + util_cachesize_result result = util_is_cachesize_sane(mi, &(priv->dblayer_cachesize)); + if (result == UTIL_CACHESIZE_ERROR) { + slapi_log_err(SLAPI_LOG_CRIT, "dblayer_start", "Unable to determine if cachesize was valid!!!"); + } else if (result == UTIL_CACHESIZE_REDUCED) { + /* In some cases we saw this go to 0, prevent this. */ + if (priv->dblayer_cachesize < MINCACHESIZE) { + priv->dblayer_cachesize = MINCACHESIZE; + } /* Oops---looks like the admin misconfigured, let's warn them */ - slapi_log_err(SLAPI_LOG_WARNING,"dblayer_start", "Likely CONFIGURATION ERROR -" - "dbcachesize is configured to use more than the available " - "physical memory, decreased to the largest available size (%"PRIu64" bytes).\n", - priv->dblayer_cachesize); + slapi_log_err(SLAPI_LOG_WARNING, "dblayer_start", "Likely CONFIGURATION ERROR - dbcachesize is configured to use more than the available " + "memory, decreased to (%"PRIu64" bytes).\n", priv->dblayer_cachesize); li->li_dbcachesize = priv->dblayer_cachesize; } spal_meminfo_destroy(mi); diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c index 12c79d55d..585f9efd5 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_config.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c @@ -1720,9 +1720,9 @@ static config_info ldbm_config[] = { {CONFIG_DB_DEBUG_CHECKPOINTING, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_debug_checkpointing_get, &ldbm_config_db_debug_checkpointing_set, 0}, {CONFIG_DB_HOME_DIRECTORY, CONFIG_TYPE_STRING, "", &ldbm_config_db_home_directory_get, &ldbm_config_db_home_directory_set, 0}, {CONFIG_IMPORT_CACHE_AUTOSIZE, CONFIG_TYPE_INT, "-1", &ldbm_config_import_cache_autosize_get, &ldbm_config_import_cache_autosize_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE}, - {CONFIG_CACHE_AUTOSIZE, CONFIG_TYPE_INT, "0", &ldbm_config_cache_autosize_get, &ldbm_config_cache_autosize_set, 0}, + {CONFIG_CACHE_AUTOSIZE, CONFIG_TYPE_INT, "10", &ldbm_config_cache_autosize_get, &ldbm_config_cache_autosize_set, 0}, {CONFIG_CACHE_AUTOSIZE_SPLIT, CONFIG_TYPE_INT, "40", &ldbm_config_cache_autosize_split_get, &ldbm_config_cache_autosize_split_set, 0}, - {CONFIG_IMPORT_CACHESIZE, CONFIG_TYPE_SIZE_T, "20000000", &ldbm_config_import_cachesize_get, &ldbm_config_import_cachesize_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE}, + {CONFIG_IMPORT_CACHESIZE, CONFIG_TYPE_SIZE_T, "16777216", &ldbm_config_import_cachesize_get, &ldbm_config_import_cachesize_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE}, {CONFIG_IDL_SWITCH, CONFIG_TYPE_STRING, "new", &ldbm_config_idl_get_idl_new, &ldbm_config_idl_set_tune, CONFIG_FLAG_ALWAYS_SHOW}, {CONFIG_IDL_UPDATE, CONFIG_TYPE_ONOFF, "on", &ldbm_config_idl_get_update, &ldbm_config_idl_set_update, 0}, {CONFIG_BYPASS_FILTER_TEST, CONFIG_TYPE_STRING, "on", &ldbm_config_get_bypass_filter_test, &ldbm_config_set_bypass_filter_test, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE}, diff --git a/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c b/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c index e2cf544e4..d7c3c0841 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c @@ -101,6 +101,7 @@ ldbm_instance_config_cachememsize_set(void *arg, int retval = LDAP_SUCCESS; size_t val = (size_t) value; uint64_t delta = 0; + uint64_t delta_original = 0; /* Do whatever we can to make sure the data is ok. */ /* There is an error here. We check the new val against our current mem-alloc @@ -116,18 +117,34 @@ ldbm_instance_config_cachememsize_set(void *arg, if (apply) { if (val > inst->inst_cache.c_maxsize) { delta = val - inst->inst_cache.c_maxsize; + delta_original = delta; util_cachesize_result sane; slapi_pal_meminfo *mi = spal_meminfo_get(); sane = util_is_cachesize_sane(mi, &delta); spal_meminfo_destroy(mi); - if (sane != UTIL_CACHESIZE_VALID){ - slapi_create_errormsg(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: cachememsize value is too large."); - slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_config_cachememsize_set", "cachememsize value is too large.\n"); + if (sane == UTIL_CACHESIZE_ERROR){ + slapi_create_errormsg(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: unable to determine system memory limits."); + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_config_cachememsize_set", "Enable to determine system memory limits.\n"); return LDAP_UNWILLING_TO_PERFORM; + } else if (sane == UTIL_CACHESIZE_REDUCED) { + slapi_log_err(SLAPI_LOG_WARNING, "ldbm_instance_config_cachememsize_set", "delta +%"PRIu64" of request %"PRIu64" reduced to %"PRIu64"\n", delta_original, val, delta); + /* + * This works as: value = 100 + * delta_original to inst, 20; + * delta reduced to 5: + * 100 - (20 - 5) == 85; + * so if you recalculated delta now (val - inst), it would be 5. + */ + val = val - (delta_original - delta); } } + if (inst->inst_cache.c_maxsize < MINCACHESIZE || val < MINCACHESIZE) { + slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_config_cachememsize_set", "force a minimal value %"PRIu64"\n", MINCACHESIZE); + /* This value will trigger an autotune next start up, but it should increase only */ + val = MINCACHESIZE; + } cache_set_max_size(&(inst->inst_cache), val, CACHE_TYPE_ENTRY); } diff --git a/ldap/servers/slapd/util.c b/ldap/servers/slapd/util.c index 012e83d4f..4ff6d4141 100644 --- a/ldap/servers/slapd/util.c +++ b/ldap/servers/slapd/util.c @@ -1468,16 +1468,26 @@ util_is_cachesize_sane(slapi_pal_meminfo *mi, uint64_t *cachesize) return UTIL_CACHESIZE_ERROR; } + util_cachesize_result result = UTIL_CACHESIZE_VALID; slapi_log_err(SLAPI_LOG_TRACE, "util_is_cachesize_sane", "Available bytes %"PRIu64", requested bytes %"PRIu64"\n", mi->system_available_bytes, *cachesize); if (*cachesize > mi->system_available_bytes) { - /* Since we are ask for more than what's available, we give 3/4 of the remaining. + /* Since we are ask for more than what's available, we give 1/2 of the remaining. * the remaining system mem to the cachesize instead, and log a warning */ - *cachesize = (mi->system_available_bytes * 0.75); - slapi_log_err(SLAPI_LOG_TRACE, "util_is_cachesize_sane", "Adjusted cachesize to %"PRIu64"\n", *cachesize); - return UTIL_CACHESIZE_REDUCED; + uint64_t adjust_cachesize = (mi->system_available_bytes * 0.5); + if (adjust_cachesize > *cachesize) { + slapi_log_err(SLAPI_LOG_CRIT, "util_is_cachesize_sane", "Invalid adjusted cachesize is greater than request %"PRIu64, adjust_cachesize); + return UTIL_CACHESIZE_ERROR; + } + if (adjust_cachesize < (16 * mi->pagesize_bytes)) { + /* At minimum respond with 16 pages - that's 64k on x86_64 */ + adjust_cachesize = 16 * mi->pagesize_bytes; + } + *cachesize = adjust_cachesize; + slapi_log_err(SLAPI_LOG_TRACE, "util_is_cachesize_sane", "Adjusted cachesize down to %"PRIu64"\n", *cachesize); + result = UTIL_CACHESIZE_REDUCED; } - return UTIL_CACHESIZE_VALID; + return result; } long
0
71138c046a04ca97abe54dd55da8f6e3fe84a967
389ds/389-ds-base
Issue 50462 - Fix Root DN access control plugin CI tests Description: Port CI test to use DSLDapObject instead of raw types, and add sleeps after every config change. Also increased replication timeout in the referint_plugin test. related: https://pagure.io/389-ds-base/issue/50462 Reviewed by: vashirov(thanks!)
commit 71138c046a04ca97abe54dd55da8f6e3fe84a967 Author: Mark Reynolds <[email protected]> Date: Mon Jun 24 13:49:32 2019 -0400 Issue 50462 - Fix Root DN access control plugin CI tests Description: Port CI test to use DSLDapObject instead of raw types, and add sleeps after every config change. Also increased replication timeout in the referint_plugin test. related: https://pagure.io/389-ds-base/issue/50462 Reviewed by: vashirov(thanks!) diff --git a/dirsrvtests/tests/suites/plugins/rootdn_plugin_test.py b/dirsrvtests/tests/suites/plugins/rootdn_plugin_test.py index 4bdcfa64e..56f1b04bc 100644 --- a/dirsrvtests/tests/suites/plugins/rootdn_plugin_test.py +++ b/dirsrvtests/tests/suites/plugins/rootdn_plugin_test.py @@ -11,14 +11,17 @@ import socket import ldap import pytest import uuid +import time +from lib389 import DirSrv from lib389.utils import * from lib389.tasks import * from lib389.tools import DirSrvTools from lib389.topologies import topology_st from lib389._constants import DEFAULT_SUFFIX, DN_DM, PASSWORD -from lib389.idm.user import UserAccounts, TEST_USER_PROPERTIES +from lib389.idm.directorymanager import DirectoryManager from lib389.plugins import RootDNAccessControlPlugin + pytestmark = pytest.mark.tier1 logging.getLogger(__name__).setLevel(logging.DEBUG) @@ -51,43 +54,32 @@ def rootdn_setup(topology_st): - Allowed host * - Denied host * - * means mulitple valued + * means multiple valued """ log.info('Initializing root DN test suite...') - global inst - inst = topology_st.standalone - # - # Set an aci so we can modify the plugin after we deny the Root DN - # - ACI = ('(target ="ldap:///cn=config")(targetattr = "*")(version 3.0' + - ';acl "all access";allow (all)(userdn="ldap:///anyone");)') - assert inst.config.set('aci', ACI) - - # - # Create a user to modify the config - # - users = UserAccounts(inst, DEFAULT_SUFFIX) - TEST_USER_PROPERTIES['userpassword'] = PASSWORD - global user - user = users.create(properties=TEST_USER_PROPERTIES) - - # # Enable dynamic plugins - # - assert inst.config.set('nsslapd-dynamic-plugins', 'on') + topology_st.standalone.config.set('nsslapd-dynamic-plugins', 'on') - # - # Enable the plugin (after enabling dynamic plugins) - # + # Enable the plugin global plugin - plugin = RootDNAccessControlPlugin(inst) + plugin = RootDNAccessControlPlugin(topology_st.standalone) plugin.enable() log.info('test_rootdn_init: Initialized root DN test suite.') +def rootdn_bind(inst, uri=None, fail=False): + """Helper function to test root DN bind + """ + newinst = DirSrv(verbose=False) + args = {SER_PORT: inst.port, + SER_SERVERID_PROP: inst.serverid} + newinst.allocate(args) + newinst.open(uri=uri, connOnly=True) # This binds as root dn + + def test_rootdn_access_specific_time(topology_st, rootdn_setup, rootdn_cleanup): """Test binding inside and outside of a specific time @@ -108,6 +100,7 @@ def test_rootdn_access_specific_time(topology_st, rootdn_setup, rootdn_cleanup): """ log.info('Running test_rootdn_access_specific_time...') + dm = DirectoryManager(topology_st.standalone) # Get the current time, and bump it ahead twohours current_hour = time.strftime("%H") @@ -120,27 +113,19 @@ def test_rootdn_access_specific_time(topology_st, rootdn_setup, rootdn_cleanup): assert plugin.replace_many(('rootdn-open-time', open_time), ('rootdn-close-time', close_time)) + time.sleep(.5) - # # Bind as Root DN - should fail - # with pytest.raises(ldap.UNWILLING_TO_PERFORM): - inst.simple_bind_s(DN_DM, PASSWORD) + dm.bind() - # # Set config to allow the entire day - # - assert inst.simple_bind_s(user.dn, PASSWORD) - assert plugin.replace_many(('rootdn-open-time', '0000'), ('rootdn-close-time', '2359')) + time.sleep(.5) + dm.bind() - assert inst.simple_bind_s(DN_DM, PASSWORD) - - # # Cleanup - undo the changes we made so the next test has a clean slate - # - assert plugin.apply_mods([(ldap.MOD_DELETE, 'rootdn-open-time'), (ldap.MOD_DELETE, 'rootdn-close-time')]) @@ -163,6 +148,7 @@ def test_rootdn_access_day_of_week(topology_st, rootdn_setup, rootdn_cleanup): """ log.info('Running test_rootdn_access_day_of_week...') + dm = DirectoryManager(topology_st.standalone) days = ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat') day = int(time.strftime("%w", time.gmtime())) @@ -182,24 +168,20 @@ def test_rootdn_access_day_of_week(topology_st, rootdn_setup, rootdn_cleanup): log.info('Allowed days: ' + allow_days) log.info('Deny days: ' + deny_days) - # # Set the deny days - # plugin.set_days_allowed(deny_days) + time.sleep(.5) # # Bind as Root DN - should fail # with pytest.raises(ldap.UNWILLING_TO_PERFORM): - inst.simple_bind_s(DN_DM, PASSWORD) + dm.bind() - # # Set the allow days - # - assert inst.simple_bind_s(user.dn, PASSWORD) plugin.set_days_allowed(allow_days) - - assert inst.simple_bind_s(DN_DM, PASSWORD) + time.sleep(.5) + dm.bind() def test_rootdn_access_denied_ip(topology_st, rootdn_setup, rootdn_cleanup): @@ -222,23 +204,19 @@ def test_rootdn_access_denied_ip(topology_st, rootdn_setup, rootdn_cleanup): log.info('Running test_rootdn_access_denied_ip...') plugin.add_deny_ip('127.0.0.1') plugin.add_deny_ip('::1') + time.sleep(.5) - # # Bind as Root DN - should fail - # - conn = ldap.initialize('ldap://{}:{}'.format('127.0.0.1', inst.port)) + uri = 'ldap://{}:{}'.format('127.0.0.1', topology_st.standalone.port) with pytest.raises(ldap.UNWILLING_TO_PERFORM): - conn.simple_bind_s(DN_DM, PASSWORD) + rootdn_bind(topology_st.standalone, uri=uri) - # # Change the denied IP so root DN succeeds - # - assert inst.simple_bind_s(user.dn, PASSWORD) - plugin.apply_mods([(ldap.MOD_REPLACE, 'rootdn-deny-ip', '255.255.255.255')]) + time.sleep(.5) - conn = ldap.initialize('ldap://{}:{}'.format('127.0.0.1', inst.port)) - assert conn.simple_bind_s(DN_DM, PASSWORD) + # Bind should succeed + rootdn_bind(topology_st.standalone, uri=uri) def test_rootdn_access_denied_host(topology_st, rootdn_setup, rootdn_cleanup): @@ -263,22 +241,19 @@ def test_rootdn_access_denied_host(topology_st, rootdn_setup, rootdn_cleanup): plugin.add_deny_host(hostname) if localhost != hostname: plugin.add_deny_host(localhost) + time.sleep(.5) - # # Bind as Root DN - should fail - # - conn = ldap.initialize('ldap://{}:{}'.format(localhost, inst.port)) + uri = 'ldap://{}:{}'.format(localhost, topology_st.standalone.port) with pytest.raises(ldap.UNWILLING_TO_PERFORM): - conn.simple_bind_s(DN_DM, PASSWORD) + rootdn_bind(topology_st.standalone, uri=uri) - # # Change the denied host so root DN succeeds - # - assert inst.simple_bind_s(user.dn, PASSWORD) plugin.apply_mods([(ldap.MOD_REPLACE, 'rootdn-deny-host', 'i.dont.exist.{}'.format(uuid.uuid4()))]) + time.sleep(.5) - conn = ldap.initialize('ldap://{}:{}'.format(hostname, inst.port)) - assert conn.simple_bind_s(DN_DM, PASSWORD) + # Bind should succeed + rootdn_bind(topology_st.standalone, uri=uri) def test_rootdn_access_allowed_ip(topology_st, rootdn_setup, rootdn_cleanup): @@ -300,27 +275,22 @@ def test_rootdn_access_allowed_ip(topology_st, rootdn_setup, rootdn_cleanup): log.info('Running test_rootdn_access_allowed_ip...') - # # Set allowed ip to 255.255.255.255 - blocks the Root DN - # plugin.add_allow_ip('255.255.255.255') + time.sleep(.5) - # # Bind as Root DN - should fail - # - conn = ldap.initialize('ldap://{}:{}'.format(localhost, inst.port)) + uri = 'ldap://{}:{}'.format(localhost, topology_st.standalone.port) with pytest.raises(ldap.UNWILLING_TO_PERFORM): - conn.simple_bind_s(DN_DM, PASSWORD) + rootdn_bind(topology_st.standalone, uri=uri) - # # Allow localhost - # - assert inst.simple_bind_s(user.dn, PASSWORD) plugin.add_allow_ip('127.0.0.1') plugin.add_allow_ip('::1') + time.sleep(.5) - conn = ldap.initialize('ldap://{}:{}'.format(localhost, inst.port)) - assert conn.simple_bind_s(DN_DM, PASSWORD) + # Bind should succeed + rootdn_bind(topology_st.standalone, uri=uri) def test_rootdn_access_allowed_host(topology_st, rootdn_setup, rootdn_cleanup): @@ -342,29 +312,25 @@ def test_rootdn_access_allowed_host(topology_st, rootdn_setup, rootdn_cleanup): log.info('Running test_rootdn_access_allowed_host...') - # # Set allowed host to an unknown host - blocks the Root DN - # plugin.add_allow_host('i.dont.exist.{}'.format(uuid.uuid4())) + time.sleep(.5) - # # Bind as Root DN - should fail - # - conn = ldap.initialize('ldap://{}:{}'.format(localhost, inst.port)) + uri = 'ldap://{}:{}'.format(localhost, topology_st.standalone.port) with pytest.raises(ldap.UNWILLING_TO_PERFORM): - conn.simple_bind_s(DN_DM, PASSWORD) + rootdn_bind(topology_st.standalone, uri=uri) - # # Allow localhost - # - assert inst.simple_bind_s(user.dn, PASSWORD) plugin.remove_all_allow_host() plugin.add_allow_host(localhost) if hostname != localhost: plugin.add_allow_host(hostname) + time.sleep(.5) + + # Bind should succeed + rootdn_bind(topology_st.standalone, uri=uri) - conn = ldap.initialize('ldap://{}:{}'.format(localhost, inst.port)) - assert conn.simple_bind_s(DN_DM, PASSWORD) def test_rootdn_config_validate(topology_st, rootdn_setup, rootdn_cleanup): """Test plugin configuration validation @@ -421,9 +387,7 @@ def test_rootdn_config_validate(topology_st, rootdn_setup, rootdn_cleanup): 23. Should fail """ - # - # Test rootdn-open-time - # + # Test invalid values for all settings with pytest.raises(ldap.UNWILLING_TO_PERFORM): log.info('Add just "rootdn-open-time"') plugin.apply_mods([(ldap.MOD_REPLACE, 'rootdn-open-time', '0000')]) @@ -444,10 +408,7 @@ def test_rootdn_config_validate(topology_st, rootdn_setup, rootdn_cleanup): plugin.apply_mods([(ldap.MOD_REPLACE, 'rootdn-open-time','aaaaa'), (ldap.MOD_REPLACE, 'rootdn-close-time', '0000')]) - - # - # Test rootdn-close-time - # + # Test rootdn-close-time log.info('Add just "rootdn-close-time"') plugin.apply_mods([(ldap.MOD_REPLACE, 'rootdn-close-time', '0000')]) @@ -467,10 +428,7 @@ def test_rootdn_config_validate(topology_st, rootdn_setup, rootdn_cleanup): plugin.apply_mods([(ldap.MOD_REPLACE, 'rootdn-open-time','0000'), (ldap.MOD_REPLACE, 'rootdn-close-time','aaaaa')]) - - # - # Test days allowed - # + # Test days allowed log.info('Add multiple "rootdn-days-allowed"') plugin.apply_mods([(ldap.MOD_ADD, 'rootdn-days-allowed', 'Mon'), (ldap.MOD_ADD, 'rootdn-days-allowed', 'Tue')]) @@ -481,31 +439,23 @@ def test_rootdn_config_validate(topology_st, rootdn_setup, rootdn_cleanup): plugin.apply_mods([(ldap.MOD_REPLACE, 'rootdn-days-allowed', 'm111m')]) plugin.apply_mods([(ldap.MOD_REPLACE, 'rootdn-days-allowed', 'Gur')]) - # - # Test allow ips - # + # Test allow ips log.info('Add invalid "rootdn-allow-ip"') plugin.apply_mods([(ldap.MOD_REPLACE, 'rootdn-allow-ip', '12.12.Z.12')]) plugin.apply_mods([(ldap.MOD_REPLACE, 'rootdn-allow-ip', '123.234.345.456')]) plugin.apply_mods([(ldap.MOD_REPLACE, 'rootdn-allow-ip', ':::')]) - # - # Test deny ips - # + # Test deny ips log.info('Add invalid "rootdn-deny-ip"') plugin.apply_mods([(ldap.MOD_REPLACE, 'rootdn-deny-ip', '12.12.Z.12')]) plugin.apply_mods([(ldap.MOD_REPLACE, 'rootdn-deny-ip', '123.234.345.456')]) plugin.apply_mods([(ldap.MOD_REPLACE, 'rootdn-deny-ip', ':::')]) - # - # Test allow hosts - # + # Test allow hosts log.info('Add invalid "rootdn-allow-host"') plugin.apply_mods([(ldap.MOD_REPLACE, 'rootdn-allow-host', 'host._.com')]) - # - # Test deny hosts - # + # Test deny hosts log.info('Add invalid "rootdn-deny-host"') plugin.apply_mods([(ldap.MOD_REPLACE, 'rootdn-deny-host', 'host.####.com')]) diff --git a/dirsrvtests/tests/suites/referint_plugin/rename_test.py b/dirsrvtests/tests/suites/referint_plugin/rename_test.py index 073dc1548..43307b53a 100644 --- a/dirsrvtests/tests/suites/referint_plugin/rename_test.py +++ b/dirsrvtests/tests/suites/referint_plugin/rename_test.py @@ -148,7 +148,7 @@ def test_rename_large_subtree(topology_m2): assert len(members) == UCOUNT # Wait for replication - repl.wait_for_replication(st, m2) + repl.wait_for_replication(st, m2, timeout=60) for i in range(0, 5): # Move ou=s1 to ou=account as parent. We have to provide the rdn, @@ -169,7 +169,7 @@ def test_rename_large_subtree(topology_m2): assert 'ou=int' in member # Check everythig on the other side is good. - repl.wait_for_replication(st, m2) + repl.wait_for_replication(st, m2, timeout=60) group2 = Groups(m2, DEFAULT_SUFFIX).get('default_group')
0
ada2dfdd40032fbbfc1f8cd00c2f7e27374febe7
389ds/389-ds-base
Issue 50152 - Replace os.getenv('HOME') with os.path.expanduser Description: When HOME env var is not set, the call will fail with an exception. Instead of HOME we can use expanduser method. The expanduser will do the right thing and get home directory on all platforms from either env vars or password database. https://pagure.io/389-ds-base/issue/50152 Reviewed by: mreynolds, wibrown (Thanks!)
commit ada2dfdd40032fbbfc1f8cd00c2f7e27374febe7 Author: Simon Pichugin <[email protected]> Date: Mon Jan 14 19:10:31 2019 +0100 Issue 50152 - Replace os.getenv('HOME') with os.path.expanduser Description: When HOME env var is not set, the call will fail with an exception. Instead of HOME we can use expanduser method. The expanduser will do the right thing and get home directory on all platforms from either env vars or password database. https://pagure.io/389-ds-base/issue/50152 Reviewed by: mreynolds, wibrown (Thanks!) diff --git a/src/lib389/lib389/__init__.py b/src/lib389/lib389/__init__.py index 0b08ef2ba..bd5e86a1a 100644 --- a/src/lib389/lib389/__init__.py +++ b/src/lib389/lib389/__init__.py @@ -778,7 +778,7 @@ class DirSrv(SimpleLDAPObject, object): # first identify the directories we will scan sysconfig_head = self.ds_paths.initconfig_dir - privconfig_head = os.path.join(os.getenv('HOME'), ENV_LOCAL_DIR) + privconfig_head = os.path.expanduser(os.path.join('~', ENV_LOCAL_DIR)) if not os.path.isdir(sysconfig_head): privconfig_head = None self.log.debug("dir (sys) : %s", sysconfig_head)
0
16c994ace5d2eb635bf3847b5fe4c96c46fdd8a2
389ds/389-ds-base
Resolves: bug 469261 Bug Description: Support server-to-server SASL - part 2 Reviewed by: nhosoi (Thanks!) Fix Description: This part focuses on chaining backend - allowing the mux server to use SASL to connect to the farm server, and allowing SASL authentication to chain. I had to add two new config parameters for chaining: nsUseStartTLS - on or off - tell connection to use startTLS - default is off nsBindMechanism - if absent, will just use simple auth. If present, this must be one of the supported mechanisms (EXTERNAL, GSSAPI, DIGEST-MD5) - default is absent (simple bind) The chaining code uses a timeout, so I had to add a timeout to slapi_ldap_bind, and correct the replication code to pass in a NULL for the timeout parameter. Fixed a bug in the starttls code in slapi_ldap_init_ext. The sasl code uses an internal search to find the entry corresponding to the sasl user id. This search could not be chained due to the way it was coded. So I added a new chainable component called cn=sasl and changed the sasl internal search code to use this component ID. This allows the sasl code to work with a chained backend. In order to use chaining with sasl, this component must be set in the chaining configuration nsActiveChainingComponents. I also discovered that password policy must be configured too, in order for the sasl code to determine if the account is locked out. I fixed a bug in the sasl mapping debug trace code. Still to come - sasl mappings to work with all of this new code - kerberos code improvements - changes to pta and dna Platforms tested: Fedora 8, Fedora 9 Flag Day: yes Doc impact: yes
commit 16c994ace5d2eb635bf3847b5fe4c96c46fdd8a2 Author: Rich Megginson <[email protected]> Date: Wed Nov 5 18:21:06 2008 +0000 Resolves: bug 469261 Bug Description: Support server-to-server SASL - part 2 Reviewed by: nhosoi (Thanks!) Fix Description: This part focuses on chaining backend - allowing the mux server to use SASL to connect to the farm server, and allowing SASL authentication to chain. I had to add two new config parameters for chaining: nsUseStartTLS - on or off - tell connection to use startTLS - default is off nsBindMechanism - if absent, will just use simple auth. If present, this must be one of the supported mechanisms (EXTERNAL, GSSAPI, DIGEST-MD5) - default is absent (simple bind) The chaining code uses a timeout, so I had to add a timeout to slapi_ldap_bind, and correct the replication code to pass in a NULL for the timeout parameter. Fixed a bug in the starttls code in slapi_ldap_init_ext. The sasl code uses an internal search to find the entry corresponding to the sasl user id. This search could not be chained due to the way it was coded. So I added a new chainable component called cn=sasl and changed the sasl internal search code to use this component ID. This allows the sasl code to work with a chained backend. In order to use chaining with sasl, this component must be set in the chaining configuration nsActiveChainingComponents. I also discovered that password policy must be configured too, in order for the sasl code to determine if the account is locked out. I fixed a bug in the sasl mapping debug trace code. Still to come - sasl mappings to work with all of this new code - kerberos code improvements - changes to pta and dna Platforms tested: Fedora 8, Fedora 9 Flag Day: yes Doc impact: yes diff --git a/ldap/ldif/template-dse.ldif.in b/ldap/ldif/template-dse.ldif.in index 1767cfbe1..98aa21af8 100644 --- a/ldap/ldif/template-dse.ldif.in +++ b/ldap/ldif/template-dse.ldif.in @@ -752,6 +752,9 @@ nsTransmittedControls: 1.2.840.113556.1.4.473 nsTransmittedControls: 1.3.6.1.4.1.1466.29539.12 nsPossibleChainingComponents: cn=resource limits,cn=components,cn=config nsPossibleChainingComponents: cn=certificate-based authentication,cn=components,cn=config +nsPossibleChainingComponents: cn=password policy,cn=components,cn=config +nsPossibleChainingComponents: cn=sasl,cn=components,cn=config +nsPossibleChainingComponents: cn=roles,cn=components,cn=config nsPossibleChainingComponents: cn=ACL Plugin,cn=plugins,cn=config nsPossibleChainingComponents: cn=old plugin,cn=plugins,cn=config nsPossibleChainingComponents: cn=referential integrity postoperation,cn=plugins,cn=config diff --git a/ldap/servers/plugins/chainingdb/cb.h b/ldap/servers/plugins/chainingdb/cb.h index ef39ab268..a8e449850 100644 --- a/ldap/servers/plugins/chainingdb/cb.h +++ b/ldap/servers/plugins/chainingdb/cb.h @@ -114,8 +114,10 @@ #define CB_CONFIG_SIZELIMIT "nsslapd-sizelimit" #define CB_CONFIG_TIMELIMIT "nsslapd-timelimit" #define CB_CONFIG_HOSTURL "nsFarmServerURL" +#define CB_CONFIG_STARTTLS "nsUseStartTLS" #define CB_CONFIG_BINDUSER "nsMultiplexorBindDn" +#define CB_CONFIG_BINDMECH "nsBindMechanism" #define CB_CONFIG_USERPASSWORD "nsMultiplexorCredentials" #define CB_CONFIG_MAXBINDCONNECTIONS "nsBindConnectionsLimit" #define CB_CONFIG_MAXCONNECTIONS "nsOperationConnectionsLimit" @@ -163,6 +165,8 @@ #define CB_DEF_HOPLIMIT "10" /* CB_CONFIG_HOPLIMIT */ #define CB_DEF_MAX_IDLE_TIME "60" /* CB_CONFIG_MAX_IDLE_TIME */ #define CB_DEF_MAX_TEST_TIME "15" /* CB_CONFIG_MAX_TEST_TIME */ +#define CB_DEF_STARTTLS "off" /* CB_CONFIG_STARTTLS */ +#define CB_DEF_BINDMECH LDAP_SASL_SIMPLE /* CB_CONFIG_BINDMECH */ typedef void *cb_config_get_fn_t(void *arg); typedef int cb_config_set_fn_t(void *arg, void *value, char *errorbuf, int phase, int apply); @@ -290,6 +294,8 @@ typedef struct { /* To protect the config set by LDAP */ PRRWLock * rwl_config_lock; + int starttls; /* use starttls with connection */ + char *mech; /* plain, external, or a sasl mech */ } cb_conn_pool; diff --git a/ldap/servers/plugins/chainingdb/cb_conn_stateless.c b/ldap/servers/plugins/chainingdb/cb_conn_stateless.c index adc87ff07..41d7f243a 100644 --- a/ldap/servers/plugins/chainingdb/cb_conn_stateless.c +++ b/ldap/servers/plugins/chainingdb/cb_conn_stateless.c @@ -164,6 +164,7 @@ int cb_get_connection(cb_conn_pool * pool, LDAP ** lld, cb_outgoing_conn ** cc,s char *password,*binddn,*hostname; unsigned int port; int secure; + char *mech = NULL;; static char *error1="Can't contact remote server : %s"; static char *error2="Can't bind to remote server : %s"; int isMultiThread = ENABLE_MULTITHREAD_PER_CONN ; /* by default, we enable multiple operations per connection */ @@ -199,6 +200,10 @@ int cb_get_connection(cb_conn_pool * pool, LDAP ** lld, cb_outgoing_conn ** cc,s hostname=pool->hostname; port=pool->port; secure=pool->secure; + if (pool->starttls) { + secure = 2; + } + mech=pool->mech; PR_RWLock_Unlock(pool->rwl_config_lock); @@ -348,12 +353,8 @@ int cb_get_connection(cb_conn_pool * pool, LDAP ** lld, cb_outgoing_conn ** cc,s /* For now, bind even if no user to detect error */ /* earlier */ if (pool->bindit) { - int msgid; - LDAPMessage *res=NULL; - int parse_rc; PRErrorCode prerr = 0; LDAPControl **serverctrls=NULL; - char **referrals=NULL; char *plain = NULL; int ret = -1; @@ -381,14 +382,21 @@ int cb_get_connection(cb_conn_pool * pool, LDAP ** lld, cb_outgoing_conn ** cc,s } /* Password-based client authentication */ + rc = slapi_ldap_bind(ld, binddn, plain, mech, NULL, &serverctrls, + &bind_to, NULL); - if (( msgid = ldap_simple_bind( ld, binddn, plain)) <0) { - rc=ldap_get_lderrno( ld, NULL, NULL ); - prerr=PR_GetError(); - } if ( ret == 0 ) slapi_ch_free_string(&plain); /* free plain only if it has been duplicated */ - if ( rc != LDAP_SUCCESS ) { + if ( rc == LDAP_TIMEOUT ) { + if (cb_debug_on()) { + slapi_log_error( SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, + "Can't bind to server <%s> port <%d>. (%s)\n", + hostname, port, "time-out expired"); + } + rc = LDAP_CONNECT_ERROR; + goto unlock_and_return; + } else if ( rc != LDAP_SUCCESS ) { + prerr=PR_GetError(); if (cb_debug_on()) { slapi_log_error( SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "Can't bind to server <%s> port <%d>. " @@ -405,67 +413,11 @@ int cb_get_connection(cb_conn_pool * pool, LDAP ** lld, cb_outgoing_conn ** cc,s goto unlock_and_return; } - rc = ldap_result( ld, msgid, 0, &bind_to, &res ); - switch (rc) { - case -1: - rc = ldap_get_lderrno( ld, NULL, NULL ); - if (cb_debug_on()) { - slapi_log_error( SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, - "Can't bind to server <%s> port <%d>. " - "(LDAP error %d - %s; " - SLAPI_COMPONENT_NAME_NSPR " error %d - %s)\n", - hostname, port, rc, - ldap_err2string(rc), - prerr, slapd_pr_strerror(prerr)); - } - if ( errmsg ) { - *errmsg = PR_smprintf(error2,ldap_err2string(rc)); - } - rc = LDAP_CONNECT_ERROR; - goto unlock_and_return; - case 0: - if (cb_debug_on()) { - slapi_log_error( SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, - "Can't bind to server <%s> port <%d>. (%s)\n", - hostname, port, "time-out expired"); - } - rc = LDAP_CONNECT_ERROR; - goto unlock_and_return; - default: - - parse_rc = ldap_parse_result( ld, res, &rc, NULL, - NULL, &referrals, &serverctrls, 1 ); - - if ( parse_rc != LDAP_SUCCESS ) { - if (cb_debug_on()) { - slapi_log_error( SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, - "Can't bind to server <%s> port <%d>. (%s)\n", - hostname, port, ldap_err2string(parse_rc)); - } - if ( errmsg ) { - *errmsg = PR_smprintf(error2,ldap_err2string(parse_rc)); - } - rc = parse_rc; - goto unlock_and_return; - } - - if ( rc != LDAP_SUCCESS ) { - if (cb_debug_on()) { - slapi_log_error( SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, - "Can't bind to server <%s> port <%d>. (%s)\n", - hostname, port, ldap_err2string(rc)); - } - if ( errmsg ) { - *errmsg = PR_smprintf(error2, ldap_err2string(rc)); - } - goto unlock_and_return; - } - - if ( serverctrls ) + if ( serverctrls ) + { + int i; + for( i = 0; serverctrls[ i ] != NULL; ++i ) { - int i; - for( i = 0; serverctrls[ i ] != NULL; ++i ) - { if ( !(strcmp( serverctrls[ i ]->ldctl_oid, LDAP_CONTROL_PWEXPIRED)) ) { /* Bind is successful but password has expired */ @@ -487,12 +439,8 @@ int cb_get_connection(cb_conn_pool * pool, LDAP ** lld, cb_outgoing_conn ** cc,s binddn, hostname, port, password_expiring); } } - } - ldap_controls_free(serverctrls); - } - - if (referrals) - charray_free(referrals); + } + ldap_controls_free(serverctrls); } } @@ -896,6 +844,7 @@ int cb_ping_farm(cb_backend_instance *cb, cb_outgoing_conn * cnx,time_t end_time LDAP *ld; LDAPMessage *result; time_t now; + int secure; if (cb->max_idle_time <=0) /* Heart-beat disabled */ return LDAP_SUCCESS; @@ -904,8 +853,12 @@ int cb_ping_farm(cb_backend_instance *cb, cb_outgoing_conn * cnx,time_t end_time now = current_time(); if (end_time && ((now <= end_time) || (end_time <0))) return LDAP_SUCCESS; - - ld=slapi_ldap_init(cb->pool->hostname,cb->pool->port,cb->pool->secure,0); + + secure = cb->pool->secure; + if (cb->pool->starttls) { + secure = 2; + } + ld=slapi_ldap_init(cb->pool->hostname,cb->pool->port,secure,0); if (NULL == ld) { cb_update_failed_conn_cpt( cb ); return LDAP_SERVER_DOWN; @@ -914,6 +867,8 @@ int cb_ping_farm(cb_backend_instance *cb, cb_outgoing_conn * cnx,time_t end_time timeout.tv_sec=cb->max_test_time; timeout.tv_usec=0; + /* NOTE: This will fail if we implement the ability to disable + anonymous bind */ rc=ldap_search_ext_s(ld ,NULL,LDAP_SCOPE_BASE,"objectclass=*",attrs,1,NULL, NULL, &timeout, 1,&result); if ( LDAP_SUCCESS != rc ) { diff --git a/ldap/servers/plugins/chainingdb/cb_instance.c b/ldap/servers/plugins/chainingdb/cb_instance.c index 15e266bd8..0e79b7e3e 100644 --- a/ldap/servers/plugins/chainingdb/cb_instance.c +++ b/ldap/servers/plugins/chainingdb/cb_instance.c @@ -53,7 +53,9 @@ /* Get functions */ static void *cb_instance_hosturl_get(void *arg); +static void *cb_instance_starttls_get(void *arg); static void *cb_instance_binduser_get(void *arg); +static void *cb_instance_bindmech_get(void *arg); static void *cb_instance_userpassword_get(void *arg); static void *cb_instance_maxbconn_get(void *arg); static void *cb_instance_maxconn_get(void *arg); @@ -77,7 +79,9 @@ static void *cb_instance_max_test_get(void *arg); /* Set functions */ static int cb_instance_hosturl_set(void *arg, void *value, char *errorbuf, int phase, int apply); +static int cb_instance_starttls_set(void *arg, void *value, char *errorbuf, int phase, int apply); static int cb_instance_binduser_set(void *arg, void *value, char *errorbuf, int phase, int apply); +static int cb_instance_bindmech_set(void *arg, void *value, char *errorbuf, int phase, int apply); static int cb_instance_userpassword_set(void *arg, void *value, char *errorbuf, int phase, int apply); static int cb_instance_maxbconn_set(void *arg, void *value, char *errorbuf, int phase, int apply); static int cb_instance_maxconn_set(void *arg, void *value, char *errorbuf, int phase, int apply); @@ -120,6 +124,8 @@ cb_instance_config_info cb_the_instance_config[] = { {CB_CONFIG_HOPLIMIT,CB_CONFIG_TYPE_INT,CB_DEF_HOPLIMIT,&cb_instance_hoplimit_get, &cb_instance_hoplimit_set,CB_ALWAYS_SHOW}, {CB_CONFIG_MAX_IDLE_TIME,CB_CONFIG_TYPE_INT,CB_DEF_MAX_IDLE_TIME,&cb_instance_max_idle_get, &cb_instance_max_idle_set,CB_ALWAYS_SHOW}, {CB_CONFIG_MAX_TEST_TIME,CB_CONFIG_TYPE_INT,CB_DEF_MAX_TEST_TIME,&cb_instance_max_test_get, &cb_instance_max_test_set,CB_ALWAYS_SHOW}, +{CB_CONFIG_STARTTLS,CB_CONFIG_TYPE_ONOFF,CB_DEF_STARTTLS,&cb_instance_starttls_get, &cb_instance_starttls_set,CB_ALWAYS_SHOW}, +{CB_CONFIG_BINDMECH,CB_CONFIG_TYPE_STRING,CB_DEF_BINDMECH,&cb_instance_bindmech_get, &cb_instance_bindmech_set,CB_ALWAYS_SHOW}, {NULL, 0, NULL, NULL, NULL, 0} }; @@ -256,9 +262,9 @@ void cb_instance_free(cb_backend_instance * inst) { slapi_destroy_mutex(inst->pool->conn.conn_list_mutex); slapi_destroy_mutex(inst->monitor_availability.cpt_lock); slapi_destroy_mutex(inst->monitor_availability.lock_timeLimit); - slapi_ch_free((void **) &inst->configDn); - slapi_ch_free((void **) &inst->monitorDn); - slapi_ch_free((void **) &inst->inst_name); + slapi_ch_free_string(&inst->configDn); + slapi_ch_free_string(&inst->monitorDn); + slapi_ch_free_string(&inst->inst_name); charray_free(inst->every_attribute); slapi_ch_free((void **) &inst->bind_pool); @@ -1324,6 +1330,66 @@ static int cb_instance_bindretry_set(void *arg, void *value, char *errorbuf, int } +static void *cb_instance_starttls_get(void *arg) +{ + cb_backend_instance * inst=(cb_backend_instance *) arg; + uintptr_t data; + + PR_RWLock_Rlock(inst->rwl_config_lock); + data=inst->pool->starttls; + PR_RWLock_Unlock(inst->rwl_config_lock); + return (void *) data; +} + +static int cb_instance_starttls_set(void *arg, void *value, char *errorbuf, int phase, int apply) +{ + cb_backend_instance * inst=(cb_backend_instance *) arg; + int rc = LDAP_SUCCESS; + + if (apply) { + PR_RWLock_Wlock(inst->rwl_config_lock); + inst->pool->starttls=(int) ((uintptr_t)value); + PR_RWLock_Unlock(inst->rwl_config_lock); + if (( phase != CB_CONFIG_PHASE_INITIALIZATION ) && + ( phase != CB_CONFIG_PHASE_STARTUP )) { + rc=CB_REOPEN_CONN; /* reconnect with the new starttls setting */ + } + } + return rc; +} + +static void *cb_instance_bindmech_get(void *arg) +{ + cb_backend_instance * inst=(cb_backend_instance *) arg; + char * data; + + PR_RWLock_Rlock(inst->rwl_config_lock); + data = slapi_ch_strdup(inst->pool->mech); + PR_RWLock_Unlock(inst->rwl_config_lock); + return data; +} + +static int cb_instance_bindmech_set(void *arg, void *value, char *errorbuf, int phase, int apply) +{ + cb_backend_instance * inst=(cb_backend_instance *) arg; + int rc=LDAP_SUCCESS; + + if (apply) { + PR_RWLock_Wlock(inst->rwl_config_lock); + if (( phase != CB_CONFIG_PHASE_INITIALIZATION ) && + ( phase != CB_CONFIG_PHASE_STARTUP )) { + + /* Dynamic modif */ + charray_add(&inst->pool->waste_basket,inst->pool->mech); + rc=CB_REOPEN_CONN; + } + + inst->pool->mech=slapi_ch_strdup((char *) value); + PR_RWLock_Unlock(inst->rwl_config_lock); + } + return rc; +} + /* Finds an entry in a config_info array with the given name. Returns diff --git a/ldap/servers/plugins/replication/repl5_connection.c b/ldap/servers/plugins/replication/repl5_connection.c index d36a58d2c..027f8c1c4 100644 --- a/ldap/servers/plugins/replication/repl5_connection.c +++ b/ldap/servers/plugins/replication/repl5_connection.c @@ -1563,7 +1563,7 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char *password) const char *mech = bind_method_to_mech(conn->bindmethod); rc = slapi_ldap_bind(conn->ld, binddn, password, mech, NULL, - &ctrls, NULL); + &ctrls, NULL, NULL); if ( rc == LDAP_SUCCESS ) { diff --git a/ldap/servers/slapd/sasl_map.c b/ldap/servers/slapd/sasl_map.c index cc8adc633..9d7f2c935 100644 --- a/ldap/servers/slapd/sasl_map.c +++ b/ldap/servers/slapd/sasl_map.c @@ -440,6 +440,8 @@ sasl_map_check(sasl_map_data *dp, char *sasl_user_and_realm, char **ldap_search_ } if (matched) { if (matched == 1) { + char escape_base[BUFSIZ]; + char escape_filt[BUFSIZ]; /* Allocate buffers for the returned strings */ /* We already computed this, so we could pass it in to speed up a little */ size_t userrealmlen = strlen(sasl_user_and_realm); @@ -448,7 +450,11 @@ sasl_map_check(sasl_map_data *dp, char *sasl_user_and_realm, char **ldap_search_ *ldap_search_filter = (char *) slapi_ch_malloc(userrealmlen + strlen(dp->template_search_filter) + 1); slapd_re_subs(dp->template_base_dn,*ldap_search_base); slapd_re_subs(dp->template_search_filter,*ldap_search_filter); - LDAPDebug( LDAP_DEBUG_TRACE, "mapped base dn: %s, filter: %s\n", ldap_search_base, ldap_search_filter, 0 ); + /* these values are internal regex representations with lots of + unprintable control chars - escape for logging */ + LDAPDebug( LDAP_DEBUG_TRACE, "mapped base dn: %s, filter: %s\n", + escape_string( *ldap_search_base, escape_base ), + escape_string( *ldap_search_filter, escape_filt ), 0 ); ret = 1; } else { LDAPDebug( LDAP_DEBUG_ANY, "sasl_map_check : re_exec failed\n", 0, 0, 0 ); diff --git a/ldap/servers/slapd/saslbind.c b/ldap/servers/slapd/saslbind.c index 20e9bc2c6..fbd0b3dac 100644 --- a/ldap/servers/slapd/saslbind.c +++ b/ldap/servers/slapd/saslbind.c @@ -81,6 +81,21 @@ void nssasl_free(void *ptr) slapi_ch_free(&ptr); } +static Slapi_ComponentId *sasl_component_id = NULL; + +static void generate_component_id() +{ + if (NULL == sasl_component_id) { + sasl_component_id = generate_componentid(NULL /* Not a plugin */, + COMPONENT_SASL); + } +} + +static Slapi_ComponentId *sasl_get_component_id() +{ + return sasl_component_id; +} + /* * sasl library callbacks */ @@ -238,20 +253,23 @@ static void ids_sasl_user_search( ) { Slapi_Entry **entries = NULL; - Slapi_PBlock *pb; + Slapi_PBlock *pb = NULL; int i, ret; LDAPDebug(LDAP_DEBUG_TRACE, "sasl user search basedn=\"%s\" filter=\"%s\"\n", basedn, filter, 0); /* TODO: set size and time limits */ - - pb = slapi_search_internal(basedn, scope, filter, - ctrls, attrs, attrsonly); - if (pb == NULL) { - LDAPDebug(LDAP_DEBUG_TRACE, "null pblock from slapi_search_internal\n", 0, 0, 0); + pb = slapi_pblock_new(); + if (!pb) { + LDAPDebug(LDAP_DEBUG_TRACE, "null pblock for search_internal_pb\n", 0, 0, 0); goto out; } + slapi_search_internal_set_pb(pb, basedn, scope, filter, attrs, attrsonly, ctrls, + NULL, sasl_get_component_id(), 0); + + slapi_search_internal_pb(pb); + slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &ret); if (ret != LDAP_SUCCESS) { LDAPDebug(LDAP_DEBUG_TRACE, "sasl user search failed basedn=\"%s\" " @@ -261,7 +279,11 @@ static void ids_sasl_user_search( } slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries); - if (entries == NULL) goto out; + if ((entries == NULL) || (entries[0] == NULL)) { + LDAPDebug(LDAP_DEBUG_TRACE, "sasl user search found no entries\n", + 0, 0, 0); + goto out; + } for (i = 0; entries[i]; i++) { (*foundp)++; @@ -546,6 +568,9 @@ int ids_sasl_init(void) LDAPDebug(LDAP_DEBUG_TRACE, "sasl service fqdn is: %s\n", serverfqdn, 0, 0); + /* get component ID for internal operations */ + generate_component_id(); + /* Set SASL memory allocation callbacks */ sasl_set_alloc( (sasl_malloc_t *)slapi_ch_malloc, @@ -1016,4 +1041,3 @@ void ids_sasl_check_bind(Slapi_PBlock *pb) return; } - diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h index 12de2ff4e..3e52bf2e3 100644 --- a/ldap/servers/slapd/slapi-plugin.h +++ b/ldap/servers/slapd/slapi-plugin.h @@ -1103,6 +1103,7 @@ slapi_ldap_bind( const char *mech, /* name of mechanism */ LDAPControl **serverctrls, /* additional controls to send */ LDAPControl ***returnedctrls, /* returned controls */ + struct timeval *timeout, /* timeout */ int *msgidp /* pass in non-NULL for async handling */ ); diff --git a/ldap/servers/slapd/slapi-private.h b/ldap/servers/slapd/slapi-private.h index 7820db528..ccd985546 100644 --- a/ldap/servers/slapd/slapi-private.h +++ b/ldap/servers/slapd/slapi-private.h @@ -720,6 +720,7 @@ struct slapi_componentid * plugin_get_default_component_id(); #define COMPONENT_RESLIMIT "cn=resource limits,"COMPONENT_BASE_DN #define COMPONENT_PWPOLICY "cn=password policy,"COMPONENT_BASE_DN #define COMPONENT_CERT_AUTH "cn=certificate-based authentication,"COMPONENT_BASE_DN +#define COMPONENT_SASL "cn=sasl,"COMPONENT_BASE_DN /* Component names for logging */ #define SLAPI_COMPONENT_NAME_NSPR "Netscape Portable Runtime" diff --git a/ldap/servers/slapd/util.c b/ldap/servers/slapd/util.c index c6981449c..42aec6b7b 100644 --- a/ldap/servers/slapd/util.c +++ b/ldap/servers/slapd/util.c @@ -974,7 +974,17 @@ slapi_ldap_init_ext( ssl_strength = LDAPSSL_AUTH_CERT; } - if (ldapssl_set_strength(ld, ssl_strength) != 0) { + /* Can only use ldapssl_set_strength on and LDAP* already + initialized for SSL - this is not the case when using + startTLS, so we use NULL to set the default for all + new connections */ + if (secure == 1) { + rc = ldapssl_set_strength(ld, ssl_strength); + } else { + rc = ldapssl_set_strength(NULL, ssl_strength); + } + + if (rc != 0) { int prerr = PR_GetError(); slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext", @@ -1052,6 +1062,7 @@ slapi_ldap_bind( const char *mech, /* name of mechanism */ LDAPControl **serverctrls, /* additional controls to send */ LDAPControl ***returnedctrls, /* returned controls */ + struct timeval *timeout, /* timeout */ int *msgidp /* pass in non-NULL for async handling */ ) { @@ -1125,8 +1136,8 @@ slapi_ldap_bind( if (msgidp) { /* let caller process result */ *msgidp = mymsgid; } else { /* process results */ - if (ldap_result(ld, mymsgid, LDAP_MSG_ALL, - (struct timeval *)0, &result) == -1) { + rc = ldap_result(ld, mymsgid, LDAP_MSG_ALL, timeout, &result); + if (-1 == rc) { /* error */ rc = ldap_get_lderrno(ld, NULL, NULL); slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_bind", "Error reading bind response for id " @@ -1135,8 +1146,18 @@ slapi_ldap_bind( mech ? mech : "SIMPLE", rc, ldap_err2string(rc)); goto done; - } - + } else if (rc == 0) { /* timeout */ + rc = LDAP_TIMEOUT; + slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_bind", + "Error: timeout after [%d.%d] seconds reading " + "bind response for [%s] mech [%s]\n", + timeout ? timeout->tv_sec : 0, + timeout ? timeout->tv_usec : 0, + bindid ? bindid : "(anon)", + mech ? mech : "SIMPLE"); + goto done; + } + /* if we got here, we were able to read success result */ /* Get the controls sent by the server if requested */ if (returnedctrls) { if ((rc = ldap_parse_result(ld, result, &rc, NULL, NULL,
0
9afa6694c566e2f37a3ad61403127c5c85cf4dac
389ds/389-ds-base
Issue 50499 - Fix some npm audit issues Description there are still warnings: npm WARN [email protected] requires a peer of bootstrap@^3.3 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of redux@>= 3.0.0 < 4.0.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of [email protected] || 0.32.x but none is installed. You must install peer dependencies yourself. relates: https://pagure.io/389-ds-base/issue/50499 Reviewed by: mreynolds
commit 9afa6694c566e2f37a3ad61403127c5c85cf4dac Author: Mark Reynolds <[email protected]> Date: Fri May 15 10:00:12 2020 -0400 Issue 50499 - Fix some npm audit issues Description there are still warnings: npm WARN [email protected] requires a peer of bootstrap@^3.3 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of redux@>= 3.0.0 < 4.0.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of [email protected] || 0.32.x but none is installed. You must install peer dependencies yourself. relates: https://pagure.io/389-ds-base/issue/50499 Reviewed by: mreynolds diff --git a/src/cockpit/389-console/package-lock.json b/src/cockpit/389-console/package-lock.json index 1c15ad4a0..2d6e7692d 100644 --- a/src/cockpit/389-console/package-lock.json +++ b/src/cockpit/389-console/package-lock.json @@ -13,30 +13,30 @@ } }, "@babel/compat-data": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.9.0.tgz", - "integrity": "sha512-zeFQrr+284Ekvd9e7KAX954LkapWiOmQtsfHirhxqfdlX6MEC32iRE+pqUGlYIBchdevaCwvzxWGSy/YBNI85g==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.9.6.tgz", + "integrity": "sha512-5QPTrNen2bm7RBc7dsOmcA5hbrS4O2Vhmk5XOL4zWW/zD/hV0iinpefDlkm+tBBy8kDtFaaeEvmAqt+nURAV2g==", "dev": true, "requires": { - "browserslist": "^4.9.1", + "browserslist": "^4.11.1", "invariant": "^2.2.4", "semver": "^5.5.0" } }, "@babel/core": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.0.tgz", - "integrity": "sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.6.tgz", + "integrity": "sha512-nD3deLvbsApbHAHttzIssYqgb883yU/d9roe4RZymBCDaZryMJDbptVpEpeQuRh4BJ+SYI8le9YGxKvFEvl1Wg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.0", + "@babel/generator": "^7.9.6", "@babel/helper-module-transforms": "^7.9.0", - "@babel/helpers": "^7.9.0", - "@babel/parser": "^7.9.0", + "@babel/helpers": "^7.9.6", + "@babel/parser": "^7.9.6", "@babel/template": "^7.8.6", - "@babel/traverse": "^7.9.0", - "@babel/types": "^7.9.0", + "@babel/traverse": "^7.9.6", + "@babel/types": "^7.9.6", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", @@ -57,12 +57,12 @@ } }, "@babel/generator": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.5.tgz", - "integrity": "sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.6.tgz", + "integrity": "sha512-+htwWKJbH2bL72HRluF8zumBxzuX0ZZUFl3JLNyoUjM/Ho8wnVpPXM6aUz8cfKDqQ/h7zHqKt4xzJteUosckqQ==", "dev": true, "requires": { - "@babel/types": "^7.9.5", + "@babel/types": "^7.9.6", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" @@ -109,9 +109,9 @@ } }, "@babel/parser": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", - "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", + "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", "dev": true }, "@babel/template": { @@ -126,26 +126,26 @@ } }, "@babel/traverse": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.5.tgz", - "integrity": "sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.6.tgz", + "integrity": "sha512-b3rAHSjbxy6VEAvlxM8OV/0X4XrG72zoxme6q1MOoe2vd0bEc+TwayhuC1+Dfgqh1QEG+pj7atQqvUprHIccsg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.5", + "@babel/generator": "^7.9.6", "@babel/helper-function-name": "^7.9.5", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.9.0", - "@babel/types": "^7.9.5", + "@babel/parser": "^7.9.6", + "@babel/types": "^7.9.6", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" } }, "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.5", @@ -233,9 +233,9 @@ }, "dependencies": { "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.5", @@ -293,13 +293,13 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.8.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.8.7.tgz", - "integrity": "sha512-4mWm8DCK2LugIS+p1yArqvG1Pf162upsIsjE7cNBjez+NjliQpVhj20obE520nao0o14DaTnFJv+Fw5a0JpoUw==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.9.6.tgz", + "integrity": "sha512-x2Nvu0igO0ejXzx09B/1fGBxY9NXQlBW2kZsSxCJft+KHN8t9XWzIvFxtPHnBOAXpVsdxZKZFbRUC8TsNKajMw==", "dev": true, "requires": { - "@babel/compat-data": "^7.8.6", - "browserslist": "^4.9.1", + "@babel/compat-data": "^7.9.6", + "browserslist": "^4.11.1", "invariant": "^2.2.4", "levenary": "^1.1.1", "semver": "^5.5.0" @@ -461,9 +461,9 @@ } }, "@babel/parser": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", - "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", + "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", "dev": true }, "@babel/template": { @@ -478,9 +478,9 @@ } }, "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.5", @@ -510,12 +510,12 @@ } }, "@babel/generator": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.5.tgz", - "integrity": "sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.6.tgz", + "integrity": "sha512-+htwWKJbH2bL72HRluF8zumBxzuX0ZZUFl3JLNyoUjM/Ho8wnVpPXM6aUz8cfKDqQ/h7zHqKt4xzJteUosckqQ==", "dev": true, "requires": { - "@babel/types": "^7.9.5", + "@babel/types": "^7.9.6", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" @@ -562,9 +562,9 @@ } }, "@babel/parser": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", - "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", + "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", "dev": true }, "@babel/template": { @@ -579,26 +579,26 @@ } }, "@babel/traverse": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.5.tgz", - "integrity": "sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.6.tgz", + "integrity": "sha512-b3rAHSjbxy6VEAvlxM8OV/0X4XrG72zoxme6q1MOoe2vd0bEc+TwayhuC1+Dfgqh1QEG+pj7atQqvUprHIccsg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.5", + "@babel/generator": "^7.9.6", "@babel/helper-function-name": "^7.9.5", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.9.0", - "@babel/types": "^7.9.5", + "@babel/parser": "^7.9.6", + "@babel/types": "^7.9.6", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" } }, "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.5", @@ -653,9 +653,9 @@ }, "dependencies": { "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.5", @@ -754,9 +754,9 @@ } }, "@babel/parser": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", - "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", + "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", "dev": true }, "@babel/template": { @@ -771,9 +771,9 @@ } }, "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.5", @@ -843,12 +843,12 @@ } }, "@babel/generator": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.5.tgz", - "integrity": "sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.6.tgz", + "integrity": "sha512-+htwWKJbH2bL72HRluF8zumBxzuX0ZZUFl3JLNyoUjM/Ho8wnVpPXM6aUz8cfKDqQ/h7zHqKt4xzJteUosckqQ==", "dev": true, "requires": { - "@babel/types": "^7.9.5", + "@babel/types": "^7.9.6", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" @@ -895,9 +895,9 @@ } }, "@babel/parser": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", - "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", + "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", "dev": true }, "@babel/template": { @@ -912,26 +912,26 @@ } }, "@babel/traverse": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.5.tgz", - "integrity": "sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.6.tgz", + "integrity": "sha512-b3rAHSjbxy6VEAvlxM8OV/0X4XrG72zoxme6q1MOoe2vd0bEc+TwayhuC1+Dfgqh1QEG+pj7atQqvUprHIccsg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.5", + "@babel/generator": "^7.9.6", "@babel/helper-function-name": "^7.9.5", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.9.0", - "@babel/types": "^7.9.5", + "@babel/parser": "^7.9.6", + "@babel/types": "^7.9.6", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" } }, "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.5", @@ -1122,9 +1122,9 @@ } }, "@babel/parser": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", - "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", + "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", "dev": true }, "@babel/template": { @@ -1139,9 +1139,9 @@ } }, "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.5", @@ -1188,12 +1188,12 @@ } }, "@babel/generator": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.5.tgz", - "integrity": "sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.6.tgz", + "integrity": "sha512-+htwWKJbH2bL72HRluF8zumBxzuX0ZZUFl3JLNyoUjM/Ho8wnVpPXM6aUz8cfKDqQ/h7zHqKt4xzJteUosckqQ==", "dev": true, "requires": { - "@babel/types": "^7.9.5", + "@babel/types": "^7.9.6", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" @@ -1240,9 +1240,9 @@ } }, "@babel/parser": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", - "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", + "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", "dev": true }, "@babel/template": { @@ -1257,26 +1257,26 @@ } }, "@babel/traverse": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.5.tgz", - "integrity": "sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.6.tgz", + "integrity": "sha512-b3rAHSjbxy6VEAvlxM8OV/0X4XrG72zoxme6q1MOoe2vd0bEc+TwayhuC1+Dfgqh1QEG+pj7atQqvUprHIccsg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.5", + "@babel/generator": "^7.9.6", "@babel/helper-function-name": "^7.9.5", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.9.0", - "@babel/types": "^7.9.5", + "@babel/parser": "^7.9.6", + "@babel/types": "^7.9.6", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" } }, "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.5", @@ -1302,14 +1302,14 @@ } }, "@babel/helpers": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.2.tgz", - "integrity": "sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.6.tgz", + "integrity": "sha512-tI4bUbldloLcHWoRUMAj4g1bF313M/o6fBKhIsb3QnGVPwRm9JsNf/gqMkQ7zjqReABiffPV6RWj7hEglID5Iw==", "dev": true, "requires": { "@babel/template": "^7.8.3", - "@babel/traverse": "^7.9.0", - "@babel/types": "^7.9.0" + "@babel/traverse": "^7.9.6", + "@babel/types": "^7.9.6" }, "dependencies": { "@babel/code-frame": { @@ -1322,12 +1322,12 @@ } }, "@babel/generator": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.5.tgz", - "integrity": "sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.6.tgz", + "integrity": "sha512-+htwWKJbH2bL72HRluF8zumBxzuX0ZZUFl3JLNyoUjM/Ho8wnVpPXM6aUz8cfKDqQ/h7zHqKt4xzJteUosckqQ==", "dev": true, "requires": { - "@babel/types": "^7.9.5", + "@babel/types": "^7.9.6", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" @@ -1374,9 +1374,9 @@ } }, "@babel/parser": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", - "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", + "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", "dev": true }, "@babel/template": { @@ -1391,26 +1391,26 @@ } }, "@babel/traverse": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.5.tgz", - "integrity": "sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.6.tgz", + "integrity": "sha512-b3rAHSjbxy6VEAvlxM8OV/0X4XrG72zoxme6q1MOoe2vd0bEc+TwayhuC1+Dfgqh1QEG+pj7atQqvUprHIccsg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.5", + "@babel/generator": "^7.9.6", "@babel/helper-function-name": "^7.9.5", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.9.0", - "@babel/types": "^7.9.5", + "@babel/parser": "^7.9.6", + "@babel/types": "^7.9.6", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" } }, "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.5", @@ -1541,9 +1541,9 @@ } }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.5.tgz", - "integrity": "sha512-VP2oXvAf7KCYTthbUHwBlewbl1Iq059f6seJGsxMizaCdgHIeczOr7FBqELhSqfkIl04Fi8okzWzl63UKbQmmg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.6.tgz", + "integrity": "sha512-Ga6/fhGqA9Hj+y6whNpPv8psyaK5xzrQwSPsGPloVkvmH+PqW1ixdnfJ9uIO06OjQNYol3PMnfmJ8vfZtkzF+A==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.8.3", @@ -1776,9 +1776,9 @@ } }, "@babel/parser": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", - "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", + "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", "dev": true }, "@babel/template": { @@ -1793,9 +1793,9 @@ } }, "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.5", @@ -1912,9 +1912,9 @@ } }, "@babel/parser": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", - "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", + "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", "dev": true }, "@babel/template": { @@ -1929,9 +1929,9 @@ } }, "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.5", @@ -1960,38 +1960,38 @@ } }, "@babel/plugin-transform-modules-amd": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.9.0.tgz", - "integrity": "sha512-vZgDDF003B14O8zJy0XXLnPH4sg+9X5hFBBGN1V+B2rgrB+J2xIypSN6Rk9imB2hSTHQi5OHLrFWsZab1GMk+Q==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.9.6.tgz", + "integrity": "sha512-zoT0kgC3EixAyIAU+9vfaUVKTv9IxBDSabgHoUCBP6FqEJ+iNiN7ip7NBKcYqbfUDfuC2mFCbM7vbu4qJgOnDw==", "dev": true, "requires": { "@babel/helper-module-transforms": "^7.9.0", "@babel/helper-plugin-utils": "^7.8.3", - "babel-plugin-dynamic-import-node": "^2.3.0" + "babel-plugin-dynamic-import-node": "^2.3.3" } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.9.0.tgz", - "integrity": "sha512-qzlCrLnKqio4SlgJ6FMMLBe4bySNis8DFn1VkGmOcxG9gqEyPIOzeQrA//u0HAKrWpJlpZbZMPB1n/OPa4+n8g==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.9.6.tgz", + "integrity": "sha512-7H25fSlLcn+iYimmsNe3uK1at79IE6SKW9q0/QeEHTMC9MdOZ+4bA+T1VFB5fgOqBWoqlifXRzYD0JPdmIrgSQ==", "dev": true, "requires": { "@babel/helper-module-transforms": "^7.9.0", "@babel/helper-plugin-utils": "^7.8.3", "@babel/helper-simple-access": "^7.8.3", - "babel-plugin-dynamic-import-node": "^2.3.0" + "babel-plugin-dynamic-import-node": "^2.3.3" } }, "@babel/plugin-transform-modules-systemjs": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.9.0.tgz", - "integrity": "sha512-FsiAv/nao/ud2ZWy4wFacoLOm5uxl0ExSQ7ErvP7jpoihLR6Cq90ilOFyX9UXct3rbtKsAiZ9kFt5XGfPe/5SQ==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.9.6.tgz", + "integrity": "sha512-NW5XQuW3N2tTHim8e1b7qGy7s0kZ2OH3m5octc49K1SdAKGxYxeIx7hiIz05kS1R2R+hOWcsr1eYwcGhrdHsrg==", "dev": true, "requires": { "@babel/helper-hoist-variables": "^7.8.3", "@babel/helper-module-transforms": "^7.9.0", "@babel/helper-plugin-utils": "^7.8.3", - "babel-plugin-dynamic-import-node": "^2.3.0" + "babel-plugin-dynamic-import-node": "^2.3.3" } }, "@babel/plugin-transform-modules-umd": { @@ -2052,9 +2052,9 @@ } }, "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.5", @@ -2201,13 +2201,13 @@ } }, "@babel/preset-env": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.9.5.tgz", - "integrity": "sha512-eWGYeADTlPJH+wq1F0wNfPbVS1w1wtmMJiYk55Td5Yu28AsdR9AsC97sZ0Qq8fHqQuslVSIYSGJMcblr345GfQ==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.9.6.tgz", + "integrity": "sha512-0gQJ9RTzO0heXOhzftog+a/WyOuqMrAIugVYxMYf83gh1CQaQDjMtsOpqOwXyDL/5JcWsrCm8l4ju8QC97O7EQ==", "dev": true, "requires": { - "@babel/compat-data": "^7.9.0", - "@babel/helper-compilation-targets": "^7.8.7", + "@babel/compat-data": "^7.9.6", + "@babel/helper-compilation-targets": "^7.9.6", "@babel/helper-module-imports": "^7.8.3", "@babel/helper-plugin-utils": "^7.8.3", "@babel/plugin-proposal-async-generator-functions": "^7.8.3", @@ -2215,7 +2215,7 @@ "@babel/plugin-proposal-json-strings": "^7.8.3", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3", "@babel/plugin-proposal-numeric-separator": "^7.8.3", - "@babel/plugin-proposal-object-rest-spread": "^7.9.5", + "@babel/plugin-proposal-object-rest-spread": "^7.9.6", "@babel/plugin-proposal-optional-catch-binding": "^7.8.3", "@babel/plugin-proposal-optional-chaining": "^7.9.0", "@babel/plugin-proposal-unicode-property-regex": "^7.8.3", @@ -2242,9 +2242,9 @@ "@babel/plugin-transform-function-name": "^7.8.3", "@babel/plugin-transform-literals": "^7.8.3", "@babel/plugin-transform-member-expression-literals": "^7.8.3", - "@babel/plugin-transform-modules-amd": "^7.9.0", - "@babel/plugin-transform-modules-commonjs": "^7.9.0", - "@babel/plugin-transform-modules-systemjs": "^7.9.0", + "@babel/plugin-transform-modules-amd": "^7.9.6", + "@babel/plugin-transform-modules-commonjs": "^7.9.6", + "@babel/plugin-transform-modules-systemjs": "^7.9.6", "@babel/plugin-transform-modules-umd": "^7.9.0", "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3", "@babel/plugin-transform-new-target": "^7.8.3", @@ -2260,8 +2260,8 @@ "@babel/plugin-transform-typeof-symbol": "^7.8.4", "@babel/plugin-transform-unicode-regex": "^7.8.3", "@babel/preset-modules": "^0.1.3", - "@babel/types": "^7.9.5", - "browserslist": "^4.9.1", + "@babel/types": "^7.9.6", + "browserslist": "^4.11.1", "core-js-compat": "^3.6.2", "invariant": "^2.2.2", "levenary": "^1.1.1", @@ -2269,9 +2269,9 @@ }, "dependencies": { "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.5", @@ -2295,9 +2295,9 @@ }, "dependencies": { "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.5", @@ -2351,9 +2351,9 @@ } }, "@babel/runtime-corejs3": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.9.2.tgz", - "integrity": "sha512-HHxmgxbIzOfFlZ+tdeRKtaxWOMUoCG5Mu3wKeUmOxjYrwb3AAHgnmtCUbPPK11/raIWLIBK250t8E2BPO0p7jA==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.9.6.tgz", + "integrity": "sha512-6toWAfaALQjt3KMZQc6fABqZwUDDuWzz+cAfPhqyEnzxvdWOAkjwPNxgF8xlmo7OWLsSjaKjsskpKHRLaMArOA==", "dev": true, "requires": { "core-js-pure": "^3.0.0", @@ -2667,9 +2667,9 @@ "integrity": "sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q==" }, "@restart/hooks": { - "version": "0.3.22", - "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.3.22.tgz", - "integrity": "sha512-tW0T3hP6emYNOc76/iC96rlu+f7JYLSVk/Wnn+7dj1gJUcw4CkQNLy16vx2mBLtVKsFMZ9miVEZXat8blruDHQ==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.3.25.tgz", + "integrity": "sha512-m2v3N5pxTsIiSH74/sb1yW8D9RxkJidGW+5Mfwn/lHb2QzhZNlaU1su7abSyT9EGf0xS/0waLjrf7/XxQHUk7w==", "requires": { "lodash": "^4.17.15", "lodash-es": "^4.17.15" @@ -2898,8 +2898,7 @@ "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", - "optional": true + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" }, "@types/d3": { "version": "4.13.2", @@ -3179,6 +3178,12 @@ "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", "optional": true }, + "@types/minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", + "optional": true + }, "@types/node": { "version": "13.13.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.2.tgz", @@ -3413,7 +3418,6 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "optional": true, "requires": { "jsonparse": "^1.2.0", "through": ">=2.2.7 <3" @@ -3489,12 +3493,6 @@ "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", "optional": true }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -3565,12 +3563,6 @@ "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "optional": true - }, "array-ify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", @@ -3619,9 +3611,9 @@ } }, "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", "optional": true }, "asap": { @@ -3705,235 +3697,64 @@ "optional": true }, "audit-ci": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/audit-ci/-/audit-ci-1.7.0.tgz", - "integrity": "sha512-KZipOhxTrLVmlEwaXLn5CSee4xkvvHsiNVWMkdOCawDPaCkK7t65DEzOU0N82OPQgc65PLOoL/BJR/s6hja2lw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/audit-ci/-/audit-ci-3.0.0.tgz", + "integrity": "sha512-VK2C2lY+I3I78fKgYtYxOdhl57DOINDqgx2IYwFpLydYxmwIf76XSU+bHyk2l/Ab7Nbx5QhA8Z11jk9phf/ShA==", "dev": true, "requires": { - "byline": "^5.0.0", - "cross-spawn": "6.0.5", - "semver": "^6.0.0", - "yargs": "12.0.5" + "JSONStream": "^1.3.5", + "cross-spawn": "^7.0.2", + "event-stream": "4.0.1", + "readline-transform": "1.0.0", + "semver": "^7.0.0", + "yargs": "^15.0.0" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "dependencies": { - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true - } - } - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", + "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", "dev": true, "requires": { - "pump": "^3.0.0" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" } }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true }, - "lcid": { + "shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { - "p-limit": "^2.0.0" + "shebang-regex": "^3.0.0" } }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "pump": { + "shebang-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "semver": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.1.tgz", - "integrity": "sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ==", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, - "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" - } - }, - "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "isexe": "^2.0.0" } } } @@ -4160,9 +3981,9 @@ "dev": true }, "bootstrap": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.4.1.tgz", - "integrity": "sha512-tbx5cHubwE6e2ZG7nqM3g/FZ5PQEDMWmMGNrCUBVRPHXTJaH7CBDdsLeu3eCh3B1tzAxTnAbtmrzvWEvT2NNEA==" + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.5.0.tgz", + "integrity": "sha512-Z93QoXvodoVslA+PWNdk23Hze4RBYIkpb5h8I2HY2Tu2h7A0LpAgLcyrhrSUyo2/Oxm2l1fRZPs1e5hnxnliXA==" }, "bootstrap-datepicker": { "version": "1.9.0", @@ -4378,7 +4199,8 @@ "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true }, "builtin-status-codes": { "version": "3.0.0", @@ -4386,12 +4208,6 @@ "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", "dev": true }, - "byline": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz", - "integrity": "sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE=", - "dev": true - }, "c3": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/c3/-/c3-0.4.24.tgz", @@ -4497,26 +4313,34 @@ } }, "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.0.0.tgz", + "integrity": "sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w==", "optional": true }, "camelcase-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", - "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", "optional": true, "requires": { - "camelcase": "^4.1.0", - "map-obj": "^2.0.0", - "quick-lru": "^1.0.0" + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "optional": true + } } }, "caniuse-lite": { - "version": "1.0.30001046", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001046.tgz", - "integrity": "sha512-CsGjBRYWG6FvgbyGy+hBbaezpwiqIOLkxQPY4A4Ea49g1eNsnQuESB+n4QM0BKii1j80MyJ26Ir5ywTQkbRE4g==", + "version": "1.0.30001059", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001059.tgz", + "integrity": "sha512-oOrc+jPJWooKIA0IrNZ5sYlsXc7NP7KLhNWrSGEJhnfSzDvDJ0zd3i6HXsslExY9bbu+x0FQ5C61LcqmPt7bOQ==", "dev": true }, "cardinal": { @@ -4651,7 +4475,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "optional": true, "requires": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -4661,14 +4484,12 @@ "ansi-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "optional": true + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" }, "ansi-styles": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "optional": true, "requires": { "@types/color-name": "^1.1.1", "color-convert": "^2.0.1" @@ -4678,7 +4499,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "optional": true, "requires": { "color-name": "~1.1.4" } @@ -4686,20 +4506,17 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "optional": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "optional": true + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "optional": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -4710,7 +4527,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "optional": true, "requires": { "ansi-regex": "^5.0.0" } @@ -4719,7 +4535,6 @@ "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "optional": true, "requires": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -4736,12 +4551,6 @@ "pilot": ">=0.1.1" } }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", @@ -4770,6 +4579,12 @@ "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", "optional": true }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "optional": true + }, "commitizen": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-4.0.4.tgz", @@ -5129,71 +4944,209 @@ } }, "conventional-changelog-writer": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.11.tgz", - "integrity": "sha512-g81GQOR392I+57Cw3IyP1f+f42ME6aEkbR+L7v1FBBWolB0xkjKTeCWVguzRrp6UiT1O6gBpJbEy2eq7AnV1rw==", + "version": "4.0.16", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.16.tgz", + "integrity": "sha512-jmU1sDJDZpm/dkuFxBeRXvyNcJQeKhGtVcFFkwTphUAzyYWcwz2j36Wcv+Mv2hU3tpvLMkysOPXJTLO55AUrYQ==", "optional": true, "requires": { "compare-func": "^1.3.1", - "conventional-commits-filter": "^2.0.2", + "conventional-commits-filter": "^2.0.6", "dateformat": "^3.0.0", - "handlebars": "^4.4.0", + "handlebars": "^4.7.6", "json-stringify-safe": "^5.0.1", "lodash": "^4.17.15", - "meow": "^5.0.0", + "meow": "^7.0.0", "semver": "^6.0.0", "split": "^1.0.0", "through2": "^3.0.0" }, "dependencies": { + "conventional-commits-filter": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.6.tgz", + "integrity": "sha512-4g+sw8+KA50/Qwzfr0hL5k5NWxqtrOVw4DDk3/h6L85a9Gz0/Eqp3oP+CWCNfesBvZZZEFHF7OTEbRe+yYSyKw==", + "optional": true, + "requires": { + "lodash.ismatch": "^4.4.0", + "modify-values": "^1.0.0" + } + }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "optional": true }, - "through2": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", - "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "through2": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", + "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "optional": true, + "requires": { + "readable-stream": "2 || 3" + } + } + } + }, + "conventional-commit-types": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/conventional-commit-types/-/conventional-commit-types-3.0.0.tgz", + "integrity": "sha512-SmmCYnOniSsAa9GqWOeLqc179lfr5TRu5b4QFDkbsrJ5TZjPJx85wtOr3zn+1dbeNiXDKGPbZ72IKbPhLXh/Lg==", + "optional": true + }, + "conventional-commits-filter": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.2.tgz", + "integrity": "sha512-WpGKsMeXfs21m1zIw4s9H5sys2+9JccTzpN6toXtxhpw2VNF2JUXwIakthKBy+LN4DvJm+TzWhxOMWOs1OFCFQ==", + "optional": true, + "requires": { + "lodash.ismatch": "^4.4.0", + "modify-values": "^1.0.0" + } + }, + "conventional-commits-parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.1.0.tgz", + "integrity": "sha512-RSo5S0WIwXZiRxUGTPuYFbqvrR4vpJ1BDdTlthFgvHt5kEdnd1+pdvwWphWn57/oIl4V72NMmOocFqqJ8mFFhA==", + "optional": true, + "requires": { + "JSONStream": "^1.0.4", + "is-text-path": "^1.0.1", + "lodash": "^4.17.15", + "meow": "^7.0.0", + "split2": "^2.0.0", + "through2": "^3.0.0", + "trim-off-newlines": "^1.0.0" + }, + "dependencies": { + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "optional": true + }, + "camelcase": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.0.0.tgz", + "integrity": "sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w==", + "optional": true + }, + "camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "optional": true, + "requires": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "optional": true + } + } + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "optional": true + }, + "map-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", + "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", + "optional": true + }, + "meow": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.0.1.tgz", + "integrity": "sha512-tBKIQqVrAHqwit0vfuFPY3LlzJYkEOFyKa3bPgxzNl6q/RtN8KQ+ALYEASYuFayzSAsjlhXj/JZ10rH85Q6TUw==", + "optional": true, + "requires": { + "@types/minimist": "^1.2.0", + "arrify": "^2.0.1", + "camelcase": "^6.0.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "^4.0.2", + "normalize-package-data": "^2.5.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.13.1", + "yargs-parser": "^18.1.3" + } + }, + "minimist-options": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.0.2.tgz", + "integrity": "sha512-seq4hpWkYSUh1y7NXxzucwAN9yVlBc3Upgdjz8vLCP97jG8kaOmzYrVH/m7tQ1NYD1wdtZbSLfdy4zFmRWuc/w==", + "optional": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + }, + "dependencies": { + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "optional": true + } + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "optional": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "optional": true + }, + "redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "optional": true, + "requires": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + } + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "optional": true, "requires": { - "readable-stream": "2 || 3" + "path-parse": "^1.0.6" } - } - } - }, - "conventional-commit-types": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/conventional-commit-types/-/conventional-commit-types-3.0.0.tgz", - "integrity": "sha512-SmmCYnOniSsAa9GqWOeLqc179lfr5TRu5b4QFDkbsrJ5TZjPJx85wtOr3zn+1dbeNiXDKGPbZ72IKbPhLXh/Lg==", - "optional": true - }, - "conventional-commits-filter": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.2.tgz", - "integrity": "sha512-WpGKsMeXfs21m1zIw4s9H5sys2+9JccTzpN6toXtxhpw2VNF2JUXwIakthKBy+LN4DvJm+TzWhxOMWOs1OFCFQ==", - "optional": true, - "requires": { - "lodash.ismatch": "^4.4.0", - "modify-values": "^1.0.0" - } - }, - "conventional-commits-parser": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.0.8.tgz", - "integrity": "sha512-YcBSGkZbYp7d+Cr3NWUeXbPDFUN6g3SaSIzOybi8bjHL5IJ5225OSCxJJ4LgziyEJ7AaJtE9L2/EU6H7Nt/DDQ==", - "optional": true, - "requires": { - "JSONStream": "^1.0.4", - "is-text-path": "^1.0.1", - "lodash": "^4.17.15", - "meow": "^5.0.0", - "split2": "^2.0.0", - "through2": "^3.0.0", - "trim-off-newlines": "^1.0.0" - }, - "dependencies": { + }, + "strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "optional": true, + "requires": { + "min-indent": "^1.0.0" + } + }, "through2": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", @@ -5202,6 +5155,36 @@ "requires": { "readable-stream": "2 || 3" } + }, + "trim-newlines": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", + "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", + "optional": true + }, + "type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "optional": true + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "optional": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "optional": true + } + } } } }, @@ -5632,15 +5615,6 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.5.8.tgz", "integrity": "sha512-r4DbsyNJ7slwBSKoGesxDubRWJ71ghG8W2+1HcsDlAo12KGca9dDLv0u98tfdFw7ldBdoA7XmCnI6Q8LpAJXaQ==" }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "optional": true, - "requires": { - "array-find-index": "^1.0.1" - } - }, "cyclist": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", @@ -5913,6 +5887,12 @@ "jquery": ">=1.7.0" } }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "dev": true + }, "duplexer2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", @@ -5935,9 +5915,9 @@ } }, "electron-to-chromium": { - "version": "1.3.415", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.415.tgz", - "integrity": "sha512-GbtYqKffx3sU8G0HxwXuJFfs58Q7+iwLa5rBwaULwET6jWW8IAQSrVnu7vEfiUIcMVfbYyFg7cw3zdm+EbBJmw==", + "version": "1.3.438", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.438.tgz", + "integrity": "sha512-QKMcpfA/fCOnqFHsZvKr2haQQb3eXkDI17zT+4hHxJJThyN5nShcG6q1VR8vRiE/2GCJM+0p3PzinYknkdsBYg==", "dev": true }, "elliptic": { @@ -5958,8 +5938,7 @@ "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "optional": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "emojis-list": { "version": "2.1.0", @@ -6442,9 +6421,9 @@ "dev": true }, "eslint-plugin-react": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.19.0.tgz", - "integrity": "sha512-SPT8j72CGuAP+JFbT0sJHOB80TX/pu44gQ4vXH/cq+hQTiY2PuZ6IHkqXJV6x1b28GDdo1lbInjKUrrdUf0LOQ==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.20.0.tgz", + "integrity": "sha512-rqe1abd0vxMjmbPngo4NaYxTcR3Y4Hrmc/jg4T+sYz63yqlmJRknpEQfmWY+eDWPuMmix6iUIK+mv0zExjeLgA==", "dev": true, "requires": { "array-includes": "^3.1.1", @@ -6456,7 +6435,6 @@ "object.values": "^1.1.1", "prop-types": "^15.7.2", "resolve": "^1.15.1", - "semver": "^6.3.0", "string.prototype.matchall": "^4.0.2", "xregexp": "^4.3.0" }, @@ -6495,12 +6473,6 @@ "requires": { "path-parse": "^1.0.6" } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true } } }, @@ -6588,6 +6560,21 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, + "event-stream": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-4.0.1.tgz", + "integrity": "sha512-qACXdu/9VHPBzcyhdOWR5/IahhGMf0roTeZJfzz077GwylcDd90yOHLouhmv7GJ5XzPi6ekaQWd8AvPP2nOvpA==", + "dev": true, + "requires": { + "duplexer": "^0.1.1", + "from": "^0.1.7", + "map-stream": "0.0.7", + "pause-stream": "^0.0.11", + "split": "^1.0.1", + "stream-combiner": "^0.2.2", + "through": "^2.3.8" + } + }, "events": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/events/-/events-3.1.0.tgz", @@ -7138,6 +7125,12 @@ "map-cache": "^0.2.2" } }, + "from": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", + "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", + "dev": true + }, "from2": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", @@ -7761,12 +7754,6 @@ "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", "dev": true }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, "get-stream": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", @@ -7928,6 +7915,12 @@ "wordwrap": "^1.0.0" } }, + "hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "optional": true + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -8237,9 +8230,9 @@ "dev": true }, "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "optional": true }, "indexes-of": { @@ -8441,6 +8434,7 @@ "version": "1.0.0", "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, "requires": { "builtin-modules": "^1.0.0" } @@ -8508,15 +8502,6 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, "is-glob": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", @@ -8667,9 +8652,9 @@ "optional": true }, "jquery": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz", - "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==" + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", + "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==" }, "jquery-match-height": { "version": "0.7.2", @@ -8737,8 +8722,7 @@ "jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", - "optional": true + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" }, "jsx-ast-utils": { "version": "2.2.3", @@ -9015,16 +8999,6 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "optional": true, - "requires": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" - } - }, "lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -9064,11 +9038,17 @@ "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" }, "map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", + "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", "optional": true }, + "map-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz", + "integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=", + "dev": true + }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -9130,40 +9110,52 @@ } }, "meow": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", - "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.0.1.tgz", + "integrity": "sha512-tBKIQqVrAHqwit0vfuFPY3LlzJYkEOFyKa3bPgxzNl6q/RtN8KQ+ALYEASYuFayzSAsjlhXj/JZ10rH85Q6TUw==", "optional": true, "requires": { - "camelcase-keys": "^4.0.0", - "decamelize-keys": "^1.0.0", - "loud-rejection": "^1.0.0", - "minimist-options": "^3.0.1", - "normalize-package-data": "^2.3.4", - "read-pkg-up": "^3.0.0", - "redent": "^2.0.0", - "trim-newlines": "^2.0.0", - "yargs-parser": "^10.0.0" + "@types/minimist": "^1.2.0", + "arrify": "^2.0.1", + "camelcase": "^6.0.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "^4.0.2", + "normalize-package-data": "^2.5.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.13.1", + "yargs-parser": "^18.1.3" }, "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "optional": true, "requires": { - "locate-path": "^2.0.0" + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "optional": true, "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" + "path-parse": "^1.0.6" } + }, + "type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "optional": true } } }, @@ -9225,6 +9217,12 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" }, + "min-indent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.0.tgz", + "integrity": "sha1-z8RcN+nsDY8KDsPdTvf3w6vjklY=", + "optional": true + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -9251,13 +9249,21 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "minimist-options": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", - "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.0.2.tgz", + "integrity": "sha512-seq4hpWkYSUh1y7NXxzucwAN9yVlBc3Upgdjz8vLCP97jG8kaOmzYrVH/m7tQ1NYD1wdtZbSLfdy4zFmRWuc/w==", "optional": true, "requires": { "arrify": "^1.0.1", "is-plain-obj": "^1.1.0" + }, + "dependencies": { + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "optional": true + } } }, "minipass": { @@ -9490,15 +9496,16 @@ } }, "node-releases": { - "version": "1.1.53", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.53.tgz", - "integrity": "sha512-wp8zyQVwef2hpZ/dJH7SfSrIPD6YoJz6BDQDpGEkcA0s3LpAQoxBIYmfIq6QAhC1DhwsyCgTaTTcONwX8qzCuQ==", + "version": "1.1.55", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.55.tgz", + "integrity": "sha512-H3R3YR/8TjT5WPin/wOoHOUPHgvj8leuU/Keta/rwelEQN9pA/S2Dx8/se4pZ2LBxSd0nAGzsNzhqwa77v7F1w==", "dev": true }, "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, "requires": { "hosted-git-info": "^2.1.4", "is-builtin-module": "^1.0.0", @@ -13062,12 +13069,6 @@ "path-key": "^2.0.0" } }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -13465,6 +13466,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, "requires": { "pify": "^3.0.0" }, @@ -13472,7 +13474,8 @@ "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true } } }, @@ -13518,6 +13521,11 @@ "resolved": "https://registry.npmjs.org/bootstrap-switch/-/bootstrap-switch-3.3.4.tgz", "integrity": "sha1-cOCusqh3wNx2aZHeEI4hcPwpov8=", "optional": true + }, + "jquery": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz", + "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==" } } }, @@ -13693,6 +13701,15 @@ } } }, + "pause-stream": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "dev": true, + "requires": { + "through": "~2.3" + } + }, "pbkdf2": { "version": "3.0.17", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", @@ -14091,9 +14108,9 @@ "dev": true }, "quick-lru": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", - "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", "optional": true }, "raf": { @@ -14459,17 +14476,6 @@ "classnames": "^2.2.5" } }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "optional": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } - }, "read-pkg-up": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", @@ -14616,6 +14622,12 @@ "readable-stream": "^2.0.2" } }, + "readline-transform": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/readline-transform/-/readline-transform-1.0.0.tgz", + "integrity": "sha512-7KA6+N9IGat52d83dvxnApAWN+MtVb1MiVuMR/cf1O4kYsJG+g/Aav0AHcHKsb6StinayfPLne0+fMX2sOzAKg==", + "dev": true + }, "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", @@ -14639,13 +14651,13 @@ } }, "redent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", - "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", "optional": true, "requires": { - "indent-string": "^3.0.0", - "strip-indent": "^2.0.0" + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" } }, "redeyed": { @@ -14697,9 +14709,9 @@ }, "dependencies": { "@babel/runtime": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz", - "integrity": "sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.6.tgz", + "integrity": "sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ==", "dev": true, "requires": { "regenerator-runtime": "^0.13.4" @@ -14805,12 +14817,6 @@ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, "resolve": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", @@ -15473,7 +15479,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", - "optional": true, "requires": { "through": "2" } @@ -15539,6 +15544,16 @@ "readable-stream": "^2.0.2" } }, + "stream-combiner": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz", + "integrity": "sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=", + "dev": true, + "requires": { + "duplexer": "~0.1.1", + "through": "~2.3.4" + } + }, "stream-combiner2": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", @@ -15578,17 +15593,6 @@ "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", "dev": true }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, "string.prototype.matchall": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.2.tgz", @@ -15653,15 +15657,6 @@ "safe-buffer": "~5.1.0" } }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, "strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -15680,10 +15675,13 @@ "optional": true }, "strip-indent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", - "optional": true + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "optional": true, + "requires": { + "min-indent": "^1.0.0" + } }, "strip-json-comments": { "version": "2.0.1", @@ -16191,9 +16189,9 @@ "optional": true }, "trim-newlines": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", + "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", "optional": true }, "trim-off-newlines": { @@ -16251,20 +16249,12 @@ "integrity": "sha512-T3PVJ6uz8i0HzPxOF9SWzWAlfN/DavlpQqepn22xgve/5QecC+XMCAtmUNnY7C9StehaV6exjUCI801lOI7QlQ==" }, "uglify-js": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.1.tgz", - "integrity": "sha512-JUPoL1jHsc9fOjVFHdQIhqEEJsQvfKDjlubcCilu8U26uZ73qOg8VsN8O1jbuei44ZPlwL7kmbAdM4tzaUvqnA==", + "version": "3.9.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.3.tgz", + "integrity": "sha512-r5ImcL6QyzQGVimQoov3aL2ZScywrOgBXGndbWrdehKoSvGe/RmiE5Jpw/v+GvxODt6l2tpBXwA7n+qZVlHBMA==", "optional": true, "requires": { "commander": "~2.20.3" - }, - "dependencies": { - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "optional": true - } } }, "uncontrollable": { @@ -17086,16 +17076,6 @@ "errno": "~0.1.7" } }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -17124,12 +17104,6 @@ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true - }, "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", @@ -17165,7 +17139,6 @@ "version": "15.3.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", - "optional": true, "requires": { "cliui": "^6.0.0", "decamelize": "^1.2.0", @@ -17183,20 +17156,17 @@ "ansi-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "optional": true + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "optional": true + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "optional": true, "requires": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -17205,20 +17175,17 @@ "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "optional": true + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "optional": true + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "optional": true, "requires": { "p-locate": "^4.1.0" } @@ -17227,7 +17194,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "optional": true, "requires": { "p-try": "^2.0.0" } @@ -17236,7 +17202,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "optional": true, "requires": { "p-limit": "^2.2.0" } @@ -17244,26 +17209,22 @@ "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "optional": true + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "optional": true + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "optional": true + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "optional": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -17274,7 +17235,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "optional": true, "requires": { "ansi-regex": "^5.0.0" } @@ -17282,14 +17242,12 @@ "y18n": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "optional": true + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" }, "yargs-parser": { "version": "18.1.3", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "optional": true, "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" @@ -17298,12 +17256,21 @@ } }, "yargs-parser": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", - "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "optional": true, "requires": { - "camelcase": "^4.1.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "optional": true + } } } } diff --git a/src/cockpit/389-console/package.json b/src/cockpit/389-console/package.json index 44d89d399..3d4cb7c86 100644 --- a/src/cockpit/389-console/package.json +++ b/src/cockpit/389-console/package.json @@ -16,11 +16,11 @@ "eslint:fix": "eslint --fix --ext .jsx --ext .es6 src/" }, "devDependencies": { - "@babel/core": "^7.9.0", + "@babel/core": "^7.9.6", "@babel/plugin-proposal-class-properties": "^7.8.3", - "@babel/preset-env": "^7.9.5", + "@babel/preset-env": "^7.9.6", "@babel/preset-react": "^7.9.4", - "audit-ci": "^1.7.0", + "audit-ci": "^3.0.0", "babel-eslint": "^9.0.0", "babel-loader": "^8.1.0", "compression-webpack-plugin": "^3.1.0", @@ -34,7 +34,7 @@ "eslint-plugin-import": "^2.20.2", "eslint-plugin-node": "^7.0.1", "eslint-plugin-promise": "^4.2.1", - "eslint-plugin-react": "^7.19.0", + "eslint-plugin-react": "^7.20.0", "eslint-plugin-standard": "^3.1.0", "extract-text-webpack-plugin": "^4.0.0-beta.0", "style-loader": "^0.23.1", @@ -42,8 +42,8 @@ "webpack-cli": "^3.3.11" }, "dependencies": { - "@restart/hooks": "^0.3.22", - "bootstrap": "^4.4.1", + "@restart/hooks": "^0.3.25", + "bootstrap": "^4.5.0", "bootstrap-switch": "^3.4.0", "classnames": "^2.2.6", "cockpit": "^0.1.1",
0
377583a06cecb76d2150d136086e7063c0c1f9fe
389ds/389-ds-base
Ticket 48382 - Fix serverCmd to get sbin dir properly Description: On RHEL 6 test scripts would fail to execute sbin commands like stop-dirsrv, start-dirsrv etc., because the path to them is wrong. Fix description: Get sbin dir properly using the existing function from utils.py https://fedorahosted.org/389/ticket/48382 Reviewed by: nhosoi (Thanks!!)
commit 377583a06cecb76d2150d136086e7063c0c1f9fe Author: Simon Pichugin <[email protected]> Date: Wed Jul 27 22:29:46 2016 +0200 Ticket 48382 - Fix serverCmd to get sbin dir properly Description: On RHEL 6 test scripts would fail to execute sbin commands like stop-dirsrv, start-dirsrv etc., because the path to them is wrong. Fix description: Get sbin dir properly using the existing function from utils.py https://fedorahosted.org/389/ticket/48382 Reviewed by: nhosoi (Thanks!!) diff --git a/src/lib389/lib389/tools.py b/src/lib389/lib389/tools.py index 852686a2c..59649c882 100644 --- a/src/lib389/lib389/tools.py +++ b/src/lib389/lib389/tools.py @@ -234,8 +234,7 @@ class DirSrvTools(object): assert len(props) == 1 self.sroot = props[0][CONF_SERVER_DIR] - # instanceDir = os.path.join(self.sroot, "slapd-" + self.inst) - sbinDir = os.path.join(self.prefix + '/sbin') + sbinDir = get_sbin_dir(prefix=self.prefix) if hasattr(self, 'errlog'): errLog = self.errlog
0
0d9886e7524277a0ffd1a925dbdff2e0e01ae874
389ds/389-ds-base
Ticket 49811 - Update man pages Bug Description: A recent man page scan revealed several errors and warnings. Fix Description: Added missing man pages, fixed syntax issues, and added new man pages for config files. Also added dynamic man page creation for the lib389 CLI tools using python-argparse-manpages https://pagure.io/389-ds-base/issue/49811 Reviewed by: spichugi & vashirov(Thanks!!)
commit 0d9886e7524277a0ffd1a925dbdff2e0e01ae874 Author: Mark Reynolds <[email protected]> Date: Wed Jun 27 23:26:16 2018 -0400 Ticket 49811 - Update man pages Bug Description: A recent man page scan revealed several errors and warnings. Fix Description: Added missing man pages, fixed syntax issues, and added new man pages for config files. Also added dynamic man page creation for the lib389 CLI tools using python-argparse-manpages https://pagure.io/389-ds-base/issue/49811 Reviewed by: spichugi & vashirov(Thanks!!) diff --git a/Makefile.am b/Makefile.am index 76b748976..fdb13f308 100644 --- a/Makefile.am +++ b/Makefile.am @@ -939,6 +939,7 @@ include_HEADERS = src/svrcore/src/svrcore.h #------------------------ dist_man_MANS = man/man1/dbscan.1 \ man/man1/cl-dump.1 \ + man/man1/cl-dump.pl.1 \ man/man1/dbgen.pl.1 \ man/man1/ds-logpipe.py.1 \ man/man1/ds-replcheck.1 \ @@ -951,8 +952,10 @@ dist_man_MANS = man/man1/dbscan.1 \ man/man1/mmldif.1 \ man/man1/pwdhash.1 \ man/man1/repl-monitor.1 \ + man/man1/repl-monitor.pl.1 \ man/man1/rsearch.1 \ man/man1/readnsstate.1 \ + man/man5/99user.ldif.5 \ man/man8/migrate-ds.pl.8 \ man/man8/ns-slapd.8 \ man/man8/restart-dirsrv.8 \ @@ -960,23 +963,48 @@ dist_man_MANS = man/man1/dbscan.1 \ man/man8/start-dirsrv.8 \ man/man8/stop-dirsrv.8 \ man/man8/status-dirsrv.8 \ - man/man8/bak2db.8 man/man8/bak2db.pl.8 \ - man/man8/db2bak.8 man/man8/db2bak.pl.8 \ - man/man8/db2ldif.8 man/man8/db2ldif.pl.8 \ - man/man8/db2index.8 man/man8/db2index.pl.8 \ - man/man8/ldif2db.8 man/man8/ldif2db.pl.8 \ - man/man8/dbverify.8 man/man8/verify-db.pl.8 \ + man/man8/bak2db.8 \ + man/man8/bak2db.pl.8 \ + man/man5/certmap.conf.5 \ + man/man8/cleanallruv.pl.8 \ + man/man8/dbverify.8 \ + man/man8/db2bak.8 \ + man/man8/db2bak.pl.8 \ + man/man8/db2ldif.8 \ + man/man8/db2ldif.pl.8 \ + man/man8/db2index.8 \ + man/man8/db2index.pl.8 \ + man/man8/dsconf.8 \ + man/man8/dsctl.8 \ + man/man8/dsidm.8 \ + man/man8/dscreate.8 \ + man/man8/fixup-linkedattrs.pl.8 \ + man/man8/fixup-memberof.pl.8 \ + man/man8/ldif2db.8 \ + man/man8/ldif2db.pl.8 \ man/man8/dbmon.sh.8 \ - man/man8/dn2rdn.8 man/man8/ldif2ldap.8 \ - man/man8/restoreconfig.8 man/man8/saveconfig.8 \ - man/man8/suffix2instance.8 man/man8/monitor.8 \ - man/man8/upgradednformat.8 man/man8/vlvindex.8 \ - man/man8/cleanallruv.pl.8 man/man8/schema-reload.pl.8 \ - man/man8/fixup-linkedattrs.pl.8 man/man8/fixup-memberof.pl.8 \ - man/man8/syntax-validate.pl.8 man/man8/usn-tombstone-cleanup.pl.8 \ - man/man8/ns-accountstatus.pl.8 man/man8/ns-newpwpolicy.pl.8 \ - man/man8/ns-activate.pl.8 man/man8/ns-inactivate.pl.8 \ - man/man8/upgradedb.8 man/man8/remove-ds.pl.8 + man/man5/dirsrv.5 \ + man/man5/dirsrv.systemd.5 \ + man/man8/dn2rdn.8 \ + man/man8/ldif2ldap.8 \ + man/man8/monitor.8 \ + man/man8/ns-accountstatus.pl.8 \ + man/man8/ns-newpwpolicy.pl.8 \ + man/man8/ns-activate.pl.8 \ + man/man8/ns-inactivate.pl.8 \ + man/man8/remove-ds.pl.8 \ + man/man8/restoreconfig.8 \ + man/man8/saveconfig.8 \ + man/man8/schema-reload.pl.8 \ + man/man5/slapd-collations.conf.5 \ + man/man8/suffix2instance.8 \ + man/man8/syntax-validate.pl.8 \ + man/man5/template-initconfig.5 \ + man/man8/upgradednformat.8 \ + man/man8/upgradedb.8 \ + man/man8/usn-tombstone-cleanup.pl.8 \ + man/man8/vlvindex.8 \ + man/man8/verify-db.pl.8 #------------------------ # updates @@ -2352,7 +2380,7 @@ git-archive: # How will we update this to python 3? lib389: src/lib389/setup.py - cd $(srcdir)/src/lib389; $(PYTHON) setup.py build + cd $(srcdir)/src/lib389; $(PYTHON) setup.py build ; $(PYTHON) setup.py build_manpages lib389-install: lib389 cd $(srcdir)/src/lib389; $(PYTHON) setup.py install --skip-build --force diff --git a/ldap/admin/src/template-initconfig.in b/ldap/admin/src/template-initconfig.in index 03a692224..f260c384c 100644 --- a/ldap/admin/src/template-initconfig.in +++ b/ldap/admin/src/template-initconfig.in @@ -1,5 +1,5 @@ # This file is sourced by @package_name@ upon startup to set -# the default environment for a single specific directory +# the default environment for a single specific directory # server instances. To set defaults for all instances, edit # the file in the same directory called @package_name@. diff --git a/ldap/schema/slapd-collations.conf b/ldap/schema/slapd-collations.conf index 31fa47772..583393b67 100644 --- a/ldap/schema/slapd-collations.conf +++ b/ldap/schema/slapd-collations.conf @@ -1,7 +1,7 @@ # # BEGIN COPYRIGHT BLOCK # Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. -# Copyright (C) 2005 Red Hat, Inc. +# Copyright (C) 2018 Red Hat, Inc. # All rights reserved. # # License: GPL (version 3 or any later version). diff --git a/lib/ldaputil/certmap.conf b/lib/ldaputil/certmap.conf index b490787b9..386e10037 100644 --- a/lib/ldaputil/certmap.conf +++ b/lib/ldaputil/certmap.conf @@ -1,7 +1,7 @@ # # BEGIN COPYRIGHT BLOCK # Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. -# Copyright (C) 2005 Red Hat, Inc. +# Copyright (C) 2018 Red Hat, Inc. # All rights reserved. # # License: GPL (version 3 or any later version). diff --git a/man/man1/cl-dump.pl.1 b/man/man1/cl-dump.pl.1 new file mode 100644 index 000000000..4d63a55b7 --- /dev/null +++ b/man/man1/cl-dump.pl.1 @@ -0,0 +1,96 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH CL-DUMP.PL 1 "March 31, 2017" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp <n> insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +cl-dump \- Dump and decode Directory Server replication change log +.SH SYNOPSIS +.B cl\-dump.pl +[\fI\-h host\fR] [\fI\-p port\fR] [\fI\-D bind\(hydn\fR] \-w bind\(hypassword | \-P bind\(hycert + [\fI\-r replica\(hyroots\fR] [\fI\-o output\(hyfile\fR] [\fI\-c\fR] [\fI\-v\fR] + +.PP +.B cl\-dump.pl +\-i changelog\(hyldif\(hyfile\(hywith\(hybase64encoding [\fI\-o output\(hyfile\fR] [\fI\-c\fR] +.PP +.SH DESCRIPTION +Dump and decode Directory Server replication change log +.PP +.\" TeX users may be more comfortable with the \fB<whatever>\fP and +.\" \fI<whatever>\fP escape sequences to invode bold face and italics, +.\" respectively. +.SH OPTIONS +A summary of options is included below. +.TP +.B \-c +Dump and interpret CSN only. This option can be used with or +without \-i option. +.TP +.B \-D bind\-dn +Directory server's bind DN. Default to "cn=Directory Manager" if +the option is omitted. +.TP +.B \-h host +Directory server's host. Default to the server where the script +is running. +.TP +.B \-i changelog\(hyldif\(hyfile\(hywith\(hybase64encoding +If you already have a ldif-like changelog, but the changes +in that file are encoded, you may use this option to +decode that ldif-like changelog. +.TP +.B \-o output\(hyfile +Path name for the final result. Default to STDOUT if omitted. +.TP +.B \-p port +Directory server's port. Default to 389. +.TP +.B \-P bind\(hycert +Pathname of binding certificate DB +.TP +.B \-r replica\(hyroots +Specify replica roots whose changelog you want to dump. The replica +roots may be separated by comma. All the replica roots would be +dumped if the option is omitted. +.TP +.B \-v +Print the version of this script. +.TP +.B \-w bind\(hypassword +Password for the bind DN +.SH RESTRICTIONS +If you are not using \-i option, the script should be run when the server +is running, and from where the server's changelog directory is accessible. +.br +.SH SEE ALSO +.BR repl-monitor (1) +.br +.SH AUTHOR +cl-dump.pl was written by the 389 Project. +.SH "REPORTING BUGS" +Report bugs to https://pagure.io/389-ds-base/new_issue +.SH COPYRIGHT +Copyright \(co 2001 Sun Microsystems, Inc. Used by permission. +.br +Copyright \(co 2018 Red Hat, Inc. +.br +This manual page was written by Michele Baldessari <[email protected]>, +for the Debian project (but may be used by others). +.br +This is free software. You may redistribute copies of it under the terms of +the Directory Server license found in the LICENSE file of this +software distribution. This license is essentially the GNU General Public +License version 2 with an exception for plug-in distribution. diff --git a/man/man1/ds-logpipe.py.1 b/man/man1/ds-logpipe.py.1 index 0a6c15aab..b55d7866a 100644 --- a/man/man1/ds-logpipe.py.1 +++ b/man/man1/ds-logpipe.py.1 @@ -83,7 +83,7 @@ The directory server will usually need to be configured to log to the named pipe NOTE: Before doing this, you should save your current configuration so you can restore it later. ldapsearch ... \-s base \-b "cn=config" nsslapd-accesslog-maxlogsperdir nsslapd-accesslog-logexpirationtime \ - nsslapd-accesslog-logrotationtime nsslapd-accesslog nsslapd-accesslog > savedaccesslog.ldif + nsslapd-accesslog-logrotationtime nsslapd-accesslog > savedaccesslog.ldif The error log and audit log have similarly named configuration attributes e.g. nsslapd-errorlog, nsslapd-auditlog. Note that the audit log is disabled by default - use nsslapd-auditlog-logging-enabled: on to enable it. .br @@ -92,7 +92,7 @@ ds-logpipe.py was written by the 389 Project. .SH "REPORTING BUGS" Report bugs to https://pagure.io/389-ds-base/new_issue .SH COPYRIGHT -Copyright \(co 2017 Red Hat, Inc. +Copyright \(co 2018 Red Hat, Inc. .br This is free software. You may redistribute copies of it under the terms of the Directory Server license found in the LICENSE file of this diff --git a/man/man1/ds-replcheck.1 b/man/man1/ds-replcheck.1 index 3f14e11c8..e60438c70 100644 --- a/man/man1/ds-replcheck.1 +++ b/man/man1/ds-replcheck.1 @@ -49,7 +49,7 @@ Prompt for the Directory Manager password (online mode) The LDAP Url for the first replica (online mode) .TP .B \fB\-r\fR \fILDAP URL\fR -The LDAP Url for the the second replica (online mode) +The LDAP Url for the second replica (online mode) .TP .B \fB\-b\fR \fISUFFIX\fR The replication suffix. (online & offline) diff --git a/man/man1/ldclt.1 b/man/man1/ldclt.1 index 451a88b92..4cb6b916d 100644 --- a/man/man1/ldclt.1 +++ b/man/man1/ldclt.1 @@ -125,7 +125,7 @@ Execution parameters: .br \fBappend\fR entries to the genldif file. .br -\fBascii\fR ascii 7\-bits strings. +\fBascii\fR use ascii 7\-bits strings. .br \fBattreplace=name:mask\fR replace attribute of existing entry. .br @@ -224,7 +224,7 @@ Report bugs to https://pagure.io/389-ds-base/new_issue .SH COPYRIGHT Copyright \(co 2001 Sun Microsystems, Inc. Used by permission. .br -Copyright \(co 2017 Red Hat, Inc. +Copyright \(co 2018 Red Hat, Inc. .br This manual page was written by Michele Baldessari <[email protected]>, for the Debian project (but may be used by others). diff --git a/man/man1/repl-monitor.pl.1 b/man/man1/repl-monitor.pl.1 new file mode 100644 index 000000000..c9bdb69b9 --- /dev/null +++ b/man/man1/repl-monitor.pl.1 @@ -0,0 +1,138 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH REPL-MONITOR.PL 1 "March 31, 2017" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp <n> insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +repl-monitor.pl \- Directory Server replication monitor +.SH SYNOPSIS +.B repl\(hymonitor.pl +\ [\-f configuration\(hyfile] [\fI\(hyh host\fR] [\fI\-p port\fR] [\fI\-r\fR] +[\fI\-c connection\fR] [\fI\-a alias\fR] [\fI\-k color\fR] [\fI\-u refresh\(hyurl\fR] +[\fI\-s\fR] [\fI\-t refresh\(hyinterval\fR] [\fI\-v\fR] + +.SH DESCRIPTION +Outputs the status of all of the configured Directory Servers +participating in replication. The servers to query for status +are specified in the configuration file. +.PP +.\" TeX users may be more comfortable with the \fB<whatever>\fP and +.\" \fI<whatever>\fP escape sequences to invode bold face and italics, +.\" respectively. +.SH OPTIONS +A summary of options is included below: +.TP +.B \-h, \-\-host\fR host +Hostname of DS server +.TP +.B \-p, \-\-port\fR port +TCP port +.TP +.B \-f, \-\-configfile\fR configuration-file +Configuration file +.TP +.B \-c, \-\-conn\fR connection +Uses the same format as the configfile directive +.TP +.B \-a, \-\-alias\fR alias +Uses the same format as the configfile directive +.TP +.B \-k, --color\fR color +Uses the same format as the configfile directive +.TP +.B \-r, --skip-header\fR +Removes extra HTML tags +.TP +.B \-u, \-\-refreshurl\fR refresh url +Refresh url +.TP +.B \-t, \-\-interval\fR refresh interval +Refresh interval +.TP +.B \-W, \-\-prompt +Prompt for passwords +.TP +.B \-s, \-\-text +Print plain text report + +.br +.SH CONFIGURATION FILE +This section describes the various directives that can be used in the configuration file. +.TP +.B [connection] +The connection details about a replica +.br + +host:port:binddn:bindpwd:cert_file +.br + +or, +.br + +host:port=shadowport:binddn:bindpwd:cert_file +.TP +.B [alias] +Define an alias for a server, this alias is used in the report in place of the +hostname/port + +.br +alias = host:port +.TP +.B [color] +Set a color based on the replicaton lag time lowmark (in minutes) +.br + +.R lowmark = color +.SH EXAMPLE +Example of a configuration file: + +[connection] +.br +localhost.localdomain:3891:cn=directory manager:password:* +.br +localhost2.localdomain:3892:cn=directory manager:password:* + +[alias] +.br +MY_SYSTEM1 = localhost.localdomain:3891 +.br +MY_SYSTEM2 = localhost2.localdomain:3892 + +[color] +.br +0 = #CCFFCC +.br +5 = #FFFFCC +.br +60 = #FFCCCC + +.SH AUTHOR +repl-monitor.pl was written by the 389 Project. +.SH "REPORTING BUGS" +Report bugs to https://pagure.io/389-ds-base/new_issue +.SH COPYRIGHT +Copyright \(co 2001 Sun Microsystems, Inc. Used by permission. +.br +Copyright \(co 2018 Red Hat, Inc. +.br +This manual page was written by Michele Baldessari <[email protected]>, +for the Debian project (but may be used by others). +.br +Manual page updated by Mark Reynolds <[email protected]> 3/31/2017 +.br +This is free software. You may redistribute copies of it under the terms of +the Directory Server license found in the LICENSE file of this +software distribution. This license is essentially the GNU General Public +License version 3 with an exception for plug\(hyin distribution. diff --git a/man/man5/99user.ldif.5 b/man/man5/99user.ldif.5 new file mode 100644 index 000000000..ca5e16132 --- /dev/null +++ b/man/man5/99user.ldif.5 @@ -0,0 +1,54 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH 99USER.LDIF 5 "Jun 26, 2018" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp <n> insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +/etc/dirsrv/schema/99user.ldif - LDIF file containing custom LDAP Schema for 389 Directory Server. + +.SH SYNOPSIS +/etc/dirsrv/schema/99user.ldif + +.SH DESCRIPTION +99user.ldif + +This file contains user defined, or custom, LDAP schema definitions (attributes +and objectclasses) used by the Directory Server. + +.SH SYNTAX + +attributeTypes: VALUE +.br +objectClasses: VALUE +.br + +.SH EXAMPLE + +dn: cn=schema +.br +attributeTypes: ( 1.1.1.1.1.1.1 NAME 'myNewAttribute' DESC 'Custom defined +attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN +'user-defined' ) +.br +objectClasses: ( 1.1.1.1.1.1.1.2 NAME 'myNewObjectcass' DESC 'Custom defined +objectclass' SUP top MUST ( myNewAttrbiute ) MAY ( uid $ cn ) X-ORIGIN 'user-defined' ) + +.SH AUTHOR +99user.ldif was written by the 389 Project. +.SH "REPORTING BUGS" +Report bugs to https://pagure.io/389-ds-base/new_issue +.SH COPYRIGHT +Copyright \(co 2018 Red Hat, Inc. + diff --git a/man/man5/certmap.conf.5 b/man/man5/certmap.conf.5 new file mode 100644 index 000000000..30a3db84a --- /dev/null +++ b/man/man5/certmap.conf.5 @@ -0,0 +1,133 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH CERTMAP.CONF 5 "Jun 26, 2018" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp <n> insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +/etc/dirsrv/config/certmap.conf - Configuration file for TLS client authentication in 389 Directory Server. + +.SH SYNOPSIS +/etc/dirsrv/config/certmap.conf + +.SH DESCRIPTION +certmap.conf + +This file configures how a certificate is mapped to an LDAP entry. See the +documentation for more information on this file: https://access.redhat.com/documentation/en-us/red_hat_directory_server/10/html/configuration_command_and_file_reference/configuration_file_reference#certmap_conf + +.SH SYNTAX +The format of this file is as follows: +.br + certmap <name> <issuerDN> +.br + <name>:<prop1> [<val1>] +.br + <name>:<prop2> [<val2>] +.br + +Notes: + + 1. Mapping can be defined per issuer of a certificate. If mapping doesn't + exists for a particular 'issuerDN' then the server uses the default + mapping. + + 2. There must be an entry for <name>=default and issuerDN "default". + This mapping is the default mapping. + + 3. '#' can be used to comment out a line. + + 4. DNComps & FilterComps are used to form the base DN and filter responsible for + performing an LDAP search while mapping the certificate to a user entry. + +.SH OPTIONS +.IP DNComps +The DNComps parameter determines how Directory Server generates the base DN +used to search for a user in the directory. This setting accepts a comma +separated list of attributes to form a DN. However, the order of the +attributes in the DNComps parameter must match the order in the subject of the +certificate. For example, if your certificate's subject is +"[email protected],cn=user_name,o=Example Inc.,c=US", and you want +Directory Server to use "cn=user_name,o=Example Inc.,c=US" as the base DN when +searching for the user, set the DNComps parameter to "cn, o, c". + +Comment out or do not set this parameter, if either the subject field of the +certificate matches exactly the DN of the user in Directory Server or if you +want to use the setting from the CmapLdapAttr parameter. + +If the value is empty, it will search the entire LDAP tree by using the +FilterComps parameter. + +.IP FilterComps +This parameter sets which attributes from the subject field of the certificate +Directory Server uses to generate the search filter to locate the user. + +Set this parameter to a comma-separated list of attributes used in the +certificate's subject. Directory Server will use these attributes in an AND +operation in the filter. + +Note - Certificate Subjects use the e attribute for the email address, which +does not exist in the default Directory Server schema. For this reason, +Directory Server automatically maps this attribute to the mail attribute. This +means, if you use the mail attribute in the FilterComps parameter, Directory +Server reads the value of the e attribute from the subject of the certificate. + +For example, if the subject of a certificate is +"[email protected],cn=user_name,dc=example,dc=com,o=Example Inc.,c=US" +and you want to dynamically generate the +"(&(mail=username@domain)(cn=user_name))" filter, set the FilterComps parameter +to "mail, cn". + +If the parameter is commented out or set to an empty value, the (objectclass=*) filter will be used. + +.IP verifycert +Directory Server always verifies if the certificate has been issued by a +trusted Certificate Authority (CA). However, if you additionally set the +verifycert parameter to on, Directory Server additionally verifies that the +certificate matches the Distinguished Encoding Rules (DER)-formatted +certificate stored in the userCertificate binary attribute of the user. + +If you do not set this parameter, verifycert is disabled + +.IP CmapLdapAttr +If your user entries contain an attribute that stores the subject DN of the +user certificate, set the CmapLdapAttr to this attribute name. Directory Server +will use this attribute and the subject DN to locate the user. In this case the +no filter is generated based on the attributes in the FilterComps parameter. + + +.SH EXAMPLES +certmap default default +.br +default:DNComps cn, o, c +.br +#default:FilterComps e, uid +.br +#default:verifycert on +.br +#default:CmapLdapAttr certSubjectDN +.br +.sp 1 +certmap example o=Example Inc.,c=US +.br +example:DNComps +.br + +.SH AUTHOR +certmap.conf was written by the 389 Project. +.SH "REPORTING BUGS" +Report bugs to https://pagure.io/389-ds-base/new_issue +.SH COPYRIGHT +Copyright \(co 2018 Red Hat, Inc. + diff --git a/man/man5/dirsrv.5 b/man/man5/dirsrv.5 new file mode 100644 index 000000000..b82048493 --- /dev/null +++ b/man/man5/dirsrv.5 @@ -0,0 +1,46 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH DIRSRV 5 "Jun 26, 2018" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp <n> insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +/etc/sysconfig/dirsrv - Systemd EnvironmentFile that affects all Directory Server instances. + +.SH SYNOPSIS +/etc/sysconfig/dirsrv + +.SH DESCRIPTION +dirsrv + +This file is sourced by dirsrv upon startup to set +the default environment for all directory server instances. +To set instance specific defaults, use the file in the same +directory called dirsrv-instance where "instance" +is the name of your directory server instance e.g. +dirsrv-localhost for the slapd-localhost instance. + +This file is in systemd EnvironmentFile format - see man systemd.exec + +.SH EXAMPLE +LD_PRELOAD=/usr/lib64/dirsrv/lib/libjemalloc.so + + +.SH AUTHOR +dirsrv was written by the 389 Project. +.SH "REPORTING BUGS" +Report bugs to https://pagure.io/389-ds-base/new_issue +.SH COPYRIGHT +Copyright \(co 2018 Red Hat, Inc. + diff --git a/man/man5/dirsrv.systemd.5 b/man/man5/dirsrv.systemd.5 new file mode 100644 index 000000000..1a5cf7526 --- /dev/null +++ b/man/man5/dirsrv.systemd.5 @@ -0,0 +1,39 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH DIRSRV.SYSTEMD 5 "Jun 26, 2018" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp <n> insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +/etc/sysconfig/dirsrv.systemd - Systemd EnvironmentFile for Directory Server. + +.SH SYNOPSIS +/etc/sysconfig/dirsrv.systemd + +.SH DESCRIPTION +dirsrv.systemd + +This controls the resources to the direct child of systemd, in +this case ns-slapd. Because we are type notify we recieve these +limits correctly. + +For more inforation see man systemd.exec and man systemd.resource-control + +.SH AUTHOR +dirsrv.systemd was written by the 389 Project. +.SH "REPORTING BUGS" +Report bugs to https://pagure.io/389-ds-base/new_issue +.SH COPYRIGHT +Copyright \(co 2018 Red Hat, Inc. + diff --git a/man/man5/slapd-collations.conf.5 b/man/man5/slapd-collations.conf.5 new file mode 100644 index 000000000..daac4f9c1 --- /dev/null +++ b/man/man5/slapd-collations.conf.5 @@ -0,0 +1,51 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH SLAPD-COLLATIONS.CONF 5 "Jun 26, 2018" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp <n> insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +/etc/dirsrv/config/slapd-collations.conf - Contains the language tags and OID's used in 389 Directory Server. + +.SH SYNOPSIS +/etc/dirsrv/config/slapd-collations.conf + +.SH DESCRIPTION +slapd-collations.conf + +This file contains all the collation rules (tags and OID's) that are used by the Directory Server. + +.SH SYNTAX + +.IP collation +This parameter is laid out as following: language, country, variant, strength, decomposition, oid, oid ... + +.SH EXAMPLE +collation "" "" "" 1 3 2.16.840.1.113730.3.3.2.0.1 default +.br +collation ar "" "" 1 3 2.16.840.1.113730.3.3.2.1.1 ar +.br +collation be "" "" 1 3 2.16.840.1.113730.3.3.2.2.1 be be-BY +.br +\&.\&.\&. +.br +\&.\&.\&. + +.SH AUTHOR +slapd-collations.conf was written by the 389 Project. +.SH "REPORTING BUGS" +Report bugs to https://pagure.io/389-ds-base/new_issue +.SH COPYRIGHT +Copyright \(co 2018 Red Hat, Inc. + diff --git a/man/man5/template-initconfig.5 b/man/man5/template-initconfig.5 new file mode 100644 index 000000000..19fba2e0c --- /dev/null +++ b/man/man5/template-initconfig.5 @@ -0,0 +1,62 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH TEMPLATE-INITCONFIG 5 "Jun 26, 2018" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp <n> insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +/etc/dirsrv/config/template-initconfig - Systemd configuration file used when starting a Directory Server instance. + +.SH SYNOPSIS +/etc/dirsrv/config/template-initconfig + +.SH DESCRIPTION +template-initconfig + +This file is sourced by dirsrv upon startup to set +the default environment for a single specific directory +server instances. To set defaults for all instances, edit +the file in the same directory named dirsrv. + +These settings are used by the start-dirsrv and +start-slapd scripts (as well as their associates stop +and restart scripts). Do not edit them unless you know +what you are doing. + +This file is in systemd EnvironmentFile format - see man systemd.exec + +.SH SYNTAX +SERVER_DIR={{SERVER-DIR}} +.br +SERVERBIN_DIR={{SERVERBIN-DIR}} +.br +CONFIG_DIR={{CONFIG-DIR}} +.br +INST_DIR={{INST-DIR}} +.br +RUN_DIR={{RUN-DIR}} +.br +DS_ROOT={{DS-ROOT}} +.br +PRODUCT_NAME={{PRODUCT-NAME}} +.br + + +.SH AUTHOR +template-initconfig was written by the 389 Project. +.SH "REPORTING BUGS" +Report bugs to https://pagure.io/389-ds-base/new_issue +.SH COPYRIGHT +Copyright \(co 2018 Red Hat, Inc. + diff --git a/man/man8/dn2rdn.8 b/man/man8/dn2rdn.8 index 98d74da22..0814bfe7c 100644 --- a/man/man8/dn2rdn.8 +++ b/man/man8/dn2rdn.8 @@ -43,7 +43,6 @@ Display the version of the Directory Server. .br Display the usage. .SH EXAMPLE -dn2rdn dn2rdn \-Z instance3 \-f .SH DIAGNOSTICS @@ -55,4 +54,4 @@ dn2rdn was written by the 389 Project. .SH "REPORTING BUGS" Report bugs to https://pagure.io/389-ds-base/new_issue .SH COPYRIGHT -Copyright \(co 2017 Red Hat, Inc. +Copyright \(co 2018 Red Hat, Inc. diff --git a/man/man8/restoreconfig.8 b/man/man8/restoreconfig.8 index 97642b62d..452e018d7 100644 --- a/man/man8/restoreconfig.8 +++ b/man/man8/restoreconfig.8 @@ -33,8 +33,6 @@ one instance on the system, this option can be skipped. Display the usage. .SH EXAMPLE .TP -restoreconfig -.TP restoreconfig \-Z instance2 .SH DIAGNOSTICS Exit status is zero if no errors occur. Errors result in a @@ -45,4 +43,4 @@ restoreconfig was written by the 389 Project. .SH "REPORTING BUGS" Report bugs to https://pagure.io/389-ds-base/new_issue .SH COPYRIGHT -Copyright \(co 2017 Red Hat, Inc. +Copyright \(co 2018 Red Hat, Inc. diff --git a/man/man8/saveconfig.8 b/man/man8/saveconfig.8 index 15970435c..b4734808e 100644 --- a/man/man8/saveconfig.8 +++ b/man/man8/saveconfig.8 @@ -33,8 +33,6 @@ one instance on the system, this option can be skipped. Display the usage. .SH EXAMPLE .TP -saveconfig -.TP saveconfig \-Z instance3 .SH DIAGNOSTICS Exit status is zero if no errors occur. Errors result in a @@ -45,4 +43,4 @@ saveconfig was written by the 389 Project. .SH "REPORTING BUGS" Report bugs to https://pagure.io/389-ds-base/new_issue .SH COPYRIGHT -Copyright \(co 2017 Red Hat, Inc. +Copyright \(co 2018 Red Hat, Inc. diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in index a75ab78b7..9a5d0e3c7 100644 --- a/rpm/389-ds-base.spec.in +++ b/rpm/389-ds-base.spec.in @@ -61,7 +61,6 @@ Group: System Environment/Daemons BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Obsoletes: %{name}-selinux Conflicts: selinux-policy-base < 3.9.8 -# upgrade path from monolithic %{name} (including -libs & -devel) to %{name} + %{name}-snmp Obsoletes: %{name} <= 1.4.0.9 Provides: ldif2ldbm @@ -96,7 +95,6 @@ BuildRequires: net-snmp-devel BuildRequires: bzip2-devel BuildRequires: zlib-devel BuildRequires: openssl-devel -BuildRequires: tcp_wrappers # the following is for the pam passthru auth plug-in BuildRequires: pam-devel BuildRequires: systemd-units @@ -121,6 +119,13 @@ BuildRequires: libevent-devel BuildRequires: python%{python3_pkgversion} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-ldap +BuildRequires: python%{python3_pkgversion}-six +BuildRequires: python%{python3_pkgversion}-pyasn1 +BuildRequires: python%{python3_pkgversion}-pyasn1-modules +BuildRequires: python%{python3_pkgversion}-dateutil +BuildRequires: python%{python3_pkgversion}-argcomplete +BuildRequires: python%{python3_pkgversion}-argparse-manpage # For cockpit BuildRequires: rsync @@ -134,9 +139,9 @@ Requires: python%{python3_pkgversion}-lib389 = %{version}-%{release} %endif # this is needed for using semanage from our setup scripts -Requires: policycoreutils-python +Requires: policycoreutils-python-utils # This is needed for our future move to python selinux interaction. -Requires: libsemanage-python +Requires: libsemanage-python%{python3_pkgversion} # the following are needed for some of our scripts Requires: openldap-clients # this is needed to setup SSL if you are not using the @@ -263,7 +268,6 @@ Development Libraries and headers for the 389 Directory Server base package. Summary: SNMP Agent for 389 Directory Server Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} -# upgrade path from monolithic %{name} (including -libs & -devel) to %{name} + %{name}-snmp Obsoletes: %{name} <= 1.3.5.4 %description snmp @@ -281,7 +285,7 @@ Requires: openssl-perl Requires: iproute Requires: python%{python3_pkgversion} Requires: python%{python3_pkgversion}-pytest -Requires: python%{python3_pkgversion}-pyldap +Requires: python%{python3_pkgversion}-ldap Requires: python%{python3_pkgversion}-six Requires: python%{python3_pkgversion}-pyasn1 Requires: python%{python3_pkgversion}-pyasn1-modules @@ -387,6 +391,12 @@ make setup.py pushd ./src/lib389 %py3_build popd +# argparse-manpage dynamic man pages have hardcoded man v1 in header, +# need to change it to v8 +sed -i "1s/\"1\"/\"8\"/" %{_builddir}/%{name}-%{version}%{?prerel}/man/man8/dsconf.8 +sed -i "1s/\"1\"/\"8\"/" %{_builddir}/%{name}-%{version}%{?prerel}/man/man8/dsctl.8 +sed -i "1s/\"1\"/\"8\"/" %{_builddir}/%{name}-%{version}%{?prerel}/man/man8/dsidm.8 +sed -i "1s/\"1\"/\"8\"/" %{_builddir}/%{name}-%{version}%{?prerel}/man/man8/dscreate.8 # tests %py3_build @@ -468,6 +478,7 @@ else output=/dev/null output2=/dev/null fi + # reload to pick up any changes to systemd files /bin/systemctl daemon-reload >$output 2>&1 || : # reload to pick up any shared lib changes @@ -623,9 +634,13 @@ exit 0 %{_mandir}/man8/ns-slapd.8.gz %if 0%{?rhel} > 7 || 0%{?fedora} %{_sbindir}/dsconf +%{_mandir}/man8/dsconf.8.gz %{_sbindir}/dscreate +%{_mandir}/man8/dscreate.8.gz %{_sbindir}/dsctl +%{_mandir}/man8/dsctl.8.gz %{_sbindir}/dsidm +%{_mandir}/man8/dsidm.8.gz %endif %{_libexecdir}/%{pkgname}/ds_selinux_enabled %{_libexecdir}/%{pkgname}/ds_selinux_port_query @@ -654,10 +669,17 @@ exit 0 %{_mandir}/man8/upgradedb.8.gz %{_sbindir}/vlvindex %{_mandir}/man8/vlvindex.8.gz +%{_mandir}/man5/99user.ldif.5.gz +%{_mandir}/man5/certmap.conf.5.gz +%{_mandir}/man5/template-initconfig.5.gz +%{_mandir}/man5/slapd-collations.conf.5.gz +%{_mandir}/man5/dirsrv.5.gz +%{_mandir}/man5/dirsrv.systemd.5.gz + %{_libdir}/%{pkgname}/python %dir %{_libdir}/%{pkgname}/plugins %{_libdir}/%{pkgname}/plugins/*.so -# THis has to be hardcoded to /lib - $libdir changes between lib/lib64, but +# This has to be hardcoded to /lib - $libdir changes between lib/lib64, but # sysctl.d is always in /lib. %{_prefix}/lib/sysctl.d/* %dir %{_localstatedir}/lib/%{pkgname} @@ -743,9 +765,11 @@ exit 0 %{_bindir}/repl-monitor %{_mandir}/man1/repl-monitor.1.gz %{_bindir}/repl-monitor.pl +%{_mandir}/man1/repl-monitor.pl.1.gz %{_bindir}/cl-dump %{_mandir}/man1/cl-dump.1.gz %{_bindir}/cl-dump.pl +%{_mandir}/man1/cl-dump.pl.1.gz %{_bindir}/dbgen.pl %{_mandir}/man8/bak2db.pl.8.gz %{_sbindir}/bak2db.pl diff --git a/src/lib389/cli/dsconf b/src/lib389/cli/dsconf index 2748e31cf..2dd7fa888 100755 --- a/src/lib389/cli/dsconf +++ b/src/lib389/cli/dsconf @@ -39,56 +39,52 @@ from lib389.cli_base.dsrc import dsrc_to_ldap, dsrc_arg_concat from lib389.cli_base import reset_get_logger +parser = argparse.ArgumentParser(allow_abbrev=True) +parser.add_argument('instance', + help="The instance name OR the LDAP url to connect to, IE localhost, ldap://mai.example.com:389", + ) +parser.add_argument('-v', '--verbose', + help="Display verbose operation tracing during command execution", + action='store_true', default=False + ) +parser.add_argument('-D', '--binddn', + help="The account to bind as for executing operations", + default=None + ) +parser.add_argument('-b', '--basedn', + help="Basedn (root naming context) of the instance to manage", + default=None + ) +parser.add_argument('-Z', '--starttls', + help="Connect with StartTLS", + default=False, action='store_true' + ) +parser.add_argument('-j', '--json', + help="Return result in JSON object", + default=False, action='store_true' + ) + +subparsers = parser.add_subparsers(help="resources to act upon") + +cli_config.create_parser(subparsers) +cli_backend.create_parser(subparsers) +cli_directory_manager.create_parsers(subparsers) +cli_schema.create_parser(subparsers) +cli_health.create_parser(subparsers) +cli_plugin.create_parser(subparsers) +cli_memberof.create_parser(subparsers) +cli_usn.create_parser(subparsers) +cli_rootdn_ac.create_parser(subparsers) +cli_whoami.create_parser(subparsers) +cli_referint.create_parser(subparsers) +cli_automember.create_parser(subparsers) +argcomplete.autocomplete(parser) + + if __name__ == '__main__': defbase = ldap.get_option(ldap.OPT_DEFBASE) - - parser = argparse.ArgumentParser(allow_abbrev=True) - # Build the base ldap options, this keeps in unified. - - # Can we get default options for these from .rc file? - - parser.add_argument('instance', - help="The instance name OR the LDAP url to connect to, IE localhost, ldap://mai.example.com:389", - ) - parser.add_argument('-v', '--verbose', - help="Display verbose operation tracing during command execution", - action='store_true', default=False - ) - parser.add_argument('-D', '--binddn', - help="The account to bind as for executing operations", - default=None - ) - parser.add_argument('-b', '--basedn', - help="Basedn (root naming context) of the instance to manage", - default=None - ) - parser.add_argument('-Z', '--starttls', - help="Connect with StartTLS", - default=False, action='store_true' - ) - parser.add_argument('-j', '--json', - help="Return result in JSON object", - default=False, action='store_true' - ) - - subparsers = parser.add_subparsers(help="resources to act upon") - - cli_config.create_parser(subparsers) - cli_backend.create_parser(subparsers) - cli_directory_manager.create_parsers(subparsers) - cli_schema.create_parser(subparsers) - cli_health.create_parser(subparsers) - cli_plugin.create_parser(subparsers) - cli_memberof.create_parser(subparsers) - cli_usn.create_parser(subparsers) - cli_rootdn_ac.create_parser(subparsers) - cli_whoami.create_parser(subparsers) - cli_referint.create_parser(subparsers) - cli_automember.create_parser(subparsers) - argcomplete.autocomplete(parser) args = parser.parse_args() - log = reset_get_logger('dsconf', args.verbose) log.debug("The 389 Directory Server Configuration Tool") diff --git a/src/lib389/cli/dscreate b/src/lib389/cli/dscreate index 1535cc565..3591dba81 100755 --- a/src/lib389/cli/dscreate +++ b/src/lib389/cli/dscreate @@ -18,35 +18,31 @@ from lib389 import DirSrv from lib389.cli_ctl import instance as cli_instance from lib389.cli_base import reset_get_logger -if __name__ == '__main__': - - parser = argparse.ArgumentParser() - - parser.add_argument('-v', '--verbose', - help="Display verbose operation tracing during command execution", - action='store_true', default=False, dest='verbose' - ) - - subparsers = parser.add_subparsers(help="action") - - install_parser = subparsers.add_parser('install', help="Create an instance of Directory Server from an inf answer file") - install_parser.add_argument('file', help="Inf file to use with prepared answers. You can generate an example of this with 'dscreate create-template'") - install_parser.add_argument('-n', '--dryrun', help="Validate system and configurations only. Do not alter the system.", - action='store_true', default=False) - install_parser.add_argument('--IsolemnlyswearthatIamuptonogood', dest="ack", - help="""You are here likely here by mistake! You want setup-ds.pl! +parser = argparse.ArgumentParser() +parser.add_argument('-v', '--verbose', + help="Display verbose operation tracing during command execution", + action='store_true', default=False, dest='verbose' + ) +subparsers = parser.add_subparsers(help="action") +install_parser = subparsers.add_parser('install', help="Create an instance of Directory Server from an inf answer file") +install_parser.add_argument('file', help="Inf file to use with prepared answers. You can generate an example of this with 'dscreate create-template'") +install_parser.add_argument('-n', '--dryrun', help="Validate system and configurations only. Do not alter the system.", + action='store_true', default=False) +install_parser.add_argument('--IsolemnlyswearthatIamuptonogood', dest="ack", + help="""You are here likely here by mistake! You want setup-ds.pl! By setting this value you acknowledge and take responsibility for the fact this command is UNTESTED and NOT READY. You are ON YOUR OWN! """, - action='store_true', default=False) - install_parser.add_argument('-c', '--containerised', help="Indicate to the installer that this is running in a container. Used to disable systemd native components, even if they are installed.", - action='store_true', default=False) - install_parser.set_defaults(func=cli_instance.instance_create) + action='store_true', default=False) +install_parser.add_argument('-c', '--containerised', help="Indicate to the installer that this is running in a container. Used to disable systemd native components, even if they are installed.", + action='store_true', default=False) +install_parser.set_defaults(func=cli_instance.instance_create) +template_parser = subparsers.add_parser('create-template', help="Display an example inf answer file, or provide a file name to write it to disk.") +template_parser.add_argument('template_file', nargs="?", default=None, help="Write example template to this file") +template_parser.set_defaults(func=cli_instance.instance_example) +argcomplete.autocomplete(parser) - template_parser = subparsers.add_parser('create-template', help="Display an example inf answer file, or provide a file name to write it to disk.") - template_parser.add_argument('template_file', nargs="?", default=None, help="Write example template to this file") - template_parser.set_defaults(func=cli_instance.instance_example) - argcomplete.autocomplete(parser) +if __name__ == '__main__': args = parser.parse_args() log = reset_get_logger("dscreate", args.verbose) diff --git a/src/lib389/cli/dsctl b/src/lib389/cli/dsctl index f9853d969..a22a69c32 100755 --- a/src/lib389/cli/dsctl +++ b/src/lib389/cli/dsctl @@ -23,31 +23,26 @@ from lib389.cli_ctl import instance as cli_instance from lib389.cli_ctl import dbtasks as cli_dbtasks from lib389.cli_base import disconnect_instance, reset_get_logger -if __name__ == '__main__': - - parser = argparse.ArgumentParser() - - parser.add_argument('-v', '--verbose', - help="Display verbose operation tracing during command execution", - action='store_true', default=False - ) - parser.add_argument('instance', - help="The name of the instance to act upon", - ) - parser.add_argument('-j', '--json', - help="Return result in JSON object", - default=False, action='store_true' - ) - subparsers = parser.add_subparsers(help="action") - argcomplete.autocomplete(parser) +parser = argparse.ArgumentParser() +parser.add_argument('-v', '--verbose', + help="Display verbose operation tracing during command execution", + action='store_true', default=False + ) +parser.add_argument('instance', + help="The name of the instance to act upon", + ) +parser.add_argument('-j', '--json', + help="Return result in JSON object", + default=False, action='store_true' + ) +subparsers = parser.add_subparsers(help="action") +argcomplete.autocomplete(parser) +# We stack our needed options in via submodules. +cli_instance.create_parser(subparsers) +cli_dbtasks.create_parser(subparsers) - # We stack our needed options in via submodules. - - cli_instance.create_parser(subparsers) - cli_dbtasks.create_parser(subparsers) - - # Then we tell it to execute. +if __name__ == '__main__': args = parser.parse_args() log = reset_get_logger('dsctl', args.verbose) diff --git a/src/lib389/cli/dsidm b/src/lib389/cli/dsidm index faba91bbb..4ef1141b8 100755 --- a/src/lib389/cli/dsidm +++ b/src/lib389/cli/dsidm @@ -30,48 +30,47 @@ from lib389.cli_base import connect_instance, disconnect_instance, reset_get_log from lib389.cli_base.dsrc import dsrc_to_ldap, dsrc_arg_concat +parser = argparse.ArgumentParser(allow_abbrev=True) +# First, add the LDAP options +parser.add_argument('instance', + help="The instance name OR the LDAP url to connect to, IE localhost, ldap://mai.example.com:389", + ) +parser.add_argument('-b', '--basedn', + help="Basedn (root naming context) of the instance to manage", + default=None + ) +parser.add_argument('-v', '--verbose', + help="Display verbose operation tracing during command execution", + action='store_true', default=False + ) +parser.add_argument('-D', '--binddn', + help="The account to bind as for executing operations", + default=None + ) +parser.add_argument('-Z', '--starttls', + help="Connect with StartTLS", + default=False, action='store_true' + ) +parser.add_argument('-j', '--json', + help="Return result in JSON object", + default=False, action='store_true' + ) +subparsers = parser.add_subparsers(help="resources to act upon") +# Call all the other cli modules to register their bits +cli_account.create_parser(subparsers) +cli_group.create_parser(subparsers) +cli_init.create_parser(subparsers) +cli_ou.create_parser(subparsers) +cli_posixgroup.create_parser(subparsers) +cli_user.create_parser(subparsers) +argcomplete.autocomplete(parser) + + if __name__ == '__main__': defbase = ldap.get_option(ldap.OPT_DEFBASE) - parser = argparse.ArgumentParser(allow_abbrev=True) - # First, add the LDAP options - - parser.add_argument('instance', - help="The instance name OR the LDAP url to connect to, IE localhost, ldap://mai.example.com:389", - ) - parser.add_argument('-b', '--basedn', - help="Basedn (root naming context) of the instance to manage", - default=None - ) - parser.add_argument('-v', '--verbose', - help="Display verbose operation tracing during command execution", - action='store_true', default=False - ) - parser.add_argument('-D', '--binddn', - help="The account to bind as for executing operations", - default=None - ) - parser.add_argument('-Z', '--starttls', - help="Connect with StartTLS", - default=False, action='store_true' - ) - parser.add_argument('-j', '--json', - help="Return result in JSON object", - default=False, action='store_true' - ) - - subparsers = parser.add_subparsers(help="resources to act upon") - - # Call all the other cli modules to register their bits - - cli_account.create_parser(subparsers) - cli_group.create_parser(subparsers) - cli_init.create_parser(subparsers) - cli_ou.create_parser(subparsers) - cli_posixgroup.create_parser(subparsers) - cli_user.create_parser(subparsers) - argcomplete.autocomplete(parser) + args = parser.parse_args() diff --git a/src/lib389/python-lib389.spec b/src/lib389/python-lib389.spec index 88901c9c3..677798d81 100644 --- a/src/lib389/python-lib389.spec +++ b/src/lib389/python-lib389.spec @@ -12,7 +12,7 @@ Source0: http://www.port389.org/binaries/%{name}-%{tarver}.tar.bz2 License: GPLv3+ Group: Development/Libraries BuildArch: noarch -Url: http://port389.org/docs/389ds/FAQ/upstream-test-framework.html +Url: http://www.port389.org/ %if 0%{?rhel} >= 8 || 0%{?fedora} BuildRequires: python2-devel BuildRequires: python2-setuptools @@ -23,7 +23,7 @@ BuildRequires: python-devel BuildRequires: python-setuptools %endif %description -This module contains tools and libraries for accessing, testing, +This module contains tools and libraries for accessing, testing, and configuring the 389 Directory Server. @@ -53,10 +53,10 @@ Requires: python-dateutil %endif %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} -This module contains tools and libraries for accessing, testing, +This module contains tools and libraries for accessing, testing, and configuring the 389 Directory Server. -# Can't build on EL7! Python3 tooling is too broken :( +# Can't build on EL7! Python3 tooling is too broken :( # We have to use >= 8, because <= 7 doesn't work .... %if 0%{?rhel} >= 8 || 0%{?fedora} %package -n python%{python3_pkgversion}-%{srcname} @@ -74,7 +74,7 @@ Requires: python%{python3_pkgversion}-pyasn1-modules Requires: python%{python3_pkgversion}-dateutil %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} %description -n python%{python3_pkgversion}-%{srcname} -This module contains tools and libraries for accessing, testing, +This module contains tools and libraries for accessing, testing, and configuring the 389 Directory Server. %endif @@ -230,7 +230,7 @@ and configuring the 389 Directory Server. * Mon Dec 7 2015 Mark Reynolds <[email protected]> - 1.0.1-1 - Removed downloaded dependencies, and added python_provide macro - Fixed Source0 URL in spec file - + * Fri Dec 4 2015 Mark Reynolds <[email protected]> - 1.0.1-1 - Renamed package to python-lib389, and simplified the spec file diff --git a/src/lib389/requirements.txt b/src/lib389/requirements.txt index 9a962161d..842bdc40d 100644 --- a/src/lib389/requirements.txt +++ b/src/lib389/requirements.txt @@ -3,6 +3,6 @@ pyasn1-modules pytest python-dateutil six -enum34;python_version=="2.7" -python-ldap;python_version=="2.7" -pyldap;python_version>="3.4" +argcomplete +argparse-manpage +python3-ldap diff --git a/src/lib389/setup.cfg b/src/lib389/setup.cfg new file mode 100644 index 000000000..a4474612a --- /dev/null +++ b/src/lib389/setup.cfg @@ -0,0 +1,7 @@ +[build_manpages] +manpages = + ../../man/man8/dsconf.8:object=parser:pyfile=cli/dsconf + ../../man/man8/dsctl.8:object=parser:pyfile=cli/dsctl + ../../man/man8/dsidm.8:object=parser:pyfile=cli/dsidm + ../../man/man8/dscreate.8:object=parser:pyfile=cli/dscreate + diff --git a/src/lib389/setup.py b/src/lib389/setup.py index 0765f6297..a14e80697 100644 --- a/src/lib389/setup.py +++ b/src/lib389/setup.py @@ -1,7 +1,7 @@ -#!/usr/bin/env python +#!/usr/bin/python3 # --- BEGIN COPYRIGHT BLOCK --- -# Copyright (C) 2015 Red Hat, Inc. +# Copyright (C) 2018 Red Hat, Inc. # All rights reserved. # # License: GPL (version 3 or any later version). @@ -14,6 +14,9 @@ from setuptools import setup, find_packages from os import path +from build_manpages import build_manpages +from setuptools.command.build_py import build_py +from setuptools.command.install import install here = path.abspath(path.dirname(__file__)) @@ -33,7 +36,7 @@ setup( description='A library for accessing and configuring the 389 Directory ' + 'Server', long_description=long_description, - url='http://port389.org/wiki/Upstream_test_framework', + url='http://www.port389.org/docs/389ds/FAQ/upstream-test-framework.html', author='Red Hat Inc.', author_email='[email protected]', @@ -58,7 +61,6 @@ setup( # find lib389/clitools -name ds\* -exec echo \''{}'\', \; data_files=[ ('/usr/sbin/', [ - # 'lib389/clitools/ds_setup', 'cli/dsctl', 'cli/dsconf', 'cli/dscreate', @@ -72,8 +74,15 @@ setup( 'pytest', 'python-dateutil', 'six', - 'enum34;python_version=="2.7"', - 'python-ldap;python_version=="2.7"', - 'pyldap;python_version>="3.4"', + 'argcomplete', + 'argparse-manpage', + 'python3-ldap', ], + + cmdclass={ + # Dynamically build man pages for cli tools + 'build_manpages': build_manpages.build_manpages, + 'build_py': build_manpages.get_build_py_cmd(build_py), + } + )
0
6c17ec56076d34540929acbcf2f3e65534060a43
389ds/389-ds-base
Ticket #387 - managed entry sometimes doesn't delete the managed entry https://fedorahosted.org/389/ticket/387 Resolves: Ticket #387 Bug Description: managed entry sometimes doesn't delete the managed entry Reviewed by: nhosoi (Thanks!) Branch: master Fix Description: A modify just replaces the old entry in the cache with the new entry, and the modify code only does the cache_replace if the database operations succeed, so we don't have to do any cache cleanup in the txn retry loop. Also cleanup some other cache usage. If there is an error and ec is in the cache, we still have to remove it and restore the original e entry. Platforms tested: RHEL6 x86_64, Fedora 17 Flag Day: no Doc impact: no
commit 6c17ec56076d34540929acbcf2f3e65534060a43 Author: Rich Megginson <[email protected]> Date: Mon Jun 18 12:21:50 2012 -0600 Ticket #387 - managed entry sometimes doesn't delete the managed entry https://fedorahosted.org/389/ticket/387 Resolves: Ticket #387 Bug Description: managed entry sometimes doesn't delete the managed entry Reviewed by: nhosoi (Thanks!) Branch: master Fix Description: A modify just replaces the old entry in the cache with the new entry, and the modify code only does the cache_replace if the database operations succeed, so we don't have to do any cache cleanup in the txn retry loop. Also cleanup some other cache usage. If there is an error and ec is in the cache, we still have to remove it and restore the original e entry. Platforms tested: RHEL6 x86_64, Fedora 17 Flag Day: no Doc impact: no diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modify.c b/ldap/servers/slapd/back-ldbm/ldbm_modify.c index 8bd75b2a4..6d2e6f69e 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_modify.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_modify.c @@ -187,6 +187,122 @@ error: return retval; } +/** + Apply the mods to the ec entry. Check for syntax, schema problems. + Check for abandon. + + Return code: + -1 - error - result code and message are set appropriately + 0 - successfully applied and checked + 1 - not an error - no mods to apply or op abandoned + */ +static int +modify_apply_check_expand( + Slapi_PBlock *pb, + Slapi_Operation *operation, + LDAPMod **mods, /* list of mods to apply */ + struct backentry *e, /* original "before" entry */ + struct backentry *ec, /* "after" entry with mods applied */ + Slapi_Entry **postentry, + int *ldap_result_code, + char **ldap_result_message +) +{ + int rc = 0; + int i; + int repl_op; + int change_entry = 0; + Slapi_Mods smods = {0}; + CSN *csn = operation_get_csn(operation); + + slapi_pblock_get (pb, SLAPI_IS_REPLICATED_OPERATION, &repl_op); + slapi_mods_init_byref( &smods, mods ); + + if ( (change_entry = mods_have_effect (ec->ep_entry, &smods)) ) { + *ldap_result_code = entry_apply_mods_wsi(ec->ep_entry, &smods, csn, + operation_is_flag_set(operation, OP_FLAG_REPLICATED)); + /* + * XXXmcs: it would be nice to get back an error message from + * the above call so we could pass it along to the client, e.g., + * "duplicate value for attribute givenName." + */ + } else { + Slapi_Entry *epostop = NULL; + /* If the entry was not actually changed, we still need to + * set the SLAPI_ENTRY_POST_OP field in the pblock (post-op + * plugins expect that field to be present for all modify + * operations that return LDAP_SUCCESS). + */ + slapi_pblock_get ( pb, SLAPI_ENTRY_POST_OP, &epostop ); + slapi_entry_free ( epostop ); /* free existing one, if any */ + slapi_pblock_set ( pb, SLAPI_ENTRY_POST_OP, slapi_entry_dup( e->ep_entry ) ); + *postentry = NULL; /* to avoid free in main error cleanup code */ + } + if ( !change_entry || *ldap_result_code != 0 ) { + /* change_entry == 0 is not an error just a no-op */ + rc = change_entry ? -1 : 1; + goto done; + } + + /* + * If the objectClass attribute type was modified in any way, expand + * the objectClass values to reflect the inheritance hierarchy. + */ + for ( i = 0; mods[i] != NULL && !repl_op; ++i ) { + if ( 0 == strcasecmp( SLAPI_ATTR_OBJECTCLASS, mods[i]->mod_type )) { + slapi_schema_expand_objectclasses( ec->ep_entry ); + break; + } + } + + /* + * We are about to pass the last abandon test, so from now on we are + * committed to finish this operation. Set status to "will complete" + * before we make our last abandon check to avoid race conditions in + * the code that processes abandon operations. + */ + operation->o_status = SLAPI_OP_STATUS_WILL_COMPLETE; + if ( slapi_op_abandoned( pb ) ) { + rc = 1; + goto done; + } + + /* if this is a replicated op, we don't need to perform these checks */ + if(!repl_op){ + /* check that the entry still obeys the schema */ + if ((operation_is_flag_set(operation,OP_FLAG_ACTION_SCHEMA_CHECK)) && + slapi_entry_schema_check( pb, ec->ep_entry ) != 0 ) { + *ldap_result_code = LDAP_OBJECT_CLASS_VIOLATION; + slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, ldap_result_message); + rc = -1; + goto done; + } + + /* check attribute syntax for the new values */ + if (slapi_mods_syntax_check(pb, mods, 0) != 0) { + *ldap_result_code = LDAP_INVALID_SYNTAX; + slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, ldap_result_message); + rc = -1; + goto done; + } + + /* + * make sure the entry contains all values in the RDN. + * if not, the modification must have removed them. + */ + if ( ! slapi_entry_rdn_values_present( ec->ep_entry ) ) { + *ldap_result_code= LDAP_NOT_ALLOWED_ON_RDN; + rc = -1; + goto done; + } + } + +done: + slapi_mods_done( &smods ); + + return rc; +} + int ldbm_back_modify( Slapi_PBlock *pb ) { @@ -213,14 +329,13 @@ ldbm_back_modify( Slapi_PBlock *pb ) Slapi_Operation *operation; int dblock_acquired= 0; entry_address *addr; - int change_entry = 0; int ec_in_cache = 0; int is_fixup_operation= 0; int is_ruv = 0; /* True if the current entry is RUV */ CSN *opcsn = NULL; int repl_op; - int i = 0; int opreturn = 0; + int mod_count = 0; slapi_pblock_get( pb, SLAPI_BACKEND, &be); slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li ); @@ -342,82 +457,14 @@ ldbm_back_modify( Slapi_PBlock *pb ) /* The Plugin may have messed about with some of the PBlock parameters... ie. mods */ slapi_pblock_get( pb, SLAPI_MODIFY_MODS, &mods ); slapi_mods_init_byref(&smods,mods); + mod_count = slapi_mods_get_num_mods(&smods); - { - CSN *csn = operation_get_csn(operation); - if ( (change_entry = mods_have_effect (ec->ep_entry, &smods)) ) { - ldap_result_code = entry_apply_mods_wsi(ec->ep_entry, &smods, csn, operation_is_flag_set(operation,OP_FLAG_REPLICATED)); - /* - * XXXmcs: it would be nice to get back an error message from - * the above call so we could pass it along to the client, e.g., - * "duplicate value for attribute givenName." - */ - } else { - /* If the entry was not actually changed, we still need to - * set the SLAPI_ENTRY_POST_OP field in the pblock (post-op - * plugins expect that field to be present for all modify - * operations that return LDAP_SUCCESS). - */ - postentry = slapi_entry_dup( e->ep_entry ); - slapi_pblock_set ( pb, SLAPI_ENTRY_POST_OP, postentry ); - postentry = NULL; /* avoid removal/free in error_return code */ - } - if ( !change_entry || ldap_result_code != 0 ) { - /* change_entry == 0 is not an error, but we need to free lock etc */ - goto error_return; - } - } - - /* - * If the objectClass attribute type was modified in any way, expand - * the objectClass values to reflect the inheritance hierarchy. - */ - for ( i = 0; mods[i] != NULL && !repl_op; ++i ) { - if ( 0 == strcasecmp( SLAPI_ATTR_OBJECTCLASS, mods[i]->mod_type )) { - slapi_schema_expand_objectclasses( ec->ep_entry ); - break; - } - } - - /* - * We are about to pass the last abandon test, so from now on we are - * committed to finish this operation. Set status to "will complete" - * before we make our last abandon check to avoid race conditions in - * the code that processes abandon operations. - */ - operation->o_status = SLAPI_OP_STATUS_WILL_COMPLETE; - if ( slapi_op_abandoned( pb ) ) { + /* apply the mods, check for syntax, schema problems, etc. */ + if (modify_apply_check_expand(pb, operation, mods, e, ec, &postentry, + &ldap_result_code, &ldap_result_message)) { goto error_return; } - /* if this is a replicated op, we don't need to perform these checks */ - if(!repl_op){ - /* check that the entry still obeys the schema */ - if ((operation_is_flag_set(operation,OP_FLAG_ACTION_SCHEMA_CHECK)) && - slapi_entry_schema_check( pb, ec->ep_entry ) != 0 ) { - ldap_result_code= LDAP_OBJECT_CLASS_VIOLATION; - slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &ldap_result_message); - goto error_return; - } - - /* check attribute syntax for the new values */ - if (slapi_mods_syntax_check(pb, mods, 0) != 0) - { - ldap_result_code = LDAP_INVALID_SYNTAX; - slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &ldap_result_message); - goto error_return; - } - - /* - * make sure the entry contains all values in the RDN. - * if not, the modification must have removed them. - */ - if ( ! slapi_entry_rdn_values_present( ec->ep_entry ) ) { - ldap_result_code= LDAP_NOT_ALLOWED_ON_RDN; - goto error_return; - } - } - if (!is_ruv && !is_fixup_operation) { ruv_c_init = ldbm_txn_ruv_modify_context( pb, &ruv_c ); if (-1 == ruv_c_init) { @@ -437,7 +484,7 @@ ldbm_back_modify( Slapi_PBlock *pb ) * their original state; */ mods_original = copy_mods(mods); - if ( (original_entry = backentry_dup( e )) == NULL ) { + if ( (original_entry = backentry_dup( ec )) == NULL ) { ldap_result_code= LDAP_OPERATIONS_ERROR; goto error_return; } @@ -445,6 +492,7 @@ ldbm_back_modify( Slapi_PBlock *pb ) txn.back_txn_txn = NULL; /* ready to create the child transaction */ for (retry_count = 0; retry_count < RETRY_TIMES; retry_count++) { int cache_rc = 0; + int new_mod_count = 0; if (txn.back_txn_txn && (txn.back_txn_txn != parent_txn)) { dblayer_txn_abort(li,&txn); slapi_pblock_set(pb, SLAPI_TXN, parent_txn); @@ -453,6 +501,7 @@ ldbm_back_modify( Slapi_PBlock *pb ) * We need to grab the current mods, free them, and restore the * originals. Same thing for the entry. */ + slapi_pblock_get(pb, SLAPI_MODIFY_MODS, &mods); ldap_mods_free(mods, 1); slapi_pblock_set(pb, SLAPI_MODIFY_MODS, copy_mods(mods_original)); @@ -461,10 +510,11 @@ ldbm_back_modify( Slapi_PBlock *pb ) backentry_free(&ec); slapi_pblock_set( pb, SLAPI_MODIFY_EXISTING_ENTRY, original_entry->ep_entry ); ec = original_entry; - if ( (original_entry = backentry_dup( e )) == NULL ) { + if ( (original_entry = backentry_dup( ec )) == NULL ) { ldap_result_code= LDAP_OPERATIONS_ERROR; goto error_return; } + LDAPDebug0Args(LDAP_DEBUG_BACKLDBM, "Modify Retrying Transaction\n"); #ifndef LDBM_NO_BACKOFF_DELAY @@ -503,6 +553,25 @@ ldbm_back_modify( Slapi_PBlock *pb ) /* the mods might have been changed, so get the latest */ slapi_pblock_get( pb, SLAPI_MODIFY_MODS, &mods ); + /* make sure the betxnpreop did not alter any of the mods that + had already previously been applied */ + slapi_mods_done(&smods); + slapi_mods_init_byref(&smods,mods); + new_mod_count = slapi_mods_get_num_mods(&smods); + if (new_mod_count < mod_count) { + LDAPDebug2Args( LDAP_DEBUG_ANY, "Error: BE_TXN_PRE_MODIFY plugin has removed " + "mods from the original list - mod count was [%d] now [%d] " + "mods will not be applied - mods list changes must be done " + "in the BE_PRE_MODIFY plugin, not the BE_TXN_PRE_MODIFY\n", + mod_count, new_mod_count ); + } else if (new_mod_count > mod_count) { /* apply the new betxnpremod mods */ + /* apply the mods, check for syntax, schema problems, etc. */ + if (modify_apply_check_expand(pb, operation, &mods[mod_count], e, ec, &postentry, + &ldap_result_code, &ldap_result_message)) { + goto error_return; + } + } /* else if new_mod_count == mod_count then betxnpremod plugin did nothing */ + /* * Update the ID to Entry index. * Note that id2entry_add replaces the entry, so the Entry ID
0
70425fbcea96d1b477fea27eca67fb7e828c446e
389ds/389-ds-base
Resolves: #437525 Summary: GER: allow GER for non-existing entries Description: [slapd/charray.c] new: charray_merge_nodup -- merge 2 string arrays skipping the duplicates modified: charray_remove -- introduced "freeit" flag. If true, the removed string is freed. (The API is used only in chainingdb. The change is applied to the plugin.) [slapd/opshared.c] modified: check OP_FLAG_GET_EFFECTIVE_RIGHTS in the iterate to support "@<objectclass>". It's needed to do at the location since we have to call acl plugin even when no entries are returned from the search. If no entries are returned and "@<objectclass>" is found in the attribute list, acl effective rights code generates the corresponding template entry. [slapd/pblock.c] place to store gerattrs is added (SLAPI_SEARCH_GERATTRS), where gerattrs is an array of strings which store "...@<objectclass>". [slapd/result.c] moved OP_FLAG_GET_EFFECTIVE_RIGHTS checking to iterate (opshared.c) [slapd/schema.c] new: slapi_schema_list_objectclass_attributes -- return the required and/or allowed attributes belonging to the given objectclass. This is used to support "*" and "+" in the get effective rights. new: slapi_schema_get_superior_name -- return the superior objectclass name of the given objectclass. [slapd/search.c] if "<attr>@<objectclass>" is found in the attribute list, cut the <attr> part out and added to the attrs array (pblock SLAPI_SEARCH_ATTRS) and store the original string to the gerattrs (pblock SLAPI_SEARCH_GERATTRS). [plugin/acl/acleffectiverights.c] modified: _ger_g_permission_granted -- if the requester and the subject user are identical, give "g" permission modified: _ger_parse_control -- replaced strcpy with memmove since strcpy does not guarantee the result of the overlap copy. modified: _ger_get_attrs_rights -- support "*" (all attributes belonging to the object) and "+" (operational attributes). If repeated attributes are found in the given attribute list, they are reduced to one. new: _ger_generate_template_entry -- generate a template entry if "@<objectclass>" is passed. [pluginc/cb/*] adjusted to the updated charray_remove. Please see also this wiki page for the overview and test cases. http://directory.fedoraproject.org/wiki/Get_Effective_Rights_for_non-present_attributes
commit 70425fbcea96d1b477fea27eca67fb7e828c446e Author: Noriko Hosoi <[email protected]> Date: Fri Jun 27 19:28:22 2008 +0000 Resolves: #437525 Summary: GER: allow GER for non-existing entries Description: [slapd/charray.c] new: charray_merge_nodup -- merge 2 string arrays skipping the duplicates modified: charray_remove -- introduced "freeit" flag. If true, the removed string is freed. (The API is used only in chainingdb. The change is applied to the plugin.) [slapd/opshared.c] modified: check OP_FLAG_GET_EFFECTIVE_RIGHTS in the iterate to support "@<objectclass>". It's needed to do at the location since we have to call acl plugin even when no entries are returned from the search. If no entries are returned and "@<objectclass>" is found in the attribute list, acl effective rights code generates the corresponding template entry. [slapd/pblock.c] place to store gerattrs is added (SLAPI_SEARCH_GERATTRS), where gerattrs is an array of strings which store "...@<objectclass>". [slapd/result.c] moved OP_FLAG_GET_EFFECTIVE_RIGHTS checking to iterate (opshared.c) [slapd/schema.c] new: slapi_schema_list_objectclass_attributes -- return the required and/or allowed attributes belonging to the given objectclass. This is used to support "*" and "+" in the get effective rights. new: slapi_schema_get_superior_name -- return the superior objectclass name of the given objectclass. [slapd/search.c] if "<attr>@<objectclass>" is found in the attribute list, cut the <attr> part out and added to the attrs array (pblock SLAPI_SEARCH_ATTRS) and store the original string to the gerattrs (pblock SLAPI_SEARCH_GERATTRS). [plugin/acl/acleffectiverights.c] modified: _ger_g_permission_granted -- if the requester and the subject user are identical, give "g" permission modified: _ger_parse_control -- replaced strcpy with memmove since strcpy does not guarantee the result of the overlap copy. modified: _ger_get_attrs_rights -- support "*" (all attributes belonging to the object) and "+" (operational attributes). If repeated attributes are found in the given attribute list, they are reduced to one. new: _ger_generate_template_entry -- generate a template entry if "@<objectclass>" is passed. [pluginc/cb/*] adjusted to the updated charray_remove. Please see also this wiki page for the overview and test cases. http://directory.fedoraproject.org/wiki/Get_Effective_Rights_for_non-present_attributes diff --git a/ldap/servers/plugins/acl/acleffectiverights.c b/ldap/servers/plugins/acl/acleffectiverights.c index c40840a58..c50807f95 100644 --- a/ldap/servers/plugins/acl/acleffectiverights.c +++ b/ldap/servers/plugins/acl/acleffectiverights.c @@ -46,7 +46,13 @@ /* news2 is optional, provided as a convenience */ /* capacity is the capacity of the gerstr, size is the current length */ static void -_append_gerstr(char **gerstr, size_t *capacity, size_t *size, const char *news, const char *news2) +_append_gerstr( + char **gerstr, + size_t *capacity, + size_t *size, + const char *news, + const char *news2 + ) { size_t len; size_t increment = 128; @@ -90,7 +96,12 @@ _append_gerstr(char **gerstr, size_t *capacity, size_t *size, const char *news, } static int -_ger_g_permission_granted ( Slapi_PBlock *pb, Slapi_Entry *e, char **errbuf ) +_ger_g_permission_granted ( + Slapi_PBlock *pb, + Slapi_Entry *e, + const char *subjectdn, + char **errbuf + ) { char *proxydn = NULL; Slapi_DN *requestor_sdn, *entry_sdn; @@ -151,6 +162,14 @@ _ger_g_permission_granted ( Slapi_PBlock *pb, Slapi_Entry *e, char **errbuf ) goto bailout; } + /* if the requestor and the subject user are identical, let's grant it */ + if ( strcasecmp ( slapi_sdn_get_ndn(requestor_sdn), subjectdn ) == 0) + { + /* Requestor should see his own permission rights on any entry */ + rc = LDAP_SUCCESS; + goto bailout; + } + aclutil_str_appened ( errbuf, "get-effective-rights: requestor has no g permission on the entry" ); slapi_log_error (SLAPI_LOG_ACL, plugin_name, "_ger_g_permission_granted: %s\n", *errbuf); @@ -166,11 +185,17 @@ bailout: } static int -_ger_parse_control ( Slapi_PBlock *pb, char **subjectndn, int *iscritical, char **errbuf ) +_ger_parse_control ( + Slapi_PBlock *pb, + char **subjectndn, + int *iscritical, + char **errbuf + ) { LDAPControl **requestcontrols; struct berval *subjectber; BerElement *ber; + int subjectndnlen = 0; if (NULL == subjectndn) { @@ -231,7 +256,8 @@ _ger_parse_control ( Slapi_PBlock *pb, char **subjectndn, int *iscritical, char * (see section 9 of RFC 2829) only. It also only supports the "dnAuthzId" * flavor, which looks like "dn:<DN>" where null <DN> is for anonymous. */ - if ( NULL == *subjectndn || strlen (*subjectndn) < 3 || + subjectndnlen = strlen(*subjectndn); + if ( NULL == *subjectndn || subjectndnlen < 3 || strncasecmp ( "dn:", *subjectndn, 3 ) != 0 ) { aclutil_str_appened ( errbuf, "get-effective-rights: subject is not dnAuthzId" ); @@ -239,7 +265,8 @@ _ger_parse_control ( Slapi_PBlock *pb, char **subjectndn, int *iscritical, char return LDAP_INVALID_SYNTAX; } - strcpy ( *subjectndn, *subjectndn + 3 ); + /* memmove is safe for overlapping copy */ + memmove ( *subjectndn, *subjectndn + 3, subjectndnlen - 2);/* 1 for '\0' */ slapi_dn_normalize ( *subjectndn ); return LDAP_SUCCESS; } @@ -533,6 +560,27 @@ _ger_get_attr_rights ( return attrrights; } +#define GER_GET_ATTR_RIGHTS(attrs) \ + for (thisattr = (attrs); thisattr && *thisattr; thisattr++) \ + { \ + _ger_get_attr_rights (gerpb, e, subjectndn, *thisattr, \ + gerstr, gerstrsize, gerstrcap, isfirstattr, errbuf); \ + isfirstattr = 0; \ + } \ + +#define GER_GET_ATTR_RIGHTA_EXT(c, inattrs, exattrs); \ + for ( i = 0; attrs[i]; i++ ) \ + { \ + if ((c) != *attrs[i] && charray_inlist((inattrs), attrs[i]) && \ + !charray_inlist((exattrs), attrs[i])) \ + { \ + _ger_get_attr_rights ( gerpb, e, subjectndn, attrs[i], \ + gerstr, gerstrsize, gerstrcap, isfirstattr, errbuf ); \ + isfirstattr = 0; \ + } \ + } + + void _ger_get_attrs_rights ( Slapi_PBlock *gerpb, @@ -552,12 +600,76 @@ _ger_get_attrs_rights ( if (attrs && *attrs) { - int i; - for ( i = 0; attrs[i]; i++ ) + int i = 0; + char **allattrs = NULL; + char **opattrs = NULL; + char **myattrs = NULL; + char **thisattr = NULL; + int hasstar = charray_inlist(attrs, "*"); + int hasplus = charray_inlist(attrs, "+"); + Slapi_Attr *objclasses = NULL; + Slapi_ValueSet *objclassvals = NULL; + + /* get all attrs available for the entry */ + slapi_entry_attr_find(e, "objectclass", &objclasses); + if (NULL != objclasses) { + Slapi_Value *v; + slapi_attr_get_valueset(objclasses, &objclassvals); + i = slapi_valueset_first_value(objclassvals, &v); + if (-1 != i) { + allattrs = slapi_schema_list_objectclass_attributes( + (const char *)v->bv.bv_val, + SLAPI_OC_FLAG_REQUIRED|SLAPI_OC_FLAG_ALLOWED); + /* add "aci" to the allattrs to adjust to do_search */ + charray_add(&allattrs, slapi_attr_syntax_normalize("aci")); + while (-1 != i) + { + i = slapi_valueset_next_value(objclassvals, i, &v); + if (-1 != i) + { + myattrs = slapi_schema_list_objectclass_attributes( + (const char *)v->bv.bv_val, + SLAPI_OC_FLAG_REQUIRED|SLAPI_OC_FLAG_ALLOWED); + charray_merge_nodup(&allattrs, myattrs, 1/*copy_strs*/); + charray_free(myattrs); + } + } + } + } + + /* get operational attrs */ + opattrs = slapi_schema_list_attribute_names(SLAPI_ATTR_FLAG_OPATTR); + + if (hasstar && hasplus) + { + GER_GET_ATTR_RIGHTS(allattrs); + GER_GET_ATTR_RIGHTS(opattrs); + } + else if (hasstar) + { + GER_GET_ATTR_RIGHTS(allattrs); + GER_GET_ATTR_RIGHTA_EXT('*', opattrs, allattrs); + } + else if (hasplus) { - _ger_get_attr_rights ( gerpb, e, subjectndn, attrs[i], gerstr, gerstrsize, gerstrcap, isfirstattr, errbuf ); - isfirstattr = 0; + GER_GET_ATTR_RIGHTS(opattrs); + GER_GET_ATTR_RIGHTA_EXT('+', allattrs, opattrs); } + else + { + for ( i = 0; attrs[i]; i++ ) + { + if (charray_inlist(allattrs, attrs[i]) || + charray_inlist(opattrs, attrs[i])) + { + _ger_get_attr_rights ( gerpb, e, subjectndn, attrs[i], + gerstr, gerstrsize, gerstrcap, isfirstattr, errbuf ); + isfirstattr = 0; + } + } + } + charray_free(allattrs); + charray_free(opattrs); } else { @@ -569,7 +681,8 @@ _ger_get_attrs_rights ( if ( ! slapi_attr_flag_is_set (attr, SLAPI_ATTR_FLAG_OPATTR) ) { slapi_attr_get_type ( attr, &type ); - _ger_get_attr_rights ( gerpb, e, subjectndn, type, gerstr, gerstrsize, gerstrcap, isfirstattr, errbuf ); + _ger_get_attr_rights ( gerpb, e, subjectndn, type, gerstr, + gerstrsize, gerstrcap, isfirstattr, errbuf ); isfirstattr = 0; } prevattr = attr; @@ -647,6 +760,131 @@ bailout: ber_bvfree ( berval ); /* ber_bvfree() checks for NULL param */ } +int +_ger_generate_template_entry ( + Slapi_PBlock *pb + ) +{ + Slapi_Entry *e = NULL; + char **gerattrs = NULL; + char **attrs = NULL; + char *templateentry = NULL; + char *object = NULL; + char *superior = NULL; + char *p = NULL; + int siz = 0; + int len = 0; + int i = 0; + int notfirst = 0; + int rc = LDAP_SUCCESS; + + slapi_pblock_get( pb, SLAPI_SEARCH_GERATTRS, &gerattrs ); + if (NULL == gerattrs) + { + slapi_log_error (SLAPI_LOG_FATAL, plugin_name, + "Objectclass info is expected " + "in the attr list, e.g., \"*@person\"\n"); + rc = LDAP_SUCCESS; + goto bailout; + } + for (i = 0; gerattrs && gerattrs[i]; i++) + { + object = strchr(gerattrs[i], '@'); + if (NULL != object && '\0' != *(++object)) + { + break; + } + } + if (NULL == object) + { + rc = LDAP_SUCCESS; /* no objectclass info; ok to return */ + goto bailout; + } + attrs = slapi_schema_list_objectclass_attributes( + (const char *)object, SLAPI_OC_FLAG_REQUIRED); + if (NULL == attrs) + { + rc = LDAP_SUCCESS; /* bogus objectclass info; ok to return */ + goto bailout; + } + for (i = 0; attrs[i]; i++) + { + if (0 == strcasecmp(attrs[i], "objectclass")) + { + /* <*attrp>: <object>\n\0 */ + siz += strlen(attrs[i]) + 4 + strlen(object); + } + else + { + /* <*attrp>: dummy\n\0 */ + siz += strlen(attrs[i]) + 4 + 5; + } + } + siz += 32 + strlen(object); /* dn: cn=<template_name>\n\0 */ + templateentry = (char *)slapi_ch_malloc(siz); + PR_snprintf(templateentry, siz, + "dn: cn=template_%s_objectclass\n", object); + for (--i; i >= 0; i--) + { + len = strlen(templateentry); + p = templateentry + len; + if (0 == strcasecmp(attrs[i], "objectclass")) + { + PR_snprintf(p, siz - len, "%s: %s\n", attrs[i], object); + } + else + { + PR_snprintf(p, siz - len, "%s: dummy\n", attrs[i]); + } + } + charray_free(attrs); + + while ((superior = slapi_schema_get_superior_name(object)) && + (0 != strcasecmp(superior, "top"))) + { + if (notfirst) + { + slapi_ch_free_string(&object); + } + notfirst = 1; + object = superior; + attrs = slapi_schema_list_objectclass_attributes( + (const char *)superior, SLAPI_OC_FLAG_REQUIRED); + for (i = 0; attrs && attrs[i]; i++) + { + if (0 == strcasecmp(attrs[i], "objectclass")) + { + /* <*attrp>: <object>\n\0 */ + siz += strlen(attrs[i]) + 4 + strlen(object); + } + } + templateentry = (char *)slapi_ch_realloc(templateentry, siz); + for (--i; i >= 0; i--) + { + len = strlen(templateentry); + p = templateentry + len; + if (0 == strcasecmp(attrs[i], "objectclass")) + { + PR_snprintf(p, siz - len, "%s: %s\n", attrs[i], object); + } + } + charray_free(attrs); + } + slapi_ch_free_string(&superior); + siz += 18; /* objectclass: top\n\0 */ + len = strlen(templateentry); + templateentry = (char *)slapi_ch_realloc(templateentry, siz); + p = templateentry + len; + PR_snprintf(p, siz - len, "objectclass: top\n"); + + e = slapi_str2entry(templateentry, SLAPI_STR2ENTRY_NOT_WELL_FORMED_LDIF); + /* set the template entry to send the result to clients */ + slapi_pblock_set(pb, SLAPI_SEARCH_RESULT_ENTRY, e); +bailout: + slapi_ch_free_string(&templateentry); + return rc; +} + int acl_get_effective_rights ( Slapi_PBlock *pb, @@ -664,10 +902,20 @@ acl_get_effective_rights ( size_t gerstrsize = 0; size_t gerstrcap = 0; int iscritical = 1; - int rc; + int rc = LDAP_SUCCESS; *errbuf = '\0'; + if (NULL == e) /* create a template entry from SLAPI_SEARCH_GERATTRS */ + { + rc = _ger_generate_template_entry ( pb ); + slapi_pblock_get ( pb, SLAPI_SEARCH_RESULT_ENTRY, &e ); + if ( rc != LDAP_SUCCESS || NULL == e ) + { + goto bailout; + } + } + /* * Get the subject */ @@ -681,7 +929,7 @@ acl_get_effective_rights ( * The requestor should have g permission on the entry * to get the effective rights. */ - rc = _ger_g_permission_granted (pb, e, errbuf); + rc = _ger_g_permission_granted (pb, e, subjectndn, errbuf); if ( rc != LDAP_SUCCESS ) { goto bailout; @@ -718,7 +966,7 @@ bailout: slapi_log_error (SLAPI_LOG_ACLSUMMARY, plugin_name, "###### Effective Rights on Entry (%s) for Subject (%s) ######\n", - slapi_entry_get_ndn (e), subjectndn); + e?slapi_entry_get_ndn(e):"null", subjectndn?subjectndn:"null"); slapi_log_error (SLAPI_LOG_ACLSUMMARY, plugin_name, "%s\n", gerstr); /* Restore pb */ diff --git a/ldap/servers/plugins/chainingdb/cb_config.c b/ldap/servers/plugins/chainingdb/cb_config.c index f2846b492..f95723ff0 100644 --- a/ldap/servers/plugins/chainingdb/cb_config.c +++ b/ldap/servers/plugins/chainingdb/cb_config.c @@ -477,7 +477,8 @@ cb_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr } else if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) { charray_remove(cb->config.chaining_components, - slapi_dn_normalize(slapi_ch_strdup(config_attr_value))); + slapi_dn_normalize(slapi_ch_strdup(config_attr_value)), + 0 /* freeit */); } } if (NULL == mods[i]->mod_bvalues) { @@ -513,7 +514,8 @@ cb_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) { charray_remove(cb->config.chainable_components, slapi_dn_normalize(slapi_ch_strdup(config_attr_value) -)); +), + 0 /* freeit */); } } if (NULL == mods[i]->mod_bvalues) { diff --git a/ldap/servers/plugins/chainingdb/cb_controls.c b/ldap/servers/plugins/chainingdb/cb_controls.c index 3c79f1cc5..ca64595c3 100644 --- a/ldap/servers/plugins/chainingdb/cb_controls.c +++ b/ldap/servers/plugins/chainingdb/cb_controls.c @@ -91,7 +91,7 @@ cb_unregister_supported_control( cb_backend * cb, char *controloid, unsigned lon return; } if ( controlops == 0 ) { - charray_remove(cb->config.forward_ctrls,controloid); + charray_remove(cb->config.forward_ctrls,controloid,0/* free it */); } PR_RWLock_Unlock(cb->config.rwl_config_lock); } diff --git a/ldap/servers/plugins/chainingdb/cb_instance.c b/ldap/servers/plugins/chainingdb/cb_instance.c index 91da2aabe..13791c0cf 100644 --- a/ldap/servers/plugins/chainingdb/cb_instance.c +++ b/ldap/servers/plugins/chainingdb/cb_instance.c @@ -392,7 +392,8 @@ int cb_instance_modify_config_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefor } else if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) { charray_remove(inst->illegal_attributes, - slapi_ch_strdup(config_attr_value)); + slapi_ch_strdup(config_attr_value), + 0 /* freeit */); } } if (NULL == mods[i]->mod_bvalues) { @@ -426,7 +427,8 @@ int cb_instance_modify_config_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefor } else if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) { charray_remove(inst->chaining_components, - slapi_dn_normalize(slapi_ch_strdup(config_attr_value))); + slapi_dn_normalize(slapi_ch_strdup(config_attr_value)), + 0 /* freeit */); } } if (NULL == mods[i]->mod_bvalues) { diff --git a/ldap/servers/plugins/schema_reload/schema_reload.c b/ldap/servers/plugins/schema_reload/schema_reload.c index d4661f19e..ac389cbb3 100644 --- a/ldap/servers/plugins/schema_reload/schema_reload.c +++ b/ldap/servers/plugins/schema_reload/schema_reload.c @@ -214,10 +214,10 @@ schemareload_add(Slapi_PBlock *pb, Slapi_Entry *e, { PRThread *thread = NULL; const char *cn; + const char *schemadir = NULL; int rv = SLAPI_DSE_CALLBACK_OK; Slapi_PBlock *mypb = NULL; Slapi_Task *task = NULL; - char *schemadir = NULL; *returncode = LDAP_SUCCESS; if ((cn = fetch_attr(e, "cn", NULL)) == NULL) { diff --git a/ldap/servers/slapd/charray.c b/ldap/servers/slapd/charray.c index 64dc19767..2f97f4d14 100644 --- a/ldap/servers/slapd/charray.c +++ b/ldap/servers/slapd/charray.c @@ -118,6 +118,48 @@ charray_merge( (*a)[n + nn] = NULL; } +/* + * charray_merge_nodup: + * merge a string array (second arg) into the first string array + * unless the each string is in the first string array. + */ +void +charray_merge_nodup( + char ***a, + char **s, + int copy_strs +) +{ + int i, j, n, nn; + char **dupa; + + if ( (s == NULL) || (s[0] == NULL) ) + return; + + for ( n = 0; *a != NULL && (*a)[n] != NULL; n++ ) { + ; /* NULL */ + } + for ( nn = 0; s[nn] != NULL; nn++ ) { + ; /* NULL */ + } + + dupa = (char **)slapi_ch_calloc(1, (n+nn+1) * sizeof(char *)); + memcpy(dupa, *a, sizeof(char *) * n); + slapi_ch_free((void **)a); + + for ( i = 0, j = 0; i < nn; i++ ) { + if (!charray_inlist(dupa, s[i])) { /* skip if s[i] is already in *a */ + if ( copy_strs ) { + dupa[n+j] = slapi_ch_strdup( s[i] ); + } else { + dupa[n+j] = s[i]; + } + j++; + } + } + *a = dupa; +} + /* Routines which don't pound on malloc. Don't interchange the arrays with the * regular calls---they can end up freeing non-heap memory, which is wrong */ @@ -337,13 +379,15 @@ charray_print( char **a ) * Remove the char string from the array of char strings. * Performs a case *insensitive* comparison! * Just shunts the strings down to cover the deleted string. - * Doesn't free up the unused memory. + * freeit: none zero -> free the found string + * : zero -> Doesn't free up the unused memory. * Returns 1 if the entry found and removed, 0 if not. */ int charray_remove( char **a, - const char *s + const char *s, + int freeit ) { int i; @@ -353,6 +397,10 @@ charray_remove( if ( !found && strcasecmp (a[i],s) == 0 ) { found= 1; + if (freeit) + { + slapi_ch_free_string(&a[i]); + } } if (found) { diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c index b9aec66af..6c81b5c21 100644 --- a/ldap/servers/slapd/opshared.c +++ b/ldap/servers/slapd/opshared.c @@ -953,67 +953,188 @@ iterate(Slapi_PBlock *pb, Slapi_Backend *be, int send_result, int *pnentries) int rc; int attrsonly; int done = 0; - Slapi_Entry *e; + Slapi_Entry *e = NULL; char **attrs = NULL; slapi_pblock_get(pb, SLAPI_SEARCH_ATTRS, &attrs); slapi_pblock_get(pb, SLAPI_SEARCH_ATTRSONLY, &attrsonly); - *pnentries = 0; + *pnentries = 0; while (!done) - { - rc = be->be_next_search_entry(pb); - if (rc < 0) - { - /* - * Some exceptional condition occurred. Results have been sent, so we're finished. - */ - if (rc == SLAPI_FAIL_DISKFULL) - { - operation_out_of_disk_space(); - } - return -1; - } - else - { - slapi_pblock_get(pb, SLAPI_SEARCH_RESULT_ENTRY, &e); - if (e == NULL) - { - /* no more entries */ - done = 1; - continue; - } - } + { + Slapi_Entry *gerentry = NULL; + Slapi_Operation *operation; - if (process_entry(pb, e, send_result)) - { - /* shouldn't send this entry */ - continue; - } + rc = be->be_next_search_entry(pb); + if (rc < 0) + { + /* + * Some exceptional condition occurred. Results have been sent, so we're finished. + */ + if (rc == SLAPI_FAIL_DISKFULL) + { + operation_out_of_disk_space(); + } + return -1; + } - /* - * It's a regular entry, or it's a referral and - * managedsait control is on. In either case, send - * the entry. - */ - switch (send_ldap_search_entry(pb, e, NULL, attrs, attrsonly)) - { - case 0: /* entry sent ok */ - (*pnentries)++; - slapi_pblock_set(pb, SLAPI_NENTRIES, pnentries); - break; - case 1: /* entry not sent */ - break; - case -1: /* connection closed */ - /* - * mark the operation as abandoned so the backend - * next entry function gets called again and has - * a chance to clean things up. - */ - pb->pb_op->o_status = SLAPI_OP_STATUS_ABANDONED; - break; - } + slapi_pblock_get(pb, SLAPI_SEARCH_RESULT_ENTRY, &e); + + /* Check for possible get_effective_rights control */ + slapi_pblock_get (pb, SLAPI_OPERATION, &operation); + if ( operation->o_flags & OP_FLAG_GET_EFFECTIVE_RIGHTS ) + { + char *errbuf = NULL; + char **gerattrs = NULL; + char **gerattrsdup = NULL; + char **gap = NULL; + char *gapnext = NULL; + + slapi_pblock_get( pb, SLAPI_SEARCH_GERATTRS, &gerattrs ); + + gerattrsdup = cool_charray_dup(gerattrs); + gap = gerattrsdup; + do + { + gapnext = NULL; + if (gap) + { + if (*gap && *(gap+1)) + { + gapnext = *(gap+1); + *(gap+1) = NULL; + } + slapi_pblock_set( pb, SLAPI_SEARCH_GERATTRS, gap ); + rc = plugin_call_acl_plugin (pb, e, attrs, NULL, + SLAPI_ACL_ALL, ACLPLUGIN_ACCESS_GET_EFFECTIVE_RIGHTS, + &errbuf); + if (NULL != gapnext) + { + *(gap+1) = gapnext; + } + } + else if (NULL != e) + { + rc = plugin_call_acl_plugin (pb, e, attrs, NULL, + SLAPI_ACL_ALL, ACLPLUGIN_ACCESS_GET_EFFECTIVE_RIGHTS, + &errbuf); + } + if (NULL == e) { + /* get the template entry, if any */ + slapi_pblock_get(pb, SLAPI_SEARCH_RESULT_ENTRY, &e); + if (NULL == e) { + /* everything is ok - don't send the result */ + return 1; + } + gerentry = e; + } + if ( rc != LDAP_SUCCESS ) { + /* Send error result and + abort op if the control is critical */ + LDAPDebug( LDAP_DEBUG_ANY, + "Failed to get effective rights for entry (%s), rc=%d\n", + slapi_entry_get_dn_const(e), rc, 0 ); + send_ldap_result( pb, rc, NULL, errbuf, 0, NULL ); + slapi_ch_free ( (void**)&errbuf ); + if (gerentry) + { + slapi_pblock_set(pb, + SLAPI_SEARCH_RESULT_ENTRY, NULL); + slapi_entry_free(gerentry); + gerentry = e = NULL; + } + return( -1 ); + } + slapi_ch_free ( (void**)&errbuf ); + if (process_entry(pb, e, send_result)) + { + /* shouldn't send this entry */ + if (gerentry) + { + slapi_pblock_set(pb, + SLAPI_SEARCH_RESULT_ENTRY, NULL); + slapi_entry_free(gerentry); + gerentry = e = NULL; + } + continue; + } + + /* + * It's a regular entry, or it's a referral and + * managedsait control is on. In either case, send + * the entry. + */ + switch (send_ldap_search_entry(pb, e, + NULL, attrs, attrsonly)) + { + case 0: /* entry sent ok */ + (*pnentries)++; + slapi_pblock_set(pb, SLAPI_NENTRIES, pnentries); + break; + case 1: /* entry not sent */ + break; + case -1: /* connection closed */ + /* + * mark the operation as abandoned so the backend + * next entry function gets called again and has + * a chance to clean things up. + */ + pb->pb_op->o_status = SLAPI_OP_STATUS_ABANDONED; + break; + } + if (gerentry) + { + slapi_pblock_set(pb, SLAPI_SEARCH_RESULT_ENTRY, NULL); + slapi_entry_free(gerentry); + gerentry = e = NULL; + } + } + while (gap && ++gap && *gap); + slapi_pblock_set( pb, SLAPI_SEARCH_GERATTRS, gerattrs ); + cool_charray_free(gerattrsdup); + if (NULL == e) + { + /* no more entries */ + done = 1; + } + } + else if (e) + { + if (process_entry(pb, e, send_result)) + { + /* shouldn't send this entry */ + continue; + } + + /* + * It's a regular entry, or it's a referral and + * managedsait control is on. In either case, send + * the entry. + */ + switch (send_ldap_search_entry(pb, e, NULL, attrs, attrsonly)) + { + case 0: /* entry sent ok */ + (*pnentries)++; + slapi_pblock_set(pb, SLAPI_NENTRIES, pnentries); + break; + case 1: /* entry not sent */ + break; + case -1: /* connection closed */ + /* + * mark the operation as abandoned so the backend + * next entry function gets called again and has + * a chance to clean things up. + */ + pb->pb_op->o_status = SLAPI_OP_STATUS_ABANDONED; + break; + } + } + else + { + /* no more entries */ + done = 1; + } } return 1; diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c index ae98dc239..987b2476f 100644 --- a/ldap/servers/slapd/pblock.c +++ b/ldap/servers/slapd/pblock.c @@ -1231,6 +1231,12 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value ) (*(char ***)value) = pblock->pb_op->o_params.p.p_search.search_attrs; } break; + case SLAPI_SEARCH_GERATTRS: + if(pblock->pb_op!=NULL) + { + (*(char ***)value) = pblock->pb_op->o_params.p.p_search.search_gerattrs; + } + break; case SLAPI_SEARCH_ATTRSONLY: if(pblock->pb_op!=NULL) { @@ -2509,6 +2515,12 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value ) pblock->pb_op->o_params.p.p_search.search_attrs = (char **) value; } break; + case SLAPI_SEARCH_GERATTRS: + if(pblock->pb_op!=NULL) + { + pblock->pb_op->o_params.p.p_search.search_gerattrs = (char **) value; + } + break; case SLAPI_SEARCH_ATTRSONLY: if(pblock->pb_op!=NULL) { diff --git a/ldap/servers/slapd/result.c b/ldap/servers/slapd/result.c index 31c839d1e..49331dceb 100644 --- a/ldap/servers/slapd/result.c +++ b/ldap/servers/slapd/result.c @@ -1203,14 +1203,15 @@ send_ldap_search_entry_ext( int *dontsendattr= NULL; Slapi_Operation *operation; int real_attrs_only = 0; - LDAPControl **ctrlp = 0; + LDAPControl **ctrlp = 0; + Slapi_Entry *gerentry = NULL; slapi_pblock_get (pb, SLAPI_OPERATION, &operation); LDAPDebug( LDAP_DEBUG_TRACE, "=> send_ldap_search_entry (%s)\n", - slapi_entry_get_dn_const(e), 0, 0 ); + e?slapi_entry_get_dn_const(e):"null", 0, 0 ); - if ( conn == NULL ) { + if ( conn == NULL && e ) { if ( op->o_search_entry_handler != NULL ) { if (( rc = (*op->o_search_entry_handler)( pb->pb_backend, conn, op, e )) == 0 ) { @@ -1224,7 +1225,7 @@ send_ldap_search_entry_ext( } #if !defined(DISABLE_ACL_CHECK) - if ( plugin_call_acl_plugin (pb, e, attrs, NULL, + if ( e && plugin_call_acl_plugin (pb, e, attrs, NULL, SLAPI_ACL_READ, ACLPLUGIN_ACCESS_READ_ON_ENTRY, NULL ) != LDAP_SUCCESS ) { LDAPDebug( LDAP_DEBUG_ACL, "acl: access to entry not allowed\n", 0, 0, 0 ); @@ -1232,21 +1233,8 @@ send_ldap_search_entry_ext( } #endif - /* Check for possible get_effective_rights control */ - if ( operation->o_flags & OP_FLAG_GET_EFFECTIVE_RIGHTS ) { - char *errbuf = NULL; - rc = plugin_call_acl_plugin (pb, e, attrs, NULL, SLAPI_ACL_ALL, - ACLPLUGIN_ACCESS_GET_EFFECTIVE_RIGHTS, &errbuf); - if ( rc != LDAP_SUCCESS ) { - LDAPDebug( LDAP_DEBUG_ANY, - "Failed to get effective rights for entry (%s), rc=%d\n", - slapi_entry_get_dn_const(e), rc, 0 ); - /* Send error result and abort op if the control is critical */ - send_ldap_result( pb, rc, NULL, errbuf, 0, NULL ); - slapi_ch_free ( (void**)&errbuf ); - return( -1 ); - } - slapi_ch_free ( (void**)&errbuf ); + if (NULL == e) { + return 1; /* everything is ok - don't send the result */ } if ( (ber = der_alloc()) == NULL ) { @@ -1454,6 +1442,10 @@ log_and_return: } } + if (gerentry) + { + slapi_entry_free(gerentry); + } LDAPDebug( LDAP_DEBUG_TRACE, "<= send_ldap_search_entry\n", 0, 0, 0 ); exit: return( rc ); diff --git a/ldap/servers/slapd/schema.c b/ldap/servers/slapd/schema.c index d116e3406..b8e154af5 100644 --- a/ldap/servers/slapd/schema.c +++ b/ldap/servers/slapd/schema.c @@ -641,41 +641,41 @@ static int oc_check_required( Slapi_PBlock *pb, Slapi_Entry *e, struct objclass *oc ) { int i; - int rc = 0; /* success, by default */ + int rc = 0; /* success, by default */ Slapi_Attr *a; if (oc == NULL || oc->oc_required == NULL || oc->oc_required[0] == NULL) { - return 0; /* success, as none required */ + return 0; /* success, as none required */ } /* for each required attribute */ for ( i = 0; oc->oc_required[i] != NULL; i++ ) { /* see if it's in the entry */ for ( a = e->e_attrs; a != NULL; a = a->a_next ) { - if ( slapi_attr_type_cmp( oc->oc_required[i], a->a_type, - SLAPI_TYPE_CMP_SUBTYPE ) == 0 ) { - break; - } - } - - /* not there => schema violation */ - if ( a == NULL ) { - char errtext[ BUFSIZ ]; - char ebuf[ BUFSIZ ]; - LDAPDebug( LDAP_DEBUG_ANY, - "Entry \"%s\" missing attribute \"%s\" required" - " by object class \"%s\"\n", - escape_string( slapi_entry_get_dn_const(e), ebuf ), - oc->oc_required[i], oc->oc_name); - if (pb) { - PR_snprintf( errtext, sizeof( errtext ), - "missing attribute \"%s\" required" - " by object class \"%s\"\n", - oc->oc_required[i], oc->oc_name ); - slapi_pblock_set( pb, SLAPI_PB_RESULT_TEXT, errtext ); - } - rc = 1; /* failure */ - } + if ( slapi_attr_type_cmp( oc->oc_required[i], a->a_type, + SLAPI_TYPE_CMP_SUBTYPE ) == 0 ) { + break; + } + } + + /* not there => schema violation */ + if ( a == NULL ) { + char errtext[ BUFSIZ ]; + char ebuf[ BUFSIZ ]; + LDAPDebug( LDAP_DEBUG_ANY, + "Entry \"%s\" missing attribute \"%s\" required" + " by object class \"%s\"\n", + escape_string( slapi_entry_get_dn_const(e), ebuf ), + oc->oc_required[i], oc->oc_name); + if (pb) { + PR_snprintf( errtext, sizeof( errtext ), + "missing attribute \"%s\" required" + " by object class \"%s\"\n", + oc->oc_required[i], oc->oc_name ); + slapi_pblock_set( pb, SLAPI_PB_RESULT_TEXT, errtext ); + } + rc = 1; /* failure */ + } } return rc; @@ -1392,8 +1392,8 @@ schema_list_attributes_callback(struct asyntaxinfo *asi, void *arg) } /* Return the list of attributes names matching attribute flags */ - -char ** slapi_schema_list_attribute_names(unsigned long flag) +char ** +slapi_schema_list_attribute_names(unsigned long flag) { struct listargs aew; memset(&aew,0,sizeof(struct listargs)); @@ -4966,3 +4966,69 @@ slapi_reload_schema_files(char *schemadir) return LDAP_LOCAL_ERROR; } } + +/* + * slapi_schema_list_objectclass_attributes: + * Return the list of attributes belonging to the objectclass + * + * The caller is responsible to free the returned list with charray_free. + * flags: one of them or both: + * SLAPI_OC_FLAG_REQUIRED + * SLAPI_OC_FLAG_ALLOWED + */ +char ** +slapi_schema_list_objectclass_attributes(const char *ocname_or_oid, + PRUint32 flags) +{ + struct objclass *oc = NULL; + char **attrs = NULL; + PRUint32 mask = SLAPI_OC_FLAG_REQUIRED | SLAPI_OC_FLAG_ALLOWED; + + if (!flags) { + return attrs; + } + + oc_lock_read(); + oc = oc_find_nolock(ocname_or_oid); + if (oc) { + switch (flags & mask) { + case SLAPI_OC_FLAG_REQUIRED: + attrs = charray_dup(oc->oc_required); + break; + case SLAPI_OC_FLAG_ALLOWED: + attrs = charray_dup(oc->oc_allowed); + break; + case SLAPI_OC_FLAG_REQUIRED|SLAPI_OC_FLAG_ALLOWED: + attrs = charray_dup(oc->oc_required); + charray_merge(&attrs, oc->oc_allowed, 1/*copy_strs*/); + break; + default: + slapi_log_error( SLAPI_LOG_FATAL, "list objectclass attributes", + "flag 0x%x not supported\n", flags ); + break; + } + } + oc_unlock(); + return attrs; +} + +/* + * slapi_schema_get_superior_name: + * Return the name of the superior objectclass + * + * The caller is responsible to free the returned name + */ +char * +slapi_schema_get_superior_name(const char *ocname_or_oid) +{ + struct objclass *oc = NULL; + char *superior = NULL; + + oc_lock_read(); + oc = oc_find_nolock(ocname_or_oid); + if (oc) { + superior = slapi_ch_strdup(oc->oc_superior); + } + oc_unlock(); + return superior; +} diff --git a/ldap/servers/slapd/search.c b/ldap/servers/slapd/search.c index dcd8265c4..c3d1c80d2 100644 --- a/ldap/servers/slapd/search.c +++ b/ldap/servers/slapd/search.c @@ -65,92 +65,93 @@ void do_search( Slapi_PBlock *pb ) { Slapi_Operation *operation; - BerElement *ber; - int i, err, attrsonly; - ber_int_t scope, deref, sizelimit, timelimit; - char *base = NULL, *fstr = NULL; - struct slapi_filter *filter = NULL; - char **attrs = NULL; - int psearch = 0; - struct berval *psbvp; - ber_int_t changetypes; + BerElement *ber; + int i, err, attrsonly; + ber_int_t scope, deref, sizelimit, timelimit; + char *base = NULL, *fstr = NULL; + struct slapi_filter *filter = NULL; + char **attrs = NULL; + char **gerattrs = NULL; + int psearch = 0; + struct berval *psbvp; + ber_int_t changetypes; int send_entchg_controls; int changesonly = 0; int rc = -1; char *original_base = 0; char *new_base = 0; - LDAPDebug( LDAP_DEBUG_TRACE, "do_search\n", 0, 0, 0 ); + LDAPDebug( LDAP_DEBUG_TRACE, "do_search\n", 0, 0, 0 ); slapi_pblock_get( pb, SLAPI_OPERATION, &operation); - ber = operation->o_ber; + ber = operation->o_ber; - /* count the search request */ - snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsSearchOps); + /* count the search request */ + snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsSearchOps); - /* - * Parse the search request. It looks like this: - * - * SearchRequest := [APPLICATION 3] SEQUENCE { - * baseObject DistinguishedName, - * scope ENUMERATED { - * baseObject (0), - * singleLevel (1), - * wholeSubtree (2) - * }, - * derefAliases ENUMERATED { - * neverDerefaliases (0), - * derefInSearching (1), - * derefFindingBaseObj (2), - * alwaysDerefAliases (3) - * }, - * sizelimit INTEGER (0 .. 65535), - * timelimit INTEGER (0 .. 65535), - * attrsOnly BOOLEAN, - * filter Filter, - * attributes SEQUENCE OF AttributeType - * } - */ + /* + * Parse the search request. It looks like this: + * + * SearchRequest := [APPLICATION 3] SEQUENCE { + * baseObject DistinguishedName, + * scope ENUMERATED { + * baseObject (0), + * singleLevel (1), + * wholeSubtree (2) + * }, + * derefAliases ENUMERATED { + * neverDerefaliases (0), + * derefInSearching (1), + * derefFindingBaseObj (2), + * alwaysDerefAliases (3) + * }, + * sizelimit INTEGER (0 .. 65535), + * timelimit INTEGER (0 .. 65535), + * attrsOnly BOOLEAN, + * filter Filter, + * attributes SEQUENCE OF AttributeType + * } + */ - /* baseObject, scope, derefAliases, sizelimit, timelimit, attrsOnly */ - if ( ber_scanf( ber, "{aiiiib", &base, &scope, &deref, &sizelimit, &timelimit, &attrsonly ) == LBER_ERROR ){ - slapi_ch_free((void**)&base ); - log_search_access (pb, "???", -1, "???", "decoding error"); - send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, NULL, 0, NULL ); - return; - } + /* baseObject, scope, derefAliases, sizelimit, timelimit, attrsOnly */ + if ( ber_scanf( ber, "{aiiiib", &base, &scope, &deref, &sizelimit, &timelimit, &attrsonly ) == LBER_ERROR ){ + slapi_ch_free((void**)&base ); + log_search_access (pb, "???", -1, "???", "decoding error"); + send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, NULL, 0, NULL ); + return; + } - /* - * ignore negative time and size limits since they make no sense - */ - if ( timelimit < 0 ) { + /* + * ignore negative time and size limits since they make no sense + */ + if ( timelimit < 0 ) { timelimit = 0; - } - if ( sizelimit < 0 ) { + } + if ( sizelimit < 0 ) { sizelimit = 0; - } + } - if ( scope != LDAP_SCOPE_BASE && scope != LDAP_SCOPE_ONELEVEL + if ( scope != LDAP_SCOPE_BASE && scope != LDAP_SCOPE_ONELEVEL && scope != LDAP_SCOPE_SUBTREE ) { log_search_access (pb, base, scope, "???", "Unknown search scope"); - send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, + send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, "Unknown search scope", 0, NULL ); - goto free_and_return; - } - /* check and record the scope for snmp */ - if ( scope == LDAP_SCOPE_ONELEVEL) { + goto free_and_return; + } + /* check and record the scope for snmp */ + if ( scope == LDAP_SCOPE_ONELEVEL) { /* count the one level search request */ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsOneLevelSearchOps); - } else if (scope == LDAP_SCOPE_SUBTREE) { + } else if (scope == LDAP_SCOPE_SUBTREE) { /* count the subtree search request */ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsWholeSubtreeSearchOps); - } + } - /* filter - returns a "normalized" version */ - filter = NULL; - fstr = NULL; - if ( (err = get_filter( pb->pb_conn, ber, scope, &filter, &fstr )) != 0 ) { + /* filter - returns a "normalized" version */ + filter = NULL; + fstr = NULL; + if ( (err = get_filter( pb->pb_conn, ber, scope, &filter, &fstr )) != 0 ) { char *errtxt; if ( LDAP_UNWILLING_TO_PERFORM == err ) { @@ -159,18 +160,18 @@ do_search( Slapi_PBlock *pb ) errtxt = "Bad search filter"; } log_search_access( pb, base, scope, "???", errtxt ); - send_ldap_result( pb, err, NULL, errtxt, 0, NULL ); - goto free_and_return; - } + send_ldap_result( pb, err, NULL, errtxt, 0, NULL ); + goto free_and_return; + } - /* attributes */ - attrs = NULL; - if ( ber_scanf( ber, "{v}}", &attrs ) == LBER_ERROR ) { + /* attributes */ + attrs = NULL; + if ( ber_scanf( ber, "{v}}", &attrs ) == LBER_ERROR ) { log_search_access (pb, base, scope, fstr, "decoding error"); - send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, NULL, 0, + send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, NULL, 0, NULL ); - goto free_and_return; - } + goto free_and_return; + } /* * This search is performed against the legacy consumer, so ask explicitly @@ -186,56 +187,128 @@ do_search( Slapi_PBlock *pb ) charray_add(&attrs, slapi_attr_syntax_normalize("aci")); charray_add(&attrs, slapi_attr_syntax_normalize(LDAP_ALL_USER_ATTRS)); } - else + } + + if ( attrs != NULL ) { + int gerattrsiz = 1; + int gerattridx = 0; + int aciin = 0; + /* + * . store gerattrs if any + * . add "aci" once if "*" is given + */ + for ( i = 0; attrs[i] != NULL; i++ ) { - for ( i = 0; attrs[i] != NULL; i++ ) + char *p = NULL; + /* check if @<objectclass> is included */ + p = strchr(attrs[i], '@'); + if ( p && '\0' != *(p+1) ) /* don't store "*@", e.g. */ { - if ( strcasecmp(attrs[i], LDAP_ALL_USER_ATTRS) == 0 ) + int j = 0; + if (gerattridx + 1 >= gerattrsiz) + { + char **tmpgerattrs; + gerattrsiz *= 2; + tmpgerattrs = + (char **)slapi_ch_calloc(1, gerattrsiz*sizeof(char *)); + if (NULL != gerattrs) + { + memcpy(tmpgerattrs, gerattrs, gerattrsiz*sizeof(char *)); + slapi_ch_free((void **)&gerattrs); + } + gerattrs = tmpgerattrs; + } + for ( j = 0; gerattrs; j++ ) { - charray_add(&attrs, slapi_attr_syntax_normalize("aci")); - break; + char *attri = NULL; + if ( NULL == gerattrs[j] ) + { + if (0 == j) + { + /* first time */ + gerattrs[gerattridx++] = attrs[i]; + /* get rid of "@<objectclass>" part from the attr + list, which is needed only in gerattr list */ + *p = '\0'; + attri = slapi_ch_strdup(attrs[i]); + attrs[i] = attri; + *p = '@'; + } + else + { + break; /* done */ + } + } + else if ( 0 == strcasecmp( attrs[i], gerattrs[j] )) + { + /* skip if attrs[i] is already in gerattrs */ + continue; + } + else + { + char *q = strchr(gerattrs[j], '@'); /* q never be 0 */ + if ( 0 != strcasecmp( p+1, q+1 )) + { + /* you don't want to display the same template + entry multiple times */ + gerattrs[gerattridx++] = attrs[i]; + } + /* get rid of "@<objectclass>" part from the attr + list, which is needed only in gerattr list */ + *p = '\0'; + attri = slapi_ch_strdup(attrs[i]); + attrs[i] = attri; + *p = '@'; + } } } + else if ( !aciin && strcasecmp(attrs[i], LDAP_ALL_USER_ATTRS) == 0 ) + { + charray_add(&attrs, slapi_attr_syntax_normalize("aci")); + aciin = 1; + } + } + if (NULL != gerattrs) + { + gerattrs[gerattridx] = NULL; } - } - if ( attrs != NULL ) { - operation->o_searchattrs = cool_charray_dup( attrs ); - for ( i = 0; attrs[i] != NULL; i++ ) { - char *type; + operation->o_searchattrs = cool_charray_dup( attrs ); + for ( i = 0; attrs[i] != NULL; i++ ) { + char *type; - type = slapi_attr_syntax_normalize(attrs[i]); - slapi_ch_free( (void**)&(attrs[i]) ); - attrs[i] = type; - } - } - if ( slapd_ldap_debug & LDAP_DEBUG_ARGS ) { - char abuf[ 1024 ], *astr; + type = slapi_attr_syntax_normalize(attrs[i]); + slapi_ch_free( (void**)&(attrs[i]) ); + attrs[i] = type; + } + } + if ( slapd_ldap_debug & LDAP_DEBUG_ARGS ) { + char abuf[ 1024 ], *astr; - if ( NULL == attrs ) { - astr = "ALL"; - } else { - strarray2str( attrs, abuf, sizeof( abuf ), 1 /* include quotes */); - astr = abuf; + if ( NULL == attrs ) { + astr = "ALL"; + } else { + strarray2str( attrs, abuf, sizeof( abuf ), 1 /* include quotes */); + astr = abuf; + } + slapi_log_error( SLAPI_LOG_ARGS, NULL, "SRCH base=\"%s\" " + "scope=%d deref=%d " + "sizelimit=%d timelimit=%d attrsonly=%d filter=\"%s\" " + "attrs=%s\n", base, scope, deref, sizelimit, timelimit, + attrsonly, fstr, astr ); } - slapi_log_error( SLAPI_LOG_ARGS, NULL, "SRCH base=\"%s\" " - "scope=%d deref=%d " - "sizelimit=%d timelimit=%d attrsonly=%d filter=\"%s\" " - "attrs=%s\n", base, scope, deref, sizelimit, timelimit, - attrsonly, fstr, astr ); - } - /* - * in LDAPv3 there can be optional control extensions on - * the end of an LDAPMessage. we need to read them in and - * pass them to the backend. get_ldapmessage_controls() - * reads the controls and sets any we know about in the pb. - */ - if ( (err = get_ldapmessage_controls( pb, ber, NULL )) != 0 ) { + /* + * in LDAPv3 there can be optional control extensions on + * the end of an LDAPMessage. we need to read them in and + * pass them to the backend. get_ldapmessage_controls() + * reads the controls and sets any we know about in the pb. + */ + if ( (err = get_ldapmessage_controls( pb, ber, NULL )) != 0 ) { log_search_access (pb, base, scope, fstr, "failed to decode LDAP controls"); - send_ldap_result( pb, err, NULL, NULL, 0, NULL ); - goto free_and_return; - } + send_ldap_result( pb, err, NULL, NULL, 0, NULL ); + goto free_and_return; + } /* we support persistent search for regular operations only */ if ( slapi_control_present( operation->o_params.request_controls, @@ -254,15 +327,16 @@ do_search( Slapi_PBlock *pb ) } } - slapi_pblock_set( pb, SLAPI_SEARCH_TARGET, base ); + slapi_pblock_set( pb, SLAPI_SEARCH_TARGET, base ); slapi_pblock_set( pb, SLAPI_ORIGINAL_TARGET_DN, slapi_ch_strdup(base) ); - slapi_pblock_set( pb, SLAPI_SEARCH_SCOPE, &scope ); - slapi_pblock_set( pb, SLAPI_SEARCH_DEREF, &deref ); - slapi_pblock_set( pb, SLAPI_SEARCH_FILTER, filter ); - slapi_pblock_set( pb, SLAPI_SEARCH_STRFILTER, fstr ); - slapi_pblock_set( pb, SLAPI_SEARCH_ATTRS, attrs ); - slapi_pblock_set( pb, SLAPI_SEARCH_ATTRSONLY, &attrsonly ); - slapi_pblock_set( pb, SLAPI_REQUESTOR_ISROOT, &operation->o_isroot ); + slapi_pblock_set( pb, SLAPI_SEARCH_SCOPE, &scope ); + slapi_pblock_set( pb, SLAPI_SEARCH_DEREF, &deref ); + slapi_pblock_set( pb, SLAPI_SEARCH_FILTER, filter ); + slapi_pblock_set( pb, SLAPI_SEARCH_STRFILTER, fstr ); + slapi_pblock_set( pb, SLAPI_SEARCH_ATTRS, attrs ); + slapi_pblock_set( pb, SLAPI_SEARCH_GERATTRS, gerattrs ); + slapi_pblock_set( pb, SLAPI_SEARCH_ATTRSONLY, &attrsonly ); + slapi_pblock_set( pb, SLAPI_REQUESTOR_ISROOT, &operation->o_isroot ); slapi_pblock_set( pb, SLAPI_SEARCH_SIZELIMIT, &sizelimit ); slapi_pblock_set( pb, SLAPI_SEARCH_TIMELIMIT, &timelimit ); @@ -277,23 +351,22 @@ do_search( Slapi_PBlock *pb ) slapi_pblock_get(pb, SLAPI_SEARCH_TARGET, &new_base); slapi_pblock_get (pb, SLAPI_PLUGIN_OPRETURN, &rc); - slapi_pblock_get( pb, SLAPI_SEARCH_FILTER, &filter ); + slapi_pblock_get( pb, SLAPI_SEARCH_FILTER, &filter ); - if ( psearch && rc == 0 ) { + if ( psearch && rc == 0 ) { ps_add( pb, changetypes, send_entchg_controls ); - } + } free_and_return:; - if ( !psearch || rc < 0 ) { + if ( !psearch || rc < 0 ) { if(original_base != new_base) { slapi_ch_free_string(&new_base); } - slapi_ch_free_string(&base); - slapi_ch_free_string(&fstr); - slapi_filter_free( filter, 1 ); - if ( attrs != NULL ) { - charray_free( attrs ); - } + slapi_ch_free_string(&base); + slapi_ch_free_string(&fstr); + slapi_filter_free( filter, 1 ); + charray_free( attrs ); /* passing NULL is fine */ + charray_free( gerattrs ); /* passing NULL is fine */ /* * Fix for defect 526719 / 553356 : Persistent search op failed. * Marking it as non-persistent so that operation resources get freed @@ -304,7 +377,7 @@ free_and_return:; /* we strdup'd this above - need to free */ slapi_pblock_get(pb, SLAPI_ORIGINAL_TARGET_DN, &base); slapi_ch_free_string(&base); - } + } } static void log_search_access (Slapi_PBlock *pb, const char *base, int scope, const char *fstr, const char *msg) diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h index 26733b1f5..92cac83c8 100644 --- a/ldap/servers/slapd/slapi-plugin.h +++ b/ldap/servers/slapd/slapi-plugin.h @@ -72,6 +72,9 @@ extern "C" { #define SLAPI_OP_FLAG_NEVER_CHAIN 0x00800 /* Do not chain the operation */ #define SLAPI_OP_FLAG_NO_ACCESS_CHECK 0x10000 /* Do not check for access control - bypass them */ +#define SLAPI_OC_FLAG_REQUIRED 0x0001 +#define SLAPI_OC_FLAG_ALLOWED 0x0002 + /* * access control levels */ @@ -1703,6 +1706,7 @@ typedef struct slapi_plugindesc { #define SLAPI_SEARCH_FILTER 114 #define SLAPI_SEARCH_STRFILTER 115 #define SLAPI_SEARCH_ATTRS 116 +#define SLAPI_SEARCH_GERATTRS 1160 #define SLAPI_SEARCH_ATTRSONLY 117 #define SLAPI_SEARCH_IS_AND 118 diff --git a/ldap/servers/slapd/slapi-private.h b/ldap/servers/slapd/slapi-private.h index 59e95d4ab..8d16deee6 100644 --- a/ldap/servers/slapd/slapi-private.h +++ b/ldap/servers/slapd/slapi-private.h @@ -574,6 +574,7 @@ typedef struct slapi_operation_parameters char **search_attrs; int search_attrsonly; int search_is_and; + char **search_gerattrs; } p_search; struct abandon_parameters @@ -726,6 +727,11 @@ struct slapi_componentid * plugin_get_default_component_id(); /* return the list of attr defined in the schema matching the attr flags */ char ** slapi_schema_list_attribute_names(unsigned long flag); +/* return the list of attributes belonging to the objectclass */ +char ** slapi_schema_list_objectclass_attributes(const char *ocname_or_oid, + PRUint32 flags); +char * slapi_schema_get_superior_name(const char *ocname_or_oid); + CSN *dup_global_schema_csn(); /* misc function for the chaining backend */ @@ -787,13 +793,14 @@ int slapi_config_get_readonly(); */ void charray_add( char ***a, char *s ); void charray_merge( char ***a, char **s, int copy_strs ); +void charray_merge_nodup( char ***a, char **s, int copy_strs ); void charray_free( char **array ); int charray_inlist( char **a, char *s ); int charray_utf8_inlist( char **a, char *s ); char ** charray_dup( char **a ); char ** str2charray( char *str, char *brkstr ); char ** str2charray_ext( char *str, char *brkstr, int allow_dups ); -int charray_remove(char **a,const char *s); +int charray_remove(char **a, const char *s, int freeit); char ** cool_charray_dup( char **a ); void cool_charray_free( char **array ); void charray_subtract( char **a, char **b, char ***c ); @@ -1124,10 +1131,6 @@ char* slapd_get_tmp_dir( void ); const char* escape_string (const char* str, char buf[BUFSIZ]); const char* escape_string_with_punctuation(const char* str, char buf[BUFSIZ]); const char* escape_filter_value(const char* str, int len, char buf[BUFSIZ]); -void charray_add( char ***a, char *s ); -void charray_free(char **array); -int charray_remove(char **a,const char *s); -int charray_inlist( char **a, char *s ); char *slapi_berval_get_string_copy(const struct berval *bval);
0
55cbd275fae33702f7df2df1e5df348ce6418b94
389ds/389-ds-base
Issue 5214 - CI Test tests/suites/replication/virtual_attribute_replication_test.py (#5215) Bug description: The test test_vattr_on_cos_definition_with_replication creates a COS in a supplier/consumer topology. With that virtual attribute, nsslapd-ignore-virtual-attrs gets the value OFF. Then it deletes the COS on the supplier but does not wait that the DEL is propagated to the consumer before restarting the consumer. The consequence is that at startup, consumer may keep nsslapd-ignore-virtual-attrs=OFF Fix description: Wait that replication is in sync before restarting the consumer relates: #5214 Reviewed by: Mark Reynolds Platforms tested: F34
commit 55cbd275fae33702f7df2df1e5df348ce6418b94 Author: tbordaz <[email protected]> Date: Thu Mar 17 18:38:51 2022 +0100 Issue 5214 - CI Test tests/suites/replication/virtual_attribute_replication_test.py (#5215) Bug description: The test test_vattr_on_cos_definition_with_replication creates a COS in a supplier/consumer topology. With that virtual attribute, nsslapd-ignore-virtual-attrs gets the value OFF. Then it deletes the COS on the supplier but does not wait that the DEL is propagated to the consumer before restarting the consumer. The consequence is that at startup, consumer may keep nsslapd-ignore-virtual-attrs=OFF Fix description: Wait that replication is in sync before restarting the consumer relates: #5214 Reviewed by: Mark Reynolds Platforms tested: F34 diff --git a/dirsrvtests/tests/suites/replication/virtual_attribute_replication_test.py b/dirsrvtests/tests/suites/replication/virtual_attribute_replication_test.py index ae81373a6..230237583 100644 --- a/dirsrvtests/tests/suites/replication/virtual_attribute_replication_test.py +++ b/dirsrvtests/tests/suites/replication/virtual_attribute_replication_test.py @@ -15,6 +15,7 @@ from lib389.idm.organization import Organization from lib389.topologies import topology_m1c1 as topo from lib389.idm.role import FilteredRoles, ManagedRoles from lib389.cos import CosClassicDefinition, CosClassicDefinitions, CosTemplate +from lib389.replica import ReplicationManager logging.getLogger(__name__).setLevel(logging.INFO) log = logging.getLogger(__name__) @@ -87,6 +88,10 @@ def test_vattr_on_cos_definition_with_replication(topo, reset_ignore_vattr): c.start() log.info("Delete a cos definition") cosdef.delete() + repl = ReplicationManager(DEFAULT_SUFFIX) + log.info("Check Delete was propagated") + repl.wait_for_replication(s, c) + log.info("Check the default value of attribute nsslapd-ignore-virtual-attrs is back to ON over consumer") s.restart() c.restart()
0
50aff5657fb42d2b4b97e19eefcaa70d2464c694
389ds/389-ds-base
Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093 https://bugzilla.redhat.com/show_bug.cgi?id=617630 Bug description: CID 12090 was a false positive description: Undo the commit e23c8bd9994d5592738cb44e1c2b426aba7fbd4a
commit 50aff5657fb42d2b4b97e19eefcaa70d2464c694 Author: Noriko Hosoi <[email protected]> Date: Wed Aug 25 23:19:02 2010 -0700 Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093 https://bugzilla.redhat.com/show_bug.cgi?id=617630 Bug description: CID 12090 was a false positive description: Undo the commit e23c8bd9994d5592738cb44e1c2b426aba7fbd4a diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c index 4892732d6..01c160c2f 100644 --- a/ldap/servers/slapd/entrywsi.c +++ b/ldap/servers/slapd/entrywsi.c @@ -475,6 +475,7 @@ entry_add_present_values_wsi(Slapi_Entry *e, const char *type, struct berval **b /* Append the pending values to a->a_present_values */ valuearray_update_csn (valuestoadd,CSN_TYPE_VALUE_UPDATED,csn); valueset_add_valuearray_ext(&a->a_present_values, valuestoadd, SLAPI_VALUE_FLAG_PASSIN); + slapi_ch_free ( (void **)&valuestoadd ); /* * Now delete non-RDN values from a->a_present_values; and @@ -521,11 +522,10 @@ entry_add_present_values_wsi(Slapi_Entry *e, const char *type, struct berval **b } valuearray_update_csn(valuestoadd,CSN_TYPE_VALUE_UPDATED,csn); retVal= attr_add_valuearray(a, valuestoadd, slapi_entry_get_dn_const(e)); + valuearray_free(&valuestoadd); } a->a_flags = a_flags_orig; } - - valuearray_free(&valuestoadd); return(retVal); }
0
2bbde88012376cf32c7d91a9ba5b5aa1a6c00922
389ds/389-ds-base
Ticket 47664 - CI test: add test case for ticket 47664 Bug Description: Passing Simple Paged Results control and Get Effective Rights control at the same time, the search ignores paging. Test Description: Import 20 entries. Run Simple Paged Results + Get Effective Rights search with the page size 4. If it returns 4 entries with Get Effective Rights attributes / page AND the page count is 5, it passes the test. https://fedorahosted.org/389/ticket/47664 Reviewed by [email protected] (Thank you, Mark!!)
commit 2bbde88012376cf32c7d91a9ba5b5aa1a6c00922 Author: Noriko Hosoi <[email protected]> Date: Tue Jul 15 16:41:02 2014 -0700 Ticket 47664 - CI test: add test case for ticket 47664 Bug Description: Passing Simple Paged Results control and Get Effective Rights control at the same time, the search ignores paging. Test Description: Import 20 entries. Run Simple Paged Results + Get Effective Rights search with the page size 4. If it returns 4 entries with Get Effective Rights attributes / page AND the page count is 5, it passes the test. https://fedorahosted.org/389/ticket/47664 Reviewed by [email protected] (Thank you, Mark!!) diff --git a/dirsrvtests/tickets/ticket47664_test.py b/dirsrvtests/tickets/ticket47664_test.py new file mode 100644 index 000000000..f37430256 --- /dev/null +++ b/dirsrvtests/tickets/ticket47664_test.py @@ -0,0 +1,268 @@ +import os +import sys +import time +import ldap +import logging +import socket +import time +import logging +import pytest +from lib389 import DirSrv, Entry, tools, tasks +from lib389.tools import DirSrvTools +from lib389._constants import * +from lib389.properties import * +from lib389.tasks import * +from constants import * +from ldap.controls import SimplePagedResultsControl +from ldap.controls.simple import GetEffectiveRightsControl + +log = logging.getLogger(__name__) + +installation_prefix = None + +MYSUFFIX = 'o=ticket47664.org' +MYSUFFIXBE = 'ticket47664' + +_MYLDIF = 'ticket47664.ldif' + +SEARCHFILTER = '(objectclass=*)' + +class TopologyStandalone(object): + def __init__(self, standalone): + standalone.open() + self.standalone = standalone + + [email protected](scope="module") +def topology(request): + ''' + This fixture is used to standalone topology for the 'module'. + At the beginning, It may exists a standalone instance. + It may also exists a backup for the standalone instance. + + Principle: + If standalone instance exists: + restart it + If backup of standalone exists: + create/rebind to standalone + + restore standalone instance from backup + else: + Cleanup everything + remove instance + remove backup + Create instance + Create backup + ''' + global installation_prefix + + if installation_prefix: + args_instance[SER_DEPLOYED_DIR] = installation_prefix + + standalone = DirSrv(verbose=False) + + # Args for the standalone instance + args_instance[SER_HOST] = HOST_STANDALONE + args_instance[SER_PORT] = PORT_STANDALONE + args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE + args_standalone = args_instance.copy() + standalone.allocate(args_standalone) + + # Get the status of the backups + backup_standalone = standalone.checkBackupFS() + + # Get the status of the instance and restart it if it exists + instance_standalone = standalone.exists() + if instance_standalone: + # assuming the instance is already stopped, just wait 5 sec max + standalone.stop(timeout=5) + standalone.start(timeout=10) + + if backup_standalone: + # The backup exist, assuming it is correct + # we just re-init the instance with it + if not instance_standalone: + standalone.create() + # Used to retrieve configuration information (dbdir, confdir...) + standalone.open() + + # restore standalone instance from backup + standalone.stop(timeout=10) + standalone.restoreFS(backup_standalone) + standalone.start(timeout=10) + + else: + # We should be here only in two conditions + # - This is the first time a test involve standalone instance + # - Something weird happened (instance/backup destroyed) + # so we discard everything and recreate all + + # Remove the backup. So even if we have a specific backup file + # (e.g backup_standalone) we clear backup that an instance may have created + if backup_standalone: + standalone.clearBackupFS() + + # Remove the instance + if instance_standalone: + standalone.delete() + + # Create the instance + standalone.create() + + # Used to retrieve configuration information (dbdir, confdir...) + standalone.open() + + # Time to create the backups + standalone.stop(timeout=10) + standalone.backupfile = standalone.backupFS() + standalone.start(timeout=10) + + # clear the tmp directory + standalone.clearTmpDir(__file__) + + # + # Here we have standalone instance up and running + # Either coming from a backup recovery + # or from a fresh (re)init + # Time to return the topology + return TopologyStandalone(standalone) + + +def test_ticket47664_run(topology): + """ + Import 20 entries + Search with Simple Paged Results Control (pagesize = 4) + Get Effective Rights Control (attrs list = ['cn']) + If Get Effective Rights attribute (attributeLevelRights for 'cn') is returned 4 attrs / page AND + the page count == 20/4, then the fix is verified. + """ + log.info('Testing Ticket 47664 - paged results control is not working in some cases when we have a subsuffix') + + # bind as directory manager + topology.standalone.log.info("Bind as %s" % DN_DM) + topology.standalone.simple_bind_s(DN_DM, PASSWORD) + + topology.standalone.log.info("\n\n######################### SETUP SUFFIX o=ticket47664.org ######################\n") + + topology.standalone.backend.create(MYSUFFIX, {BACKEND_NAME: MYSUFFIXBE}) + topology.standalone.mappingtree.create(MYSUFFIX, bename=MYSUFFIXBE) + + topology.standalone.log.info("\n\n######################### Generate Test data ######################\n") + + # get tmp dir + mytmp = topology.standalone.getDir(__file__, TMP_DIR) + if mytmp == None: + mytmp = "/tmp" + + MYLDIF = '%s%s' % (mytmp, _MYLDIF) + os.system('ls %s' % MYLDIF) + os.system('rm -f %s' % MYLDIF) + os.system('dbgen.pl -s %s -o %s -n 14' % (MYSUFFIX, MYLDIF)) + + cmdline = 'egrep dn: %s | wc -l' % MYLDIF + p = os.popen(cmdline, "r") + dnnumstr = p.readline() + dnnum = int(dnnumstr) + topology.standalone.log.info("We have %d entries.\n", dnnum) + + topology.standalone.log.info("\n\n######################### Import Test data ######################\n") + + args = {TASK_WAIT: True} + importTask = Tasks(topology.standalone) + importTask.importLDIF(MYSUFFIX, MYSUFFIXBE, MYLDIF, args) + + topology.standalone.log.info("\n\n######################### SEARCH ALL ######################\n") + topology.standalone.log.info("Bind as %s and add the READ/SEARCH SELFDN aci" % DN_DM) + topology.standalone.simple_bind_s(DN_DM, PASSWORD) + + entries = topology.standalone.search_s(MYSUFFIX, ldap.SCOPE_SUBTREE, SEARCHFILTER) + topology.standalone.log.info("Returned %d entries.\n", len(entries)) + + #print entries + + assert dnnum == len(entries) + + topology.standalone.log.info('%d entries are successfully imported.' % dnnum) + + topology.standalone.log.info("\n\n######################### SEARCH WITH SIMPLE PAGED RESULTS CONTROL ######################\n") + + page_size = 4 + spr_req_ctrl = SimplePagedResultsControl(True, size=page_size, cookie='') + ger_req_ctrl = GetEffectiveRightsControl(True, "dn: " + DN_DM) + + known_ldap_resp_ctrls = { + SimplePagedResultsControl.controlType:SimplePagedResultsControl, + } + + topology.standalone.log.info("Calling search_ext...") + msgid = topology.standalone.search_ext(MYSUFFIX, + ldap.SCOPE_SUBTREE, + SEARCHFILTER, + ['cn'], + serverctrls=[spr_req_ctrl, ger_req_ctrl]) + attrlevelrightscnt = 0 + pageddncnt = 0 + pages = 0 + while True: + pages += 1 + + topology.standalone.log.info("Getting page %d" % pages) + rtype, rdata, rmsgid, responcectrls = topology.standalone.result3(msgid, resp_ctrl_classes=known_ldap_resp_ctrls) + topology.standalone.log.info("%d results" % len(rdata)) + pageddncnt += len(rdata) + + topology.standalone.log.info("Results:") + for dn, attrs in rdata: + topology.standalone.log.info("dn: %s" % dn) + topology.standalone.log.info("attributeLevelRights: %s" % attrs['attributeLevelRights'][0]) + if attrs['attributeLevelRights'][0] != "": + attrlevelrightscnt += 1 + + pctrls = [ + c for c in responcectrls if c.controlType == SimplePagedResultsControl.controlType + ] + if not pctrls: + topology.standalone.log.info('Warning: Server ignores RFC 2696 control.') + break + + if pctrls[0].cookie: + spr_req_ctrl.cookie = pctrls[0].cookie + topology.standalone.log.info("cookie: %s" % spr_req_ctrl.cookie) + msgid = topology.standalone.search_ext(MYSUFFIX, + ldap.SCOPE_SUBTREE, + SEARCHFILTER, + ['cn'], + serverctrls=[spr_req_ctrl, ger_req_ctrl]) + else: + topology.standalone.log.info("No cookie") + break + + topology.standalone.log.info("Paged result search returned %d entries in %d pages.\n", pageddncnt, pages) + + assert dnnum == len(entries) + assert dnnum == attrlevelrightscnt + assert pages == (dnnum / page_size) + topology.standalone.log.info("ticket47664 was successfully verified."); + +def test_ticket47664_final(topology): + topology.standalone.stop(timeout=10) + +def run_isolated(): + ''' + run_isolated is used to run these test cases independently of a test scheduler (xunit, py.test..) + To run isolated without py.test, you need to + - edit this file and comment '@pytest.fixture' line before 'topology' function. + - set the installation prefix + - run this program + ''' + global installation_prefix + installation_prefix = None + + topo = topology(True) + test_ticket47664_run(topo) + + test_ticket47664_final(topo) + + +if __name__ == '__main__': + run_isolated() +
0
a15416d095e07c333c027965032e08bfc729d422
389ds/389-ds-base
Ticket 534 - Add SASL mappings fallback Bug Description: IPA team requested that the fallback feature be configurable. Fix Description: Added new config setting under cn=config to turn feature "on", the default is "off". https://fedorahosted.org/389/ticket/534 Reviewed by: richm(Thanks Rich!)
commit a15416d095e07c333c027965032e08bfc729d422 Author: Mark Reynolds <[email protected]> Date: Mon Jan 7 16:50:52 2013 -0500 Ticket 534 - Add SASL mappings fallback Bug Description: IPA team requested that the fallback feature be configurable. Fix Description: Added new config setting under cn=config to turn feature "on", the default is "off". https://fedorahosted.org/389/ticket/534 Reviewed by: richm(Thanks Rich!) diff --git a/ldap/ldif/template-dse.ldif.in b/ldap/ldif/template-dse.ldif.in index e7837a7d8..b854c4746 100644 --- a/ldap/ldif/template-dse.ldif.in +++ b/ldap/ldif/template-dse.ldif.in @@ -57,6 +57,7 @@ nsslapd-rootpw: %ds_passwd% nsslapd-maxdescriptors: 1024 nsslapd-max-filter-nest-level: 40 nsslapd-ndn-cache-enabled: off +nsslapd-sasl-mapping-fallback: off dn: cn=features,cn=config objectclass: top diff --git a/ldap/schema/01core389.ldif b/ldap/schema/01core389.ldif index d22edaab8..8a245deba 100644 --- a/ldap/schema/01core389.ldif +++ b/ldap/schema/01core389.ldif @@ -140,6 +140,7 @@ attributeTypes: ( 2.16.840.1.113730.3.1.2136 NAME 'nsds5ReplicaCleanRUVNotified' attributeTypes: ( 2.16.840.1.113730.3.1.2137 NAME 'nsds5ReplicaAbortCleanRUV' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' ) attributeTypes: ( 2.16.840.1.113730.3.1.2111 NAME 'tombstoneNumSubordinates' DESC 'count of immediate subordinates for tombstone entries' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN '389 directory server' ) attributeTypes: ( 2.16.840.1.113730.3.1.2138 NAME 'nsslapd-readonly' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' ) +attributeTypes: ( 2.16.840.1.113730.3.1.2142 NAME 'nsslapd-sasl-mapping-fallback' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' ) # # objectclasses # diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c index 3fcd8c9f4..1a414edeb 100644 --- a/ldap/servers/slapd/libglobs.c +++ b/ldap/servers/slapd/libglobs.c @@ -251,6 +251,7 @@ int init_disk_monitoring; int init_disk_logging_critical; int init_disk_preserve_logging; int init_ndn_cache_enabled; +int init_sasl_mapping_fallback; #ifdef MEMPOOL_EXPERIMENTAL int init_mempool_switch; #endif @@ -427,6 +428,11 @@ static struct config_get_and_set { NULL, 0, (void**)&global_slapdFrontendConfig.readonly, CONFIG_ON_OFF, NULL, &init_readonly}, + {CONFIG_SASL_MAPPING_FALLBACK, config_set_sasl_mapping_fallback, + NULL, 0, + (void**)&global_slapdFrontendConfig.sasl_mapping_fallback, + CONFIG_ON_OFF, (ConfigGetFunc)config_get_sasl_mapping_fallback, + &init_sasl_mapping_fallback}, {CONFIG_THREADNUMBER_ATTRIBUTE, config_set_threadnumber, NULL, 0, (void**)&global_slapdFrontendConfig.threadnumber, @@ -1441,6 +1447,8 @@ FrontendConfig_init () { init_ndn_cache_enabled = cfg->ndn_cache_enabled = LDAP_OFF; cfg->ndn_cache_max_size = NDN_DEFAULT_SIZE; cfg->ignore_vattrs = slapi_counter_new(); + cfg->sasl_mapping_fallback = slapi_counter_new(); + init_sasl_mapping_fallback = LDAP_OFF; #ifdef MEMPOOL_EXPERIMENTAL init_mempool_switch = cfg->mempool_switch = LDAP_ON; @@ -1580,6 +1588,20 @@ config_set_ignore_vattrs (const char *attrname, char *value, char *errorbuf, int return retVal; } +int +config_set_sasl_mapping_fallback (const char *attrname, char *value, char *errorbuf, int apply ) +{ + slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); + int retVal = LDAP_SUCCESS; + int val; + + retVal = config_set_onoff ( attrname, value, &val, errorbuf, apply); + if(retVal == LDAP_SUCCESS){ + slapi_counter_set_value(slapdFrontendConfig->sasl_mapping_fallback, val); + } + return retVal; +} + int config_set_disk_monitoring( const char *attrname, char *value, char *errorbuf, int apply ) { @@ -3129,7 +3151,6 @@ config_set_readonly( const char *attrname, char *value, char *errorbuf, int appl return retVal; } - int config_set_schemacheck( const char *attrname, char *value, char *errorbuf, int apply ) { int retVal = LDAP_SUCCESS; @@ -4154,6 +4175,14 @@ config_get_ignore_vattrs() return slapi_counter_get_value(slapdFrontendConfig->ignore_vattrs); } +int +config_get_sasl_mapping_fallback() +{ + slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); + + return slapi_counter_get_value(slapdFrontendConfig->sasl_mapping_fallback); +} + int config_get_disk_monitoring(){ slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h index 778b9160e..169feb33c 100644 --- a/ldap/servers/slapd/proto-slap.h +++ b/ldap/servers/slapd/proto-slap.h @@ -556,6 +556,8 @@ int config_set_allowed_sasl_mechs(const char *attrname, char *value, char *error int config_get_schemamod(); int config_set_ignore_vattrs(const char *attrname, char *value, char *errorbuf, int apply); int config_get_ignore_vattrs(); +int config_set_sasl_mapping_fallback(const char *attrname, char *value, char *errorbuf, int apply); +int config_get_sasl_mapping_fallback(); PLHashNumber hashNocaseString(const void *key); PRIntn hashNocaseCompare(const void *v1, const void *v2); diff --git a/ldap/servers/slapd/saslbind.c b/ldap/servers/slapd/saslbind.c index 6181474c7..78031dc8a 100644 --- a/ldap/servers/slapd/saslbind.c +++ b/ldap/servers/slapd/saslbind.c @@ -377,7 +377,8 @@ static Slapi_Entry *ids_sasl_user_to_entry( break; } } - if(map == NULL){ + /* break if the next map is NULL, or we are not checking all the mappings */ + if(map == NULL || !config_get_sasl_mapping_fallback()){ break; } } diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h index edb75b7c4..669c059db 100644 --- a/ldap/servers/slapd/slap.h +++ b/ldap/servers/slapd/slap.h @@ -2054,6 +2054,7 @@ typedef struct _slapdEntryPoints { #define CONFIG_NDN_CACHE_SIZE "nsslapd-ndn-cache-max-size" #define CONFIG_ALLOWED_SASL_MECHS "nsslapd-allowed-sasl-mechanisms" #define CONFIG_IGNORE_VATTRS "nsslapd-ignore-virtual-attrs" +#define CONFIG_SASL_MAPPING_FALLBACK "nsslapd-sasl-mapping-fallback" #ifdef MEMPOOL_EXPERIMENTAL #define CONFIG_MEMPOOL_SWITCH_ATTRIBUTE "nsslapd-mempool" @@ -2279,6 +2280,7 @@ typedef struct _slapdFrontendConfig { /* atomic settings */ Slapi_Counter *ignore_vattrs; + Slapi_Counter *sasl_mapping_fallback; } slapdFrontendConfig_t; /* possible values for slapdFrontendConfig_t.schemareplace */
0
e31057e2e9d724272c937e2bd082b52ed5cf3fa3
389ds/389-ds-base
Issue 50145 - Add a verbose option to the backup tools Bug description: RHDS 9 does not require a -q option to not log debugging messages. -q also suppresses the output that had been included before when doing an import. Fix description: Make -q option less verbose by removing error log messages and add -V option which enables Verbose DEBUG output. https://pagure.io/389-ds-base/issue/50145 Reviewed by: mreynolds (Thanks!)
commit e31057e2e9d724272c937e2bd082b52ed5cf3fa3 Author: Simon Pichugin <[email protected]> Date: Wed Jan 9 22:04:01 2019 +0100 Issue 50145 - Add a verbose option to the backup tools Bug description: RHDS 9 does not require a -q option to not log debugging messages. -q also suppresses the output that had been included before when doing an import. Fix description: Make -q option less verbose by removing error log messages and add -V option which enables Verbose DEBUG output. https://pagure.io/389-ds-base/issue/50145 Reviewed by: mreynolds (Thanks!) diff --git a/ldap/admin/src/scripts/bak2db.in b/ldap/admin/src/scripts/bak2db.in index 5ab454648..149229f5e 100755 --- a/ldap/admin/src/scripts/bak2db.in +++ b/ldap/admin/src/scripts/bak2db.in @@ -13,12 +13,13 @@ export SHLIB_PATH usage() { - echo "Usage: bak2db archivedir [-Z serverID] [-q] [-h]" + echo "Usage: bak2db archivedir [-Z serverID] [-q] [-V] [-h]" echo "Options:" echo " archivedir - Directory where the archived backup is located" echo " -Z serverID - Server instance identifier" echo " -q - Quiet mode - suppresses output" - echo " -h - Display usage" + echo " -V - Verbose output" + echo " -h - Display usage" } if [ $# -lt 1 ] || [ $# -gt 7 ] @@ -37,13 +38,14 @@ case $1 in ;; esac -while getopts "hn:Z:qd:vi:a:SD:" flag +while getopts "hn:Z:qVd:vi:a:SD:" flag do case $flag in h) usage exit 0;; Z) servid=$OPTARG;; q) args=$args" -q";; + V) args=$args" -V";; d) args=$args" -d \"$OPTARG\"";; v) args=$args" -v";; D) args=$args" -D \"$OPTARG\"";; diff --git a/ldap/admin/src/scripts/db2bak.in b/ldap/admin/src/scripts/db2bak.in index a13d2e2bf..a02484aeb 100755 --- a/ldap/admin/src/scripts/db2bak.in +++ b/ldap/admin/src/scripts/db2bak.in @@ -13,11 +13,12 @@ export SHLIB_PATH usage() { - echo "Usage: db2bak [archivedir] [-Z serverID] [-q] [-v] [-h]" + echo "Usage: db2bak [archivedir] [-Z serverID] [-q] [-V] [-v] [-h]" echo "Options:" echo " archivedir - Directory where the backup should be stored" echo " -Z serverID - Server instance identifier" echo " -q - Quiet mode - suppresses output" + echo " -V - Verbose output" echo " -v - Display version" echo " -h - Display usage" } @@ -36,12 +37,13 @@ then fi fi -while getopts "hqd:Z:vi:a:SD" flag +while getopts "hqVd:Z:vi:a:SD" flag do case $flag in h) usage exit 0;; q) args=$args" -q";; + V) args=$args" -V";; v) args=$args" -v";; S) args=$args" -S";; D) args=$args" -D \"$OPTARG\"";; diff --git a/ldap/admin/src/scripts/db2ldif.in b/ldap/admin/src/scripts/db2ldif.in index 95d27542a..fb9448316 100755 --- a/ldap/admin/src/scripts/db2ldif.in +++ b/ldap/admin/src/scripts/db2ldif.in @@ -16,7 +16,7 @@ cwd=`pwd` usage() { echo "Usage: db2ldif [-Z serverID] {-n backend_instance}* | {-s includesuffix}* [{-x excludesuffix}*] [-a outputfile]" - echo " [-E] [-r] [-u] [-U] [-m] [-1] [-q] [-v] [-h]" + echo " [-E] [-r] [-u] [-U] [-m] [-1] [-q] [-V] [-v] [-h]" echo "Note: either \"-n backend\" or \"-s includesuffix\" is required." echo "Options:" echo " -Z serverID - Server instance identifier" @@ -31,6 +31,7 @@ usage() echo " -m - Do not base64 encode values" echo " -1 - Do not include version text" echo " -q - Quiet mode - suppresses output" + echo " -V - Verbose output" echo " -v - Display version" echo " -h - Display usage" } @@ -99,7 +100,7 @@ then exit 1 fi -while getopts "hZ:vd:D:ENa:rs:x:CSut:n:UmMo1qc:" flag +while getopts "hZ:vd:D:ENa:rs:x:CSut:n:UmMo1qVc:" flag do case $flag in h) usage @@ -125,6 +126,7 @@ do M) args=$args" -M";; 1) args=$args" -1";; q) args=$args" -q";; + V) args=$args" -V";; c) cwd=$OPTARG;; ?) usage exit 1;; diff --git a/ldap/admin/src/scripts/ldif2db.in b/ldap/admin/src/scripts/ldif2db.in index 20c7d46d5..06a119259 100755 --- a/ldap/admin/src/scripts/ldif2db.in +++ b/ldap/admin/src/scripts/ldif2db.in @@ -14,7 +14,7 @@ export SHLIB_PATH usage() { echo "Usage: ldif2db [-Z serverID] -n backendname {-s includesuffix}* [{-x excludesuffix}*] {-i ldiffile}*" - echo " [-c chunksize] [-g [string]] [-G namespace_id] [-O] [-E] [-q] [-v] [-h]" + echo " [-c chunksize] [-g [string]] [-G namespace_id] [-O] [-E] [-q] [-V] [-v] [-h]" echo "Note: either \"-n backend\", \"-s includesuffix\", and \"-i ldiffile\" are required." echo "Options:" echo " -Z serverID - The server instance identifier" @@ -31,6 +31,7 @@ usage() echo " -O - Do not index the attributes" echo " -E - Encrypt attributes" echo " -q - Quiet mode - suppresses output" + echo " -V - Verbose output" echo " -v - Display version" echo " -h - Display usage" } @@ -53,7 +54,7 @@ handleopts() return 0 } -while getopts "Z:vhd:i:g:G:n:s:x:NOCc:St:D:Eq" flag +while getopts "Z:vhd:i:g:G:n:s:x:NOCc:St:D:EqV" flag do case $flag in h) usage @@ -76,6 +77,7 @@ do S) args=$args" -S";; O) args=$args" -O";; q) args=$args" -q";; + V) args=$args" -V";; ?) usage exit 1;; esac diff --git a/ldap/servers/slapd/main.c b/ldap/servers/slapd/main.c index d754c0f72..185ba9073 100644 --- a/ldap/servers/slapd/main.c +++ b/ldap/servers/slapd/main.c @@ -95,6 +95,7 @@ struct main_config int upgradedb_flags; int upgradednformat_dryrun; int is_quiet; + int backuptools_verbose; int dbverify_verbose; char *dbverify_dbdir; }; @@ -1299,7 +1300,7 @@ process_command_line(int argc, char **argv, struct main_config *mcfg) * */ - char *opts_db2ldif = "vd:D:ENa:rs:x:CSut:n:UmMo1q"; + char *opts_db2ldif = "vd:D:ENa:rs:x:CSut:n:UmMo1qV"; struct opt_ext long_options_db2ldif[] = { {"version", ArgNone, 'v'}, {"debug", ArgRequired, 'd'}, @@ -1319,9 +1320,10 @@ process_command_line(int argc, char **argv, struct main_config *mcfg) {"multipleOutputFile", ArgNone, 'M'}, {"noVersionNum", ArgNone, '1'}, {"quiet", ArgNone, 'q'}, + {"verbose", ArgNone, 'V'}, {0, 0, 0}}; - char *opts_ldif2db = "vd:i:g:G:n:s:x:NOCc:St:D:Eq"; + char *opts_ldif2db = "vd:i:g:G:n:s:x:NOCc:St:D:EqV"; struct opt_ext long_options_ldif2db[] = { {"version", ArgNone, 'v'}, {"debug", ArgRequired, 'd'}, @@ -1339,9 +1341,10 @@ process_command_line(int argc, char **argv, struct main_config *mcfg) {"configDir", ArgRequired, 'D'}, {"encrypt", ArgOptional, 'E'}, {"quiet", ArgNone, 'q'}, + {"verbose", ArgNone, 'V'}, {0, 0, 0}}; - char *opts_archive2db = "vd:i:a:n:SD:q"; + char *opts_archive2db = "vd:i:a:n:SD:qV"; struct opt_ext long_options_archive2db[] = { {"version", ArgNone, 'v'}, {"debug", ArgRequired, 'd'}, @@ -1351,10 +1354,11 @@ process_command_line(int argc, char **argv, struct main_config *mcfg) {"allowMultipleProcesses", ArgNone, 'S'}, {"configDir", ArgRequired, 'D'}, {"quiet", ArgNone, 'q'}, + {"verbose", ArgNone, 'V'}, {0, 0, 0}}; - char *opts_db2archive = "vd:i:a:SD:q"; + char *opts_db2archive = "vd:i:a:SD:qV"; struct opt_ext long_options_db2archive[] = { {"version", ArgNone, 'v'}, {"debug", ArgRequired, 'd'}, @@ -1363,6 +1367,7 @@ process_command_line(int argc, char **argv, struct main_config *mcfg) {"allowMultipleProcesses", ArgNone, 'S'}, {"configDir", ArgRequired, 'D'}, {"quiet", ArgNone, 'q'}, + {"verbose", ArgNone, 'V'}, {0, 0, 0}}; char *opts_db2index = "vd:a:t:T:SD:n:s:x:"; @@ -1764,9 +1769,14 @@ process_command_line(int argc, char **argv, struct main_config *mcfg) exit(1); break; - case 'V': + case 'V': /* verbose option for dbverify, db2ldif, ldif2db, db2bak, bak2db */ if (mcfg->slapd_exemode == SLAPD_EXEMODE_DBVERIFY) { mcfg->dbverify_verbose = 1; + } else if (mcfg->slapd_exemode == SLAPD_EXEMODE_LDIF2DB || + mcfg->slapd_exemode == SLAPD_EXEMODE_DB2LDIF || + mcfg->slapd_exemode == SLAPD_EXEMODE_ARCHIVE2DB || + mcfg->slapd_exemode == SLAPD_EXEMODE_DB2ARCHIVE) { + mcfg->backuptools_verbose = 1; } else { mcfg->slapd_exemode = SLAPD_EXEMODE_PRINTVERSION; } @@ -2151,7 +2161,7 @@ slapd_exemode_ldif2db(struct main_config *mcfg) plugin->plg_name); return 1; } - if (!mcfg->is_quiet) { + if (mcfg->backuptools_verbose) { slapd_ldap_debug |= LDAP_DEBUG_BACKLDBM; } if (!(slapd_ldap_debug & LDAP_DEBUG_BACKLDBM)) { @@ -2274,7 +2284,7 @@ slapd_exemode_db2ldif(int argc, char **argv, struct main_config *mcfg) return 1; } - if (!mcfg->is_quiet) { + if (mcfg->backuptools_verbose) { slapd_ldap_debug |= LDAP_DEBUG_BACKLDBM; } if (!(slapd_ldap_debug & LDAP_DEBUG_BACKLDBM)) { @@ -2530,7 +2540,7 @@ slapd_exemode_db2archive(struct main_config *mcfg) return 1; } - if (!mcfg->is_quiet) { + if (mcfg->backuptools_verbose) { slapd_ldap_debug |= LDAP_DEBUG_BACKLDBM; } if (!(slapd_ldap_debug & LDAP_DEBUG_BACKLDBM)) { @@ -2577,7 +2587,7 @@ slapd_exemode_archive2db(struct main_config *mcfg) return 1; } - if (!mcfg->is_quiet) { + if (mcfg->backuptools_verbose) { slapd_ldap_debug |= LDAP_DEBUG_BACKLDBM; } if (!(slapd_ldap_debug & LDAP_DEBUG_BACKLDBM)) {
0
b1cebedd1b2de30f7dd2885d57eaec19d445044a
389ds/389-ds-base
Bug 690584 - #10669 #10668 cl5ImportLDIF - fix coverity resource leak issues https://bugzilla.redhat.com/show_bug.cgi?id=690584 Resolves: bug 690584 Bug Description: #10669 #10668 cl5ImportLDIF - fix coverity resource leak issues Reviewed by: nhosoi (Thanks!) Branch: master Fix Description: I didn't quite follow the logic, but it looked as though maxvals and purgevals could have been re-malloced if the code allocated them and went through the loop more than once. So I changed the code to just realloc as needed (realloc NULL is the same as malloc). When building maxvals and purgevals, always NULL terminate the list so we don't have to do that later. Finally, I moved the code that cleaned up maxvals and purgevals to the end of the function so that they will always be called. Platforms tested: RHEL6 x86_64 Flag Day: no Doc impact: no
commit b1cebedd1b2de30f7dd2885d57eaec19d445044a Author: Rich Megginson <[email protected]> Date: Fri Mar 25 09:29:23 2011 -0600 Bug 690584 - #10669 #10668 cl5ImportLDIF - fix coverity resource leak issues https://bugzilla.redhat.com/show_bug.cgi?id=690584 Resolves: bug 690584 Bug Description: #10669 #10668 cl5ImportLDIF - fix coverity resource leak issues Reviewed by: nhosoi (Thanks!) Branch: master Fix Description: I didn't quite follow the logic, but it looked as though maxvals and purgevals could have been re-malloced if the code allocated them and went through the loop more than once. So I changed the code to just realloc as needed (realloc NULL is the same as malloc). When building maxvals and purgevals, always NULL terminate the list so we don't have to do that later. Finally, I moved the code that cleaned up maxvals and purgevals to the end of the function so that they will always be called. Platforms tested: RHEL6 x86_64 Flag Day: no Doc impact: no diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c index ea47d7748..88085e152 100644 --- a/ldap/servers/plugins/replication/cl5_api.c +++ b/ldap/servers/plugins/replication/cl5_api.c @@ -883,8 +883,8 @@ cl5ImportLDIF (const char *clDir, const char *ldifFile, Object **replicas) struct berval **maxvals = NULL; int purgeidx = 0; int maxidx = 0; - int maxpurgesz = 8; - int maxmaxsz = 8; + int maxpurgesz = 0; + int maxmaxsz = 0; int entryCount = 0; /* validate params */ @@ -989,26 +989,31 @@ cl5ImportLDIF (const char *clDir, const char *ldifFile, Object **replicas) struct berval type, value; int freeval = 0; - purgevals = (struct berval **)slapi_ch_malloc( - sizeof(struct berval *) * maxpurgesz); - maxvals = (struct berval **)slapi_ch_malloc( - sizeof(struct berval *) * maxmaxsz); while ((line = ldif_getline(&next)) != NULL) { rc = slapi_ldif_parse_line(line, &type, &value, &freeval); /* ruv_dump (dbfile->purgeRUV, "clpurgeruv", prFile); */ if (0 == strcasecmp (type.bv_val, "clpurgeruv")) { - if (maxpurgesz == purgeidx + 2) { - maxpurgesz *= 2; + if (maxpurgesz < purgeidx + 2) { + if (!maxpurgesz) { + maxpurgesz = 4 * (purgeidx + 2); + } else { + maxpurgesz *= 2; + } purgevals = (struct berval **)slapi_ch_realloc( (char *)purgevals, sizeof(struct berval *) * maxpurgesz); } purgevals[purgeidx++] = slapi_ch_bvdup(&value); + purgevals[purgeidx] = NULL; /* make sure NULL terminated */ } /* ruv_dump (dbfile->maxRUV, "clmaxruv", prFile); */ else if (0 == strcasecmp (type.bv_val, "clmaxruv")) { - if (maxmaxsz == maxidx + 2) { - maxmaxsz *= 2; + if (maxmaxsz < maxidx + 2) { + if (!maxmaxsz) { + maxmaxsz = 4 * (maxidx + 2); + } else { + maxmaxsz *= 2; + } maxvals = (struct berval **)slapi_ch_realloc( (char *)maxvals, sizeof(struct berval *) * maxmaxsz); @@ -1016,6 +1021,7 @@ cl5ImportLDIF (const char *clDir, const char *ldifFile, Object **replicas) /* {replica #} min_csn csn [last_modified] */ /* get rid of last_modified, if any */ maxvals[maxidx++] = slapi_ch_bvdup(&value); + maxvals[maxidx] = NULL; /* make sure NULL terminated */ } if (freeval) { slapi_ch_free_string(&value.bv_val); @@ -1096,24 +1102,13 @@ next: if (dbfile) { if (purgeidx > 0) { ruv_destroy (&dbfile->purgeRUV); - purgevals[purgeidx] = NULL; rc = ruv_init_from_bervals(purgevals, &dbfile->purgeRUV); } if (maxidx > 0) { ruv_destroy (&dbfile->maxRUV); - maxvals[maxidx] = NULL; rc = ruv_init_from_bervals(maxvals, &dbfile->maxRUV); } - for (purgeidx = 0; purgevals && purgevals[purgeidx]; purgeidx++) { - slapi_ch_bvfree(&purgevals[purgeidx]); - } - slapi_ch_free((void **)&purgevals); - for (maxidx = 0; maxvals && maxvals[maxidx]; maxidx++) { - slapi_ch_bvfree(&maxvals[maxidx]); - } - slapi_ch_free((void **)&maxvals); - dbfile->entryCount = entryCount; } if (file_obj) { @@ -1121,6 +1116,15 @@ next: } done: + for (purgeidx = 0; purgevals && purgevals[purgeidx]; purgeidx++) { + slapi_ch_bvfree(&purgevals[purgeidx]); + } + slapi_ch_free((void **)&purgevals); + for (maxidx = 0; maxvals && maxvals[maxidx]; maxidx++) { + slapi_ch_bvfree(&maxvals[maxidx]); + } + slapi_ch_free((void **)&maxvals); + if (file) { #if defined(USE_OPENLDAP) ldif_close(file);
0
dc379838f8e4cfd2c736e8c2fb8366fb3b4f73d4
389ds/389-ds-base
Ticket 367 - Invalid chaining config triggers a disk full error and shutdown Bug Description: If you use the root DN for the chaining bind DN a error -2 (LDAP_LOCAL_ERROR) is returned from the callback. This is the same error code for SLAPI_FAIL_DISKFULL. Once the error -2 is retuned, the server thinks we are out of disk space and the instance is shutdown. Fix Description: Return -1, instead of -2(LDAP_LOCAL_ERROR) https://fedorahosted.org/389/ticket/367 Note: also did a little code cleanup with indentation Reviewed by:
commit dc379838f8e4cfd2c736e8c2fb8366fb3b4f73d4 Author: Mark Reynolds <[email protected]> Date: Fri May 11 13:00:50 2012 -0400 Ticket 367 - Invalid chaining config triggers a disk full error and shutdown Bug Description: If you use the root DN for the chaining bind DN a error -2 (LDAP_LOCAL_ERROR) is returned from the callback. This is the same error code for SLAPI_FAIL_DISKFULL. Once the error -2 is retuned, the server thinks we are out of disk space and the instance is shutdown. Fix Description: Return -1, instead of -2(LDAP_LOCAL_ERROR) https://fedorahosted.org/389/ticket/367 Note: also did a little code cleanup with indentation Reviewed by: diff --git a/ldap/servers/plugins/chainingdb/cb_instance.c b/ldap/servers/plugins/chainingdb/cb_instance.c index 9a3391606..8fb694a83 100644 --- a/ldap/servers/plugins/chainingdb/cb_instance.c +++ b/ldap/servers/plugins/chainingdb/cb_instance.c @@ -511,15 +511,15 @@ int cb_instance_modify_config_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefor */ int -cb_parse_instance_config_entry(cb_backend * cb, Slapi_Entry * e) { - - int rc =LDAP_SUCCESS; - Slapi_Attr *attr = NULL; - Slapi_Value *sval; - const struct berval *attrValue; - cb_backend_instance *inst=NULL; - char *instname; - char retmsg[CB_BUFSIZE]; +cb_parse_instance_config_entry(cb_backend * cb, Slapi_Entry * e) +{ + cb_backend_instance *inst = NULL; + Slapi_Attr *attr = NULL; + Slapi_Value *sval; + const struct berval *attrValue; + char *instname; + char retmsg[CB_BUFSIZE]; + int rc = LDAP_SUCCESS; CB_ASSERT(e!=NULL); @@ -529,17 +529,17 @@ cb_parse_instance_config_entry(cb_backend * cb, Slapi_Entry * e) { */ if ( 0 == slapi_entry_attr_find( e, CB_CONFIG_INSTNAME, &attr )) { - slapi_attr_first_value(attr, &sval); - attrValue = slapi_value_get_berval(sval); - instname=attrValue->bv_val; + slapi_attr_first_value(attr, &sval); + attrValue = slapi_value_get_berval(sval); + instname = attrValue->bv_val; } else { slapi_log_error( SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "Malformed backend instance (<%s> missing)>\n", CB_CONFIG_INSTNAME); - return LDAP_LOCAL_ERROR; + return -1; } - /* Allocate a new backend internal data structure */ - inst = cb_instance_alloc(cb,instname,slapi_entry_get_dn(e)); + /* Allocate a new backend internal data structure */ + inst = cb_instance_alloc(cb,instname,slapi_entry_get_dn(e)); /* Emulate a add config entry to configure */ /* this backend instance. */ @@ -556,99 +556,96 @@ cb_parse_instance_config_entry(cb_backend * cb, Slapi_Entry * e) { */ static int -cb_instance_config_initialize(cb_backend_instance * inst, Slapi_Entry * e , int phase, int apply) { - - int rc =LDAP_SUCCESS; - Slapi_Attr *attr = NULL; - Slapi_Value *sval; - struct berval * bval; - int using_def_connlifetime,i; - char err_buf[SLAPI_DSE_RETURNTEXT_SIZE]; - int urlfound=0; - char *rootdn; +cb_instance_config_initialize(cb_backend_instance * inst, Slapi_Entry * e , int phase, int apply) +{ + Slapi_Attr *attr = NULL; + Slapi_Value *sval; + Slapi_DN *suffix; + struct berval *bval; + char err_buf[SLAPI_DSE_RETURNTEXT_SIZE]; + char *attr_name = NULL; + char *rootdn; + int using_def_connlifetime, i; + int urlfound = 0; + int rc = LDAP_SUCCESS; using_def_connlifetime=1; - for (slapi_entry_first_attr(e, &attr); attr; slapi_entry_next_attr(e, attr, &attr)) { - char * attr_name=NULL; - slapi_attr_get_type(attr, &attr_name); + for (slapi_entry_first_attr(e, &attr); attr; slapi_entry_next_attr(e, attr, &attr)) { + attr_name = NULL; + slapi_attr_get_type(attr, &attr_name); if ( !strcasecmp ( attr_name, CB_CONFIG_SUFFIX )) { if (apply && ( inst->inst_be != NULL )) { - Slapi_DN *suffix; suffix = slapi_sdn_new(); - i = slapi_attr_first_value(attr, &sval); - while (i != -1 ) { - bval = (struct berval *) slapi_value_get_berval(sval); - slapi_sdn_set_dn_byref(suffix, bval->bv_val); - - if (!slapi_be_issuffix(inst->inst_be, suffix)) { - slapi_be_addsuffix(inst->inst_be, suffix); - } - i = slapi_attr_next_value(attr, i, &sval); - } + i = slapi_attr_first_value(attr, &sval); + while (i != -1 ) { + bval = (struct berval *) slapi_value_get_berval(sval); + slapi_sdn_set_dn_byref(suffix, bval->bv_val); + + if (!slapi_be_issuffix(inst->inst_be, suffix)) { + slapi_be_addsuffix(inst->inst_be, suffix); + } + i = slapi_attr_next_value(attr, i, &sval); + } slapi_sdn_free(&suffix); } - continue; - } else - if ( !strcasecmp ( attr_name, CB_CONFIG_CHAINING_COMPONENTS )) { - - if (apply) { - slapi_rwlock_wrlock(inst->rwl_config_lock); - i = slapi_attr_first_value(attr, &sval); + continue; + } else if ( !strcasecmp ( attr_name, CB_CONFIG_CHAINING_COMPONENTS )) { + if (apply) { + slapi_rwlock_wrlock(inst->rwl_config_lock); + i = slapi_attr_first_value(attr, &sval); charray_free(inst->chaining_components); inst->chaining_components=NULL; - while (i != -1 ) { - bval = (struct berval *) slapi_value_get_berval(sval); + while (i != -1 ) { + bval = (struct berval *) slapi_value_get_berval(sval); charray_add(&inst->chaining_components, - slapi_dn_normalize(slapi_ch_strdup(bval->bv_val))); - i = slapi_attr_next_value(attr, i, &sval); - } - slapi_rwlock_unlock(inst->rwl_config_lock); - } - continue; - } else - if ( !strcasecmp ( attr_name, CB_CONFIG_ILLEGAL_ATTRS )) { - - if (apply) { - slapi_rwlock_wrlock(inst->rwl_config_lock); - i = slapi_attr_first_value(attr, &sval); + slapi_dn_normalize(slapi_ch_strdup(bval->bv_val))); + i = slapi_attr_next_value(attr, i, &sval); + } + slapi_rwlock_unlock(inst->rwl_config_lock); + } + continue; + } else if ( !strcasecmp ( attr_name, CB_CONFIG_ILLEGAL_ATTRS )) { + if (apply) { + slapi_rwlock_wrlock(inst->rwl_config_lock); + i = slapi_attr_first_value(attr, &sval); charray_free(inst->illegal_attributes); inst->illegal_attributes=NULL; - while (i != -1 ) { - bval = (struct berval *) slapi_value_get_berval(sval); + while (i != -1 ) { + bval = (struct berval *) slapi_value_get_berval(sval); charray_add(&inst->illegal_attributes, - slapi_ch_strdup(bval->bv_val)); - i = slapi_attr_next_value(attr, i, &sval); - } - slapi_rwlock_unlock(inst->rwl_config_lock); - } - continue; + slapi_ch_strdup(bval->bv_val)); + i = slapi_attr_next_value(attr, i, &sval); + } + slapi_rwlock_unlock(inst->rwl_config_lock); + } + continue; } if ( !strcasecmp ( attr_name, CB_CONFIG_HOSTURL )) { urlfound=1; } - - /* We are assuming that each of these attributes are to have - * only one value. If they have more than one value, like - * the nsslapd-suffix attribute, then they need to be - * handled differently. */ + /* + * We are assuming that each of these attributes are to have + * only one value. If they have more than one value, like + * the nsslapd-suffix attribute, then they need to be + * handled differently. + */ - slapi_attr_first_value(attr, &sval); - bval = (struct berval *) slapi_value_get_berval(sval); - - if (cb_instance_config_set((void *) inst, attr_name, + slapi_attr_first_value(attr, &sval); + bval = (struct berval *) slapi_value_get_berval(sval); + + if (cb_instance_config_set((void *) inst, attr_name, cb_the_instance_config, bval, err_buf, phase, apply ) != LDAP_SUCCESS) { - slapi_log_error( SLAPI_LOG_FATAL, - CB_PLUGIN_SUBSYSTEM,"Error with config attribute %s : %s\n", + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM,"Error with config attribute %s : %s\n", attr_name, err_buf); - rc=LDAP_LOCAL_ERROR; - break; - } - if ( !strcasecmp ( attr_name, CB_CONFIG_CONNLIFETIME )) { + rc = -1; + break; + } + if ( !strcasecmp ( attr_name, CB_CONFIG_CONNLIFETIME )) { using_def_connlifetime=0; } } @@ -661,20 +658,17 @@ cb_instance_config_initialize(cb_backend_instance * inst, Slapi_Entry * e , int if (LDAP_SUCCESS == rc) { if (!urlfound) { - slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, - "Malformed backend instance entry. Mandatory attr <%s> missing\n", - CB_CONFIG_HOSTURL); - rc= LDAP_LOCAL_ERROR; + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "Malformed backend instance entry. Mandatory attr <%s> missing\n",CB_CONFIG_HOSTURL); + rc = -1; } if (apply ) { - if ( using_def_connlifetime && - strchr( inst->pool->hostname, ' ' ) != NULL ) { - - cb_instance_config_set((void *)inst, CB_CONFIG_CONNLIFETIME, - cb_the_instance_config, NULL /* use default */, err_buf, + if ( using_def_connlifetime && strchr( inst->pool->hostname, ' ' ) != NULL ) { + cb_instance_config_set((void *)inst, CB_CONFIG_CONNLIFETIME, + cb_the_instance_config, NULL /* use default */, err_buf, CB_CONFIG_PHASE_INITIALIZATION, 1 ); - } + } } } @@ -683,15 +677,13 @@ cb_instance_config_initialize(cb_backend_instance * inst, Slapi_Entry * e , int ** It is forbidden to use directory manager as proxy user ** due to a bug in the acl check */ - - rootdn=cb_get_rootdn(); + rootdn = cb_get_rootdn(); if (inst->impersonate && inst->pool && inst->pool->binddn && !strcmp(inst->pool->binddn,rootdn)) { /* UTF8 aware */ - slapi_log_error( SLAPI_LOG_FATAL, - CB_PLUGIN_SUBSYSTEM,"Error with config attribute %s (%s: forbidden value)\n", - CB_CONFIG_BINDUSER, rootdn); - rc=LDAP_LOCAL_ERROR; + slapi_log_error( SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM, + "Error with config attribute %s (%s: forbidden value)\n", CB_CONFIG_BINDUSER, rootdn); + rc= -1; } slapi_ch_free((void **)&rootdn); @@ -1494,7 +1486,7 @@ struct berval *bval, char *err_buf, int phase, int apply_mod) int use_default; int int_val; long long_val; - int retval=LDAP_LOCAL_ERROR; + int retval = -1; config = cb_get_config_info(config_array, attr_name); if (NULL == config) {
0
4b520bfed95c10ecf9239f7a42f3fb38b673d203
389ds/389-ds-base
Bug 561575 - setup-ds-admin fails to supply nsds5ReplicaName when configuring via ConfigFile https://bugzilla.redhat.com/show_bug.cgi?id=561575 Resolves: bug 561575 Bug Description: setup-ds-admin fails to supply nsds5ReplicaName when configuring via ConfigFile Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: The main problem was that the mod val was a berval, so we needed |LDAP_MOD_BVALUES for the mod_op. The other problem is that the mod and values were being used out of scope. While this seems to work, it's better to make sure all of the values are in scope. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
commit 4b520bfed95c10ecf9239f7a42f3fb38b673d203 Author: Rich Megginson <[email protected]> Date: Fri Apr 2 17:38:57 2010 -0600 Bug 561575 - setup-ds-admin fails to supply nsds5ReplicaName when configuring via ConfigFile https://bugzilla.redhat.com/show_bug.cgi?id=561575 Resolves: bug 561575 Bug Description: setup-ds-admin fails to supply nsds5ReplicaName when configuring via ConfigFile Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: The main problem was that the mod val was a berval, so we needed |LDAP_MOD_BVALUES for the mod_op. The other problem is that the mod and values were being used out of scope. While this seems to work, it's better to make sure all of the values are in scope. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c index a563835a6..f669900f4 100644 --- a/ldap/servers/plugins/replication/repl5_replica.c +++ b/ldap/servers/plugins/replication/repl5_replica.c @@ -2104,6 +2104,9 @@ _replica_update_state (time_t when, void *arg) LDAPMod *mods[3]; Slapi_PBlock *pb = NULL; char *dn = NULL; + struct berval *vals[2]; + struct berval val; + LDAPMod mod; if (NULL == replica_name) return; @@ -2173,13 +2176,9 @@ _replica_update_state (time_t when, void *arg) /* write replica name if it has not been written before */ if (r->new_name) { - struct berval *vals[2]; - struct berval val; - LDAPMod mod; - mods[1] = &mod; - mod.mod_op = LDAP_MOD_REPLACE; + mod.mod_op = LDAP_MOD_REPLACE|LDAP_MOD_BVALUES; mod.mod_type = (char*)attr_replicaName; mod.mod_bvalues = vals; vals [0] = &val;
0