ldap/admin
by Richard Allen Megginson
ldap/admin/src/logconv.pl | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
New commits:
commit 9813b219ad2aa7b7194d9295dd529e12889a8534
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Wed Apr 24 11:44:40 2013 -0600
Ticket #47348 - add etimes to per second/minute stats
https://fedorahosted.org/389/ticket/47348
Reviewed by: mreynolds (Thanks!)
Branch: master
Fix Description: Add an "ElapsedTime" column to the -m/-M output. This column
is the cumulative etimes of all operations during that time period.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: yes
diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
index 3b8adc5..efc5970 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -2042,7 +2042,7 @@ sub parseLineNormal
if ($1 ne "0"){ $errorCount++;}
else { $successCount++;}
}
- if ($_ =~ /etime= *([0-9.]+)/ ) { writeFile($ETIME, $1);}
+ if ($_ =~ /etime= *([0-9.]+)/ ) { writeFile($ETIME, $1); inc_stats_val('etime',$1,$s_stats,$m_stats); }
if ($_ =~ / tag=101 / || $_ =~ / tag=111 / || $_ =~ / tag=100 / || $_ =~ / tag=115 /){
if ($_ =~ / nentries= *([0-9]+)/i ){ writeFile($NENTRIES, $1); }
}
@@ -2197,6 +2197,7 @@ reset_stats_block
$stats->{'anonbind'}=0;
$stats->{'unbind'}=0;
$stats->{'notesu'}=0;
+ $stats->{'etime'}=0;
return;
}
@@ -2241,12 +2242,13 @@ print_stats_block
$stats->{'bind'},
$stats->{'anonbind'},
$stats->{'unbind'},
- $stats->{'notesu'} ),
+ $stats->{'notesu'},
+ $stats->{'etime'}),
"\n" );
} else {
$stats->{'fh'}->print(
"Time,time_t,Results,Search,Add,Mod,Modrdn,Moddn,Compare,Delete,Abandon,".
- "Connections,SSL Conns,Bind,Anon Bind,Unbind,Unindexed\n"
+ "Connections,SSL Conns,Bind,Anon Bind,Unbind,Unindexed,ElapsedTime\n"
);
}
}
@@ -2265,6 +2267,20 @@ inc_stats
return;
}
+# like inc_stats, but increments the block counter with the given value e.g.
+# 'statname1', val, statblock1, statblock2, ...
+sub
+inc_stats_val
+{
+ my $n = shift;
+ my $val = shift;
+ foreach(@_){
+ $_->{$n} += $val
+ if exists $_->{$n};
+ }
+ return;
+}
+
sub
displayBindReport
{
11 years
Branch '389-ds-base-1.3.1' - ldap/admin
by Richard Allen Megginson
ldap/admin/src/logconv.pl | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
New commits:
commit c3c51142c341de91b9b4ebdf56f63c177c533528
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Wed Apr 24 11:44:40 2013 -0600
Ticket #47348 - add etimes to per second/minute stats
https://fedorahosted.org/389/ticket/47348
Reviewed by: mreynolds (Thanks!)
Branch: 389-ds-base-1.3.1
Fix Description: Add an "ElapsedTime" column to the -m/-M output. This column
is the cumulative etimes of all operations during that time period.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: yes
(cherry picked from commit 9813b219ad2aa7b7194d9295dd529e12889a8534)
diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
index 3b8adc5..efc5970 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -2042,7 +2042,7 @@ sub parseLineNormal
if ($1 ne "0"){ $errorCount++;}
else { $successCount++;}
}
- if ($_ =~ /etime= *([0-9.]+)/ ) { writeFile($ETIME, $1);}
+ if ($_ =~ /etime= *([0-9.]+)/ ) { writeFile($ETIME, $1); inc_stats_val('etime',$1,$s_stats,$m_stats); }
if ($_ =~ / tag=101 / || $_ =~ / tag=111 / || $_ =~ / tag=100 / || $_ =~ / tag=115 /){
if ($_ =~ / nentries= *([0-9]+)/i ){ writeFile($NENTRIES, $1); }
}
@@ -2197,6 +2197,7 @@ reset_stats_block
$stats->{'anonbind'}=0;
$stats->{'unbind'}=0;
$stats->{'notesu'}=0;
+ $stats->{'etime'}=0;
return;
}
@@ -2241,12 +2242,13 @@ print_stats_block
$stats->{'bind'},
$stats->{'anonbind'},
$stats->{'unbind'},
- $stats->{'notesu'} ),
+ $stats->{'notesu'},
+ $stats->{'etime'}),
"\n" );
} else {
$stats->{'fh'}->print(
"Time,time_t,Results,Search,Add,Mod,Modrdn,Moddn,Compare,Delete,Abandon,".
- "Connections,SSL Conns,Bind,Anon Bind,Unbind,Unindexed\n"
+ "Connections,SSL Conns,Bind,Anon Bind,Unbind,Unindexed,ElapsedTime\n"
);
}
}
@@ -2265,6 +2267,20 @@ inc_stats
return;
}
+# like inc_stats, but increments the block counter with the given value e.g.
+# 'statname1', val, statblock1, statblock2, ...
+sub
+inc_stats_val
+{
+ my $n = shift;
+ my $val = shift;
+ foreach(@_){
+ $_->{$n} += $val
+ if exists $_->{$n};
+ }
+ return;
+}
+
sub
displayBindReport
{
11 years
ldap/servers
by Mark Reynolds
ldap/servers/slapd/ldaputil.c | 373 ++++++++++++++++++++--------------------
ldap/servers/slapd/libglobs.c | 35 +++
ldap/servers/slapd/proto-slap.h | 3
ldap/servers/slapd/slap.h | 2
4 files changed, 226 insertions(+), 187 deletions(-)
New commits:
commit 7c8c32e4b4f6adcdf6941f33472826b9c7632c54
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Apr 24 14:16:18 2013 -0400
Ticket 47317 - should set LDAP_OPT_X_SASL_NOCANON to LDAP_OPT_ON by default
Bug Description: DS should avoid doing DNS reverse lookups for outgoing connections.
Fix Description: LDAP_OPT_X_SASL_NOCANON is now a configurable option, which is "on"
by default.
Also did code cleanup of slapi_ldap_init_ext()
https://fedorahosted.org/389/ticket/47317
Reviewed by: nhosoi(Thanks!)
diff --git a/ldap/servers/slapd/ldaputil.c b/ldap/servers/slapd/ldaputil.c
index 5ac2fdd..c0c4511 100644
--- a/ldap/servers/slapd/ldaputil.c
+++ b/ldap/servers/slapd/ldaputil.c
@@ -696,42 +696,40 @@ slapi_ldap_init_ext(
}
if ('\0' == util_sasl_path[0] || /* first time */
NULL == (pp = strchr(util_sasl_path, '=')) || /* invalid arg for putenv */
- (0 != strcmp(++pp, pluginpath)) /* sasl_path has been updated */ ) {
- PR_snprintf(util_sasl_path, sizeof(util_sasl_path),
- "SASL_PATH=%s", pluginpath);
- slapi_log_error(SLAPI_LOG_SHELL, "slapi_ldap_init_ext",
- "putenv(%s)\n", util_sasl_path);
+ (0 != strcmp(++pp, pluginpath)) /* sasl_path has been updated */ )
+ {
+ PR_snprintf(util_sasl_path, sizeof(util_sasl_path), "SASL_PATH=%s", pluginpath);
+ slapi_log_error(SLAPI_LOG_SHELL, "slapi_ldap_init_ext", "putenv(%s)\n", util_sasl_path);
putenv(util_sasl_path);
}
slapi_ch_free_string(&configpluginpath);
/* if ldapurl is given, parse it */
- if (ldapurl && ((rc = slapi_ldap_url_parse(ldapurl, &ludp, 0, &secureurl)) ||
- !ludp)) {
- slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
- "Could not parse given LDAP URL [%s] : error [%s]\n",
- ldapurl, /* ldapurl cannot be NULL here */
- slapi_urlparse_err2string(rc));
- goto done;
+ if (ldapurl && ((rc = slapi_ldap_url_parse(ldapurl, &ludp, 0, &secureurl)) || !ludp)) {
+ slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
+ "Could not parse given LDAP URL [%s] : error [%s]\n",
+ ldapurl, /* ldapurl cannot be NULL here */
+ slapi_urlparse_err2string(rc));
+ goto done;
}
/* use url host if no host given */
if (!hostname && ludp && ludp->lud_host) {
- hostname = ludp->lud_host;
+ hostname = ludp->lud_host;
}
/* use url port if no port given */
if (!port && ludp && ludp->lud_port) {
- port = ludp->lud_port;
+ port = ludp->lud_port;
}
/* use secure setting from url if none given */
if (!secure && ludp) {
- if (secureurl) {
- secure = 1;
- } else if (0/* starttls option - not supported yet in LDAP URLs */) {
- secure = 2;
- }
+ if (secureurl) {
+ secure = 1;
+ } else if (0/* starttls option - not supported yet in LDAP URLs */) {
+ secure = 2;
+ }
}
/* ldap_url_parse doesn't yet handle ldapi */
@@ -743,14 +741,14 @@ slapi_ldap_init_ext(
#ifdef MEMPOOL_EXPERIMENTAL
{
- /*
- * slapi_ch_malloc functions need to be set to LDAP C SDK
- */
- struct ldap_memalloc_fns memalloc_fns;
- memalloc_fns.ldapmem_malloc = (LDAP_MALLOC_CALLBACK *)slapi_ch_malloc;
- memalloc_fns.ldapmem_calloc = (LDAP_CALLOC_CALLBACK *)slapi_ch_calloc;
- memalloc_fns.ldapmem_realloc = (LDAP_REALLOC_CALLBACK *)slapi_ch_realloc;
- memalloc_fns.ldapmem_free = (LDAP_FREE_CALLBACK *)_free_wrapper;
+ /*
+ * slapi_ch_malloc functions need to be set to LDAP C SDK
+ */
+ struct ldap_memalloc_fns memalloc_fns;
+ memalloc_fns.ldapmem_malloc = (LDAP_MALLOC_CALLBACK *)slapi_ch_malloc;
+ memalloc_fns.ldapmem_calloc = (LDAP_CALLOC_CALLBACK *)slapi_ch_calloc;
+ memalloc_fns.ldapmem_realloc = (LDAP_REALLOC_CALLBACK *)slapi_ch_realloc;
+ memalloc_fns.ldapmem_free = (LDAP_FREE_CALLBACK *)_free_wrapper;
}
/*
* MEMPOOL_EXPERIMENTAL:
@@ -766,198 +764,203 @@ slapi_ldap_init_ext(
#if defined(USE_OPENLDAP)
if (ldapurl) {
- if (PR_SUCCESS != PR_CallOnce(&ol_init_callOnce, internal_ol_init_init)) {
- slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
- "Could not perform internal ol_init init\n");
- rc = -1;
- goto done;
- }
+ if (PR_SUCCESS != PR_CallOnce(&ol_init_callOnce, internal_ol_init_init)) {
+ slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
+ "Could not perform internal ol_init init\n");
+ rc = -1;
+ goto done;
+ }
- PR_Lock(ol_init_lock);
- rc = ldap_initialize(&ld, ldapurl);
- PR_Unlock(ol_init_lock);
- if (rc) {
- slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
- "Could not initialize LDAP connection to [%s]: %d:%s\n",
- ldapurl, rc, ldap_err2string(rc));
- goto done;
- }
+ PR_Lock(ol_init_lock);
+ rc = ldap_initialize(&ld, ldapurl);
+ PR_Unlock(ol_init_lock);
+ if (rc) {
+ slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
+ "Could not initialize LDAP connection to [%s]: %d:%s\n",
+ ldapurl, rc, ldap_err2string(rc));
+ goto done;
+ }
} else {
- char *makeurl = NULL;
- if (filename) {
- makeurl = slapi_ch_smprintf("ldapi://%s/", filename);
- } else { /* host port */
- makeurl = convert_to_openldap_uri(hostname, port, (secure == 1 ? "ldaps" : "ldap"));
- }
- if (PR_SUCCESS != PR_CallOnce(&ol_init_callOnce, internal_ol_init_init)) {
- slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
- "Could not perform internal ol_init init\n");
- rc = -1;
- goto done;
- }
+ char *makeurl = NULL;
- PR_Lock(ol_init_lock);
- rc = ldap_initialize(&ld, makeurl);
- PR_Unlock(ol_init_lock);
- if (rc) {
- slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
- "Could not initialize LDAP connection to [%s]: %d:%s\n",
- makeurl, rc, ldap_err2string(rc));
- slapi_ch_free_string(&makeurl);
- goto done;
- }
- slapi_ch_free_string(&makeurl);
+ if (filename) {
+ makeurl = slapi_ch_smprintf("ldapi://%s/", filename);
+ } else { /* host port */
+ makeurl = convert_to_openldap_uri(hostname, port, (secure == 1 ? "ldaps" : "ldap"));
+ }
+ if (PR_SUCCESS != PR_CallOnce(&ol_init_callOnce, internal_ol_init_init)) {
+ slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
+ "Could not perform internal ol_init init\n");
+ rc = -1;
+ goto done;
+ }
+
+ PR_Lock(ol_init_lock);
+ rc = ldap_initialize(&ld, makeurl);
+ PR_Unlock(ol_init_lock);
+ if (rc) {
+ slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
+ "Could not initialize LDAP connection to [%s]: %d:%s\n",
+ makeurl, rc, ldap_err2string(rc));
+ slapi_ch_free_string(&makeurl);
+ goto done;
+ }
+ slapi_ch_free_string(&makeurl);
+ }
+
+ if(config_get_connection_nocanon()){
+ /*
+ * The NONCANON flag tells openldap to use the hostname specified in
+ * the ldap_initialize command, rather than looking up the
+ * hostname using gethostname or similar - this allows running
+ * sasl/gssapi tests on machines that don't have a canonical
+ * hostname (such as localhost.localdomain).
+ */
+ if((rc = ldap_set_option(ld, LDAP_OPT_X_SASL_NOCANON, LDAP_OPT_ON))){
+ slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
+ "Could not set ldap option LDAP_OPT_X_SASL_NOCANON for (%s), error %d (%s)\n",
+ ldapurl, rc, ldap_err2string(rc) );
+ }
}
#else /* !USE_OPENLDAP */
if (filename) {
- /* ldapi in mozldap client is not yet supported */
+ /* ldapi in mozldap client is not yet supported */
} else if (secure == 1) {
- ld = ldapssl_init(hostname, port, secure);
+ ld = ldapssl_init(hostname, port, secure);
} else { /* regular ldap and/or starttls */
- /*
- * Leverage the libprldap layer to take care of all the NSPR
- * integration.
- * Note that ldapssl_init() uses libprldap implicitly.
- */
- ld = prldap_init(hostname, port, shared);
+ /*
+ * Leverage the libprldap layer to take care of all the NSPR
+ * integration.
+ * Note that ldapssl_init() uses libprldap implicitly.
+ */
+ ld = prldap_init(hostname, port, shared);
}
#endif /* !USE_OPENLDAP */
/* must explicitly set version to 3 */
ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &ldap_version3);
-#if defined(USE_OPENLDAP)
- if (getenv("HACK_SASL_NOCANON")) {
- /* the NONCANON flag tells openldap to use the hostname specified in
- the ldap_initialize command, rather than looking up the
- hostname using gethostname or similar - this allows running
- sasl/gssapi tests on machines that don't have a canonical
- hostname (such as localhost.localdomain)
- */
- ldap_set_option(ld, LDAP_OPT_X_SASL_NOCANON, LDAP_OPT_ON);
- }
-#endif /* !USE_OPENLDAP */
/* Update snmp interaction table */
if (hostname) {
- if (ld == NULL) {
- set_snmp_interaction_row((char *)hostname, port, -1);
- } else {
- set_snmp_interaction_row((char *)hostname, port, 0);
- }
+ if (ld == NULL) {
+ set_snmp_interaction_row((char *)hostname, port, -1);
+ } else {
+ set_snmp_interaction_row((char *)hostname, port, 0);
+ }
}
if ((ld != NULL) && !filename) {
- /*
- * Set the outbound LDAP I/O timeout based on the server config.
- */
- int io_timeout_ms = config_get_outbound_ldap_io_timeout();
- if (io_timeout_ms > 0) {
+ /*
+ * Set the outbound LDAP I/O timeout based on the server config.
+ */
+ int io_timeout_ms = config_get_outbound_ldap_io_timeout();
+
+ if (io_timeout_ms > 0) {
#if defined(USE_OPENLDAP)
- struct timeval tv;
- tv.tv_sec = io_timeout_ms / 1000;
- tv.tv_usec = (io_timeout_ms % 1000) * 1000;
- if (LDAP_OPT_SUCCESS != ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &tv)) {
- slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
- "failed: unable to set outbound I/O "
- "timeout to %dms\n",
- io_timeout_ms);
- slapi_ldap_unbind(ld);
- ld = NULL;
- goto done;
- }
+ struct timeval tv;
+
+ tv.tv_sec = io_timeout_ms / 1000;
+ tv.tv_usec = (io_timeout_ms % 1000) * 1000;
+ if (LDAP_OPT_SUCCESS != ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &tv)) {
+ slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
+ "failed: unable to set outbound I/O timeout to %dms\n", io_timeout_ms);
+ slapi_ldap_unbind(ld);
+ ld = NULL;
+ goto done;
+ }
#else /* !USE_OPENLDAP */
- if (prldap_set_session_option(ld, NULL, PRLDAP_OPT_IO_MAX_TIMEOUT,
- io_timeout_ms) != LDAP_SUCCESS) {
- slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
- "failed: unable to set outbound I/O "
- "timeout to %dms\n",
- io_timeout_ms);
- slapi_ldap_unbind(ld);
- ld = NULL;
- goto done;
- }
+ if (prldap_set_session_option(ld, NULL, PRLDAP_OPT_IO_MAX_TIMEOUT, io_timeout_ms) != LDAP_SUCCESS) {
+ slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
+ "failed: unable to set outbound I/O timeout to %dms\n", io_timeout_ms);
+ slapi_ldap_unbind(ld);
+ ld = NULL;
+ goto done;
+ }
#endif /* !USE_OPENLDAP */
- }
+ }
- /*
- * Set SSL strength (server certificate validity checking).
- */
- if (secure > 0) {
+ /*
+ * Set SSL strength (server certificate validity checking).
+ */
+ if (secure > 0) {
#if defined(USE_OPENLDAP)
- if (setup_ol_tls_conn(ld, 0)) {
- slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
- "failed: unable to set SSL/TLS options\n");
- }
+ if (setup_ol_tls_conn(ld, 0)) {
+ slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
+ "failed: unable to set SSL/TLS options\n");
+ }
#else
- int ssl_strength = 0;
- LDAP *myld = NULL;
-
- /* we can only use the set functions below with a real
- LDAP* if it has already gone through ldapssl_init -
- so, use NULL if using starttls */
- if (secure == 1) {
- myld = ld;
- }
-
- if (config_get_ssl_check_hostname()) {
- /* check hostname against name in certificate */
- ssl_strength = LDAPSSL_AUTH_CNCHECK;
- } else {
- /* verify certificate only */
- ssl_strength = LDAPSSL_AUTH_CERT;
- }
-
- if ((rc = ldapssl_set_strength(myld, ssl_strength)) ||
- (rc = ldapssl_set_option(myld, SSL_ENABLE_SSL2, PR_FALSE)) ||
- (rc = ldapssl_set_option(myld, SSL_ENABLE_SSL3, PR_TRUE)) ||
- (rc = ldapssl_set_option(myld, SSL_ENABLE_TLS, PR_TRUE))) {
- int prerr = PR_GetError();
+ int ssl_strength = 0;
+ LDAP *myld = NULL;
+
+ /*
+ * We can only use the set functions below with a real
+ * LDAP* if it has already gone through ldapssl_init -
+ * so, use NULL if using starttls
+ */
+ if (secure == 1) {
+ myld = ld;
+ }
- slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
- "failed: unable to set SSL options ("
- SLAPI_COMPONENT_NAME_NSPR " error %d - %s)\n",
- prerr, slapd_pr_strerror(prerr));
+ if (config_get_ssl_check_hostname()) {
+ /* check hostname against name in certificate */
+ ssl_strength = LDAPSSL_AUTH_CNCHECK;
+ } else {
+ /* verify certificate only */
+ ssl_strength = LDAPSSL_AUTH_CERT;
+ }
- }
- if (secure == 1) {
- /* tell bind code we are using SSL */
- ldap_set_option(ld, LDAP_OPT_SSL, LDAP_OPT_ON);
- }
+ if ((rc = ldapssl_set_strength(myld, ssl_strength)) ||
+ (rc = ldapssl_set_option(myld, SSL_ENABLE_SSL2, PR_FALSE)) ||
+ (rc = ldapssl_set_option(myld, SSL_ENABLE_SSL3, PR_TRUE)) ||
+ (rc = ldapssl_set_option(myld, SSL_ENABLE_TLS, PR_TRUE)))
+ {
+ int prerr = PR_GetError();
+
+ slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
+ "failed: unable to set SSL options ("
+ SLAPI_COMPONENT_NAME_NSPR " error %d - %s)\n",
+ prerr, slapd_pr_strerror(prerr));
+ }
+ if (secure == 1) {
+ /* tell bind code we are using SSL */
+ ldap_set_option(ld, LDAP_OPT_SSL, LDAP_OPT_ON);
+ }
#endif /* !USE_OPENLDAP */
- }
+ }
}
if (ld && (secure == 2)) {
- /* We don't have a way to stash context data with the LDAP*, so we
- stash the information in the client controls (currently unused).
- We don't want to open the connection in ldap_init, since that's
- not the semantic - the connection is not usually opened until
- the first operation is sent, which is usually the bind - or
- in this case, the start_tls - so we stash the start_tls so
- we can do it in slapi_ldap_bind - note that this will get
- cleaned up when the LDAP* is disposed of
- */
- LDAPControl start_tls_dummy_ctrl;
- LDAPControl **clientctrls = NULL;
-
- /* returns copy of controls */
- ldap_get_option(ld, LDAP_OPT_CLIENT_CONTROLS, &clientctrls);
-
- start_tls_dummy_ctrl.ldctl_oid = START_TLS_OID;
- start_tls_dummy_ctrl.ldctl_value.bv_val = NULL;
- start_tls_dummy_ctrl.ldctl_value.bv_len = 0;
- start_tls_dummy_ctrl.ldctl_iscritical = 0;
- slapi_add_control_ext(&clientctrls, &start_tls_dummy_ctrl, 1);
- /* set option frees old list and copies the new list */
- ldap_set_option(ld, LDAP_OPT_CLIENT_CONTROLS, clientctrls);
- ldap_controls_free(clientctrls); /* free the copy */
+ /*
+ * We don't have a way to stash context data with the LDAP*, so we
+ * stash the information in the client controls (currently unused).
+ * We don't want to open the connection in ldap_init, since that's
+ * not the semantic - the connection is not usually opened until
+ * the first operation is sent, which is usually the bind - or
+ * in this case, the start_tls - so we stash the start_tls so
+ * we can do it in slapi_ldap_bind - note that this will get
+ * cleaned up when the LDAP* is disposed of
+ */
+ LDAPControl start_tls_dummy_ctrl;
+ LDAPControl **clientctrls = NULL;
+
+ /* returns copy of controls */
+ ldap_get_option(ld, LDAP_OPT_CLIENT_CONTROLS, &clientctrls);
+
+ start_tls_dummy_ctrl.ldctl_oid = START_TLS_OID;
+ start_tls_dummy_ctrl.ldctl_value.bv_val = NULL;
+ start_tls_dummy_ctrl.ldctl_value.bv_len = 0;
+ start_tls_dummy_ctrl.ldctl_iscritical = 0;
+ slapi_add_control_ext(&clientctrls, &start_tls_dummy_ctrl, 1);
+ /* set option frees old list and copies the new list */
+ ldap_set_option(ld, LDAP_OPT_CLIENT_CONTROLS, clientctrls);
+ ldap_controls_free(clientctrls); /* free the copy */
}
slapi_log_error(SLAPI_LOG_SHELL, "slapi_ldap_init_ext",
- "Success: set up conn to [%s:%d]%s\n",
- hostname, port,
- (secure == 2) ? " using startTLS" :
- ((secure == 1) ? " using SSL" : ""));
+ "Success: set up conn to [%s:%d]%s\n",
+ hostname, port,
+ (secure == 2) ? " using startTLS" :
+ ((secure == 1) ? " using SSL" : ""));
done:
ldap_free_urldesc(ludp);
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index 10e0e7c..d3a3497 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -258,6 +258,7 @@ 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;
+slapi_onoff_t init_connection_nocanon;
slapi_int_t init_connection_buffer;
#ifdef MEMPOOL_EXPERIMENTAL
slapi_onoff_t init_mempool_switch;
@@ -1058,7 +1059,11 @@ static struct config_get_and_set {
{CONFIG_CONNECTION_BUFFER, config_set_connection_buffer,
NULL, 0,
(void**)&global_slapdFrontendConfig.connection_buffer,
- CONFIG_INT, (ConfigGetFunc)config_get_connection_buffer, &init_connection_buffer}
+ CONFIG_INT, (ConfigGetFunc)config_get_connection_buffer, &init_connection_buffer},
+ {CONFIG_CONNECTION_NOCANON, config_set_connection_nocanon,
+ NULL, 0,
+ (void**)&global_slapdFrontendConfig.connection_nocanon,
+ CONFIG_ON_OFF, (ConfigGetFunc)config_get_connection_nocanon, &init_connection_nocanon}
#ifdef MEMPOOL_EXPERIMENTAL
,{CONFIG_MEMPOOL_SWITCH_ATTRIBUTE, config_set_mempool_switch,
NULL, 0,
@@ -1500,6 +1505,7 @@ FrontendConfig_init () {
init_return_orig_type = cfg->return_orig_type = LDAP_OFF;
init_enable_turbo_mode = cfg->enable_turbo_mode = LDAP_ON;
init_connection_buffer = cfg->connection_buffer = CONNECTION_BUFFER_ON;
+ init_connection_nocanon = cfg->connection_nocanon - LDAP_ON;
#ifdef MEMPOOL_EXPERIMENTAL
init_mempool_switch = cfg->mempool_switch = LDAP_ON;
@@ -2005,7 +2011,7 @@ config_set_snmp_index(const char *attrname, char *value, char *errorbuf, int app
snmp_index = strtol(value, &endp, 10);
if (*endp != '\0' || errno == ERANGE || snmp_index < snmp_index_disable) {
- PR_snprintf(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", %s must be greater or equal to %d (%d means disabled)",
+ PR_snprintf(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", %s must be greater or equal to %d (%d means disabled)",
attrname, value, CONFIG_SNMP_INDEX_ATTRIBUTE, snmp_index_disable, snmp_index_disable);
retVal = LDAP_OPERATIONS_ERROR;
}
@@ -6958,6 +6964,18 @@ config_get_enable_turbo_mode(void)
}
int
+config_get_connection_nocanon(void)
+{
+ int retVal;
+ slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
+ CFG_ONOFF_LOCK_READ(slapdFrontendConfig);
+ retVal = (int)slapdFrontendConfig->connection_nocanon;
+ CFG_ONOFF_UNLOCK_READ(slapdFrontendConfig);
+
+ return retVal;
+}
+
+int
slapi_config_get_unhashed_pw_switch()
{
return config_get_unhashed_pw_switch();
@@ -6989,6 +7007,19 @@ config_set_enable_turbo_mode( const char *attrname, char *value,
}
int
+config_set_connection_nocanon( const char *attrname, char *value,
+ char *errorbuf, int apply )
+{
+ int retVal = LDAP_SUCCESS;
+ slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
+
+ retVal = config_set_onoff(attrname, value,
+ &(slapdFrontendConfig->connection_nocanon),
+ errorbuf, apply);
+ return retVal;
+}
+
+int
config_get_connection_buffer(void)
{
int retVal;
diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h
index ea6fb6c..2f16618 100644
--- a/ldap/servers/slapd/proto-slap.h
+++ b/ldap/servers/slapd/proto-slap.h
@@ -575,6 +575,9 @@ int config_get_enable_turbo_mode();
int config_set_enable_turbo_mode(const char *attrname, char *value, char *errorbuf, int apply);
int config_get_connection_buffer();
int config_set_connection_buffer(const char *attrname, char *value, char *errorbuf, int apply);
+int config_get_connection_nocanon();
+int config_set_connection_nocanon(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 224706c..1f37e3d 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -2079,6 +2079,7 @@ typedef struct _slapdEntryPoints {
#define CONFIG_SEARCH_RETURN_ORIGINAL_TYPE "nsslapd-search-return-original-type-switch"
#define CONFIG_ENABLE_TURBO_MODE "nsslapd-enable-turbo-mode"
#define CONFIG_CONNECTION_BUFFER "nsslapd-connection-buffer"
+#define CONFIG_CONNECTION_NOCANON "nsslapd-connection-nocanon"
#ifdef MEMPOOL_EXPERIMENTAL
#define CONFIG_MEMPOOL_SWITCH_ATTRIBUTE "nsslapd-mempool"
@@ -2324,6 +2325,7 @@ typedef struct _slapdFrontendConfig {
slapi_onoff_t unhashed_pw_switch; /* switch to on/off/nolog unhashed pw */
slapi_onoff_t enable_turbo_mode;
slapi_int_t connection_buffer; /* values are CONNECTION_BUFFER_* below */
+ slapi_onoff_t connection_nocanon; /* if "on" sets LDAP_OPT_X_SASL_NOCANON */
} slapdFrontendConfig_t;
/* possible values for slapdFrontendConfig_t.schemareplace */
11 years
ldap/servers
by thierry bordaz
ldap/servers/plugins/replication/repl5_connection.c | 2 +-
ldap/servers/plugins/replication/repl5_protocol.c | 4 ++--
ldap/servers/slapd/ldaputil.c | 18 +++++++++++++++---
3 files changed, 18 insertions(+), 6 deletions(-)
New commits:
commit 1cbd6d84dd0871af4955ebf93693e8b4331ab07e
Author: Thierry bordaz (tbordaz) <tbordaz(a)redhat.com>
Date: Wed Apr 10 18:45:17 2013 +0200
Ticket 47325 - Crash at shutdown on a replica aggrement
Bug Description:
This is a followup of the ticket https://fedorahosted.org/389/ticket/618
The RA thread are waited by the main daemon at shutdown.
The problem is that the RA thread are not created with the right flag so they are not
joinable.
Fix Description:
Use the correct creation flag PR_JOINABLE_THREAD
In addition this fix introduce a bind timeout for the RA. It will take the one defined in
the protocol (10 min per default).
Ticket: https://fedorahosted.org/389/ticket/47325
Reviewed by: Mark Reynolds (thank you Mark !)
Platforms tested: Fedora 17
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/replication/repl5_connection.c b/ldap/servers/plugins/replication/repl5_connection.c
index b8b542e..668abda 100644
--- a/ldap/servers/plugins/replication/repl5_connection.c
+++ b/ldap/servers/plugins/replication/repl5_connection.c
@@ -1782,7 +1782,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, NULL);
+ &ctrls, &conn->timeout, NULL);
if ( rc == LDAP_SUCCESS )
{
diff --git a/ldap/servers/plugins/replication/repl5_protocol.c b/ldap/servers/plugins/replication/repl5_protocol.c
index 76e018a..8373ba6 100644
--- a/ldap/servers/plugins/replication/repl5_protocol.c
+++ b/ldap/servers/plugins/replication/repl5_protocol.c
@@ -369,9 +369,9 @@ prot_start(Repl_Protocol *rp)
{
rp->agmt_thread = PR_CreateThread(PR_USER_THREAD, prot_thread_main, (void *)rp,
#if defined(__hpux) && defined(__ia64)
- PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 524288L );
+ PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 524288L );
#else
- PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE);
+ PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE);
#endif
if (rp->agmt_thread == NULL)
{
diff --git a/ldap/servers/slapd/ldaputil.c b/ldap/servers/slapd/ldaputil.c
index 3ca1139..5ac2fdd 100644
--- a/ldap/servers/slapd/ldaputil.c
+++ b/ldap/servers/slapd/ldaputil.c
@@ -1126,7 +1126,19 @@ slapi_ldap_bind(
if (msgidp) { /* let caller process result */
*msgidp = mymsgid;
} else { /* process results */
- rc = ldap_result(ld, mymsgid, LDAP_MSG_ALL, timeout, &result);
+ struct timeval default_timeout, *bind_timeout;
+
+ if ((timeout == NULL) || ((timeout->tv_sec == 0) && (timeout->tv_usec == 0))) {
+ /* Let's wait 1 min max to bind */
+ default_timeout.tv_sec = 60;
+ default_timeout.tv_usec = 0;
+
+ bind_timeout = &default_timeout;
+ } else {
+ /* take the one provided by the caller. It should be the one defined in the protocol */
+ bind_timeout = timeout;
+ }
+ rc = ldap_result(ld, mymsgid, LDAP_MSG_ALL, bind_timeout, &result);
if (-1 == rc) { /* error */
rc = slapi_ldap_get_lderrno(ld, NULL, NULL);
slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_bind",
@@ -1141,8 +1153,8 @@ slapi_ldap_bind(
slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_bind",
"Error: timeout after [%ld.%ld] seconds reading "
"bind response for [%s] authentication mechanism [%s]\n",
- timeout ? timeout->tv_sec : 0,
- timeout ? timeout->tv_usec : 0,
+ bind_timeout ? bind_timeout->tv_sec : 0,
+ bind_timeout ? bind_timeout->tv_usec : 0,
bindid ? bindid : "(anon)",
mech ? mech : "SIMPLE");
goto done;
11 years
ldap/admin
by Richard Allen Megginson
ldap/admin/src/logconv.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 87f5ef5a97437cc92afe2496cd06e5d2ec71d9ff
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Apr 22 20:28:14 2013 -0600
Ticket #47341 - logconv.pl -m time calculation is wrong
https://fedorahosted.org/389/ticket/47341
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: The variable name is $hr, not $hours. The regex for the
sign in the timezone should have been (.) not (?).
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 757f799..3b8adc5 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -1574,7 +1574,7 @@ sub parseLineNormal
{
# tz offset change
$lastzone=$tzone;
- ($sign,$hr,$min) = $tzone =~ m/(?)(\d\d)(\d\d)/;
+ ($sign,$hr,$min) = $tzone =~ m/(.)(\d\d)(\d\d)/;
$tzoff = $hr*3600 + $min*60;
$tzoff *= -1
if $sign eq '-';
@@ -1582,7 +1582,7 @@ sub parseLineNormal
}
($date, $hr, $min, $sec) = split (':', $time);
($day, $mon, $yr) = split ('/', $date);
- $newmin = timegm(0, $min, $hours, $day, $monthname{$mon}, $yr) - $tzoff;
+ $newmin = timegm(0, $min, $hr, $day, $monthname{$mon}, $yr) - $tzoff;
$gmtime = $newmin + $sec;
print_stats_block( $s_stats );
reset_stats_block( $s_stats, $gmtime, $time.' '.$tzone );
11 years
Branch '389-ds-base-1.3.1' - ldap/admin
by Richard Allen Megginson
ldap/admin/src/logconv.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 1878bbfef7ae76ed18d709d5414e21cbd0961a38
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Apr 22 20:28:14 2013 -0600
Ticket #47341 - logconv.pl -m time calculation is wrong
https://fedorahosted.org/389/ticket/47341
Reviewed by: nkinder (Thanks!)
Branch: 389-ds-base-1.3.1
Fix Description: The variable name is $hr, not $hours. The regex for the
sign in the timezone should have been (.) not (?).
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 87f5ef5a97437cc92afe2496cd06e5d2ec71d9ff)
diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
index 757f799..3b8adc5 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -1574,7 +1574,7 @@ sub parseLineNormal
{
# tz offset change
$lastzone=$tzone;
- ($sign,$hr,$min) = $tzone =~ m/(?)(\d\d)(\d\d)/;
+ ($sign,$hr,$min) = $tzone =~ m/(.)(\d\d)(\d\d)/;
$tzoff = $hr*3600 + $min*60;
$tzoff *= -1
if $sign eq '-';
@@ -1582,7 +1582,7 @@ sub parseLineNormal
}
($date, $hr, $min, $sec) = split (':', $time);
($day, $mon, $yr) = split ('/', $date);
- $newmin = timegm(0, $min, $hours, $day, $monthname{$mon}, $yr) - $tzoff;
+ $newmin = timegm(0, $min, $hr, $day, $monthname{$mon}, $yr) - $tzoff;
$gmtime = $newmin + $sec;
print_stats_block( $s_stats );
reset_stats_block( $s_stats, $gmtime, $time.' '.$tzone );
11 years
rpm/rpmverrel.sh
by Nathan Kinder
rpm/rpmverrel.sh | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit 52fb682ceb0b1f03de26b6f9d56a8ee2476d9422
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Mon Apr 22 13:34:44 2013 -0700
Add git commit hash to developer rpm build names
We need to set the srcdir variable in order for the most recent
git hash to be determined by VERSION.sh. This patch will result
in deveoper RPM builds having the git commit hash in the release
field.
diff --git a/rpm/rpmverrel.sh b/rpm/rpmverrel.sh
index 064b052..86b808e 100755
--- a/rpm/rpmverrel.sh
+++ b/rpm/rpmverrel.sh
@@ -1,5 +1,9 @@
#!/bin/sh
+# Set srcdir so VERSION.sh is able to
+# determine the last git commit hash.
+srcdir=`pwd`
+
# Source VERSION.sh to set the version
# and release environment variables.
source ./VERSION.sh
11 years
configure configure.ac Makefile.am Makefile.in rpm.mk rpm/rpmverrel.sh
by Nathan Kinder
Makefile.am | 41 -----------------------------------------
Makefile.in | 43 -------------------------------------------
configure | 9 ---------
configure.ac | 7 -------
rpm.mk | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
rpm/rpmverrel.sh | 11 +++++++++++
6 files changed, 62 insertions(+), 100 deletions(-)
New commits:
commit bf49d6a6b7a7865b29de5b1441bc08b4426ba3a2
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Sun Apr 21 20:35:48 2013 -0700
Allow rpm builds to be run without configure
The previous patch that added support to build RPM packages required
you to run configure before we could even create a SRPM. We had to
do this since Makefile is generated by automake when configure is
run. This isn't useful when you just want to create a SRPM to use
for performing mock builds since the system you are creating a SRPM
on might not even have the proper build dependencies availble.
This patch removes the need to run configure when building RPMS. A
new Makefile is added that is only used for RPM related tasks. A
target to build a SRPM was also added to allow one to create a SRPM
for using with mock builds. To build a SRPM or RPMS with this patch,
you can just run one of the following commands with a freshly checked
out source tree:
make -f rpm.mk srpms
make -f rpm.mk rpms
The rpms, srpms, and source tarball will be creates in a dist
directory in the build tree.
diff --git a/Makefile.am b/Makefile.am
index a35f8e4..7f00b07 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,15 +6,6 @@ COLON := $(NULLSTRING):# a colon
QUOTE := $(NULLSTRING)"# a double quote"
#------------------------
-# RPM Packaging
-#------------------------
-RPMBUILD ?= $(PWD)/rpmbuild
-RPM_VERSION=@rpm_version@
-RPM_RELEASE=@rpm_release@
-RPM_NAME_VERSION=$(PACKAGE)-$(RPM_VERSION)
-TARBALL=$(RPM_NAME_VERSION).tar.bz2
-
-#------------------------
# Compiler Flags
#------------------------
BUILDNUM := $(shell perl $(srcdir)/buildnum.pl)
@@ -1684,35 +1675,3 @@ git-archive:
fi ; \
git archive --prefix=$(distdir)/ $$gittag | bzip2 > $$srcdistdir/$(distdir).tar.bz2
-local-archive:
- -mkdir -p dist/$(RPM_NAME_VERSION)
- rsync -a --exclude=dist --exclude=.git --exclude=rpmbuild $(srcdir)/. dist/$(RPM_NAME_VERSION)
-
-tarballs: local-archive
- -mkdir -p dist/sources
- cd dist; tar cfj sources/$(TARBALL) $(RPM_NAME_VERSION)
- rm -rf dist/$(RPM_NAME_VERSION)
-
-rpmroot:
- rm -rf $(RPMBUILD)
- mkdir -p $(RPMBUILD)/BUILD
- mkdir -p $(RPMBUILD)/RPMS
- mkdir -p $(RPMBUILD)/SOURCES
- mkdir -p $(RPMBUILD)/SPECS
- mkdir -p $(RPMBUILD)/SRPMS
-
-rpmdistdir:
- mkdir -p dist/rpms
- mkdir -p dist/srpms
-
-rpms: rpmroot rpmdistdir tarballs
- cp dist/sources/$(TARBALL) $(RPMBUILD)/SOURCES/
- cp $(srcdir)/rpm/$(PACKAGE)-* $(RPMBUILD)/SOURCES/
- sed -e s/__VERSION__/$(RPM_VERSION)/ -e s/__RELEASE__/$(RPM_RELEASE)/ \
- $(srcdir)/rpm/$(PACKAGE).spec.in > $(RPMBUILD)/SPECS/$(PACKAGE).spec
- rpmbuild --define "_topdir $(RPMBUILD)" -ba $(RPMBUILD)/SPECS/$(PACKAGE).spec
- cp $(RPMBUILD)/RPMS/*/$(RPM_NAME_VERSION)-*.rpm dist/rpms/
- cp $(RPMBUILD)/RPMS/*/$(PACKAGE)-*-$(RPM_VERSION)-*.rpm dist/rpms/
- cp $(RPMBUILD)/SRPMS/$(RPM_NAME_VERSION)-*.src.rpm dist/srpms/
- rm -rf $(RPMBUILD)
-
diff --git a/Makefile.in b/Makefile.in
index b34d1f6..c1f207e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1310,8 +1310,6 @@ prefix = @prefix@
program_transform_name = @program_transform_name@
propertydir = $(datadir)@propertydir@
psdir = @psdir@
-rpm_release = @rpm_release@
-rpm_version = @rpm_version@
sampledatadir = $(datadir)@sampledatadir@
sasl_inc = @sasl_inc@
sasl_lib = @sasl_lib@
@@ -1348,10 +1346,6 @@ NULLSTRING :=
SPACE := $(NULLSTRING) # the space is between the ) and the #
COLON := $(NULLSTRING):# a colon
QUOTE := $(NULLSTRING)"# a double quote"
-RPM_VERSION = @rpm_version@
-RPM_RELEASE = @rpm_release@
-RPM_NAME_VERSION = $(PACKAGE)-$(RPM_VERSION)
-TARBALL = $(RPM_NAME_VERSION).tar.bz2
#------------------------
# Compiler Flags
@@ -10909,11 +10903,6 @@ uninstall-man: uninstall-man1 uninstall-man8
uninstall-updateDATA uninstall-updateSCRIPTS
-#------------------------
-# RPM Packaging
-#------------------------
-RPMBUILD ?= $(PWD)/rpmbuild
-
clean-local:
-rm -rf dist
-rm -rf selinux-built
@@ -10993,38 +10982,6 @@ git-archive:
fi ; \
git archive --prefix=$(distdir)/ $$gittag | bzip2 > $$srcdistdir/$(distdir).tar.bz2
-local-archive:
- -mkdir -p dist/$(RPM_NAME_VERSION)
- rsync -a --exclude=dist --exclude=.git --exclude=rpmbuild $(srcdir)/. dist/$(RPM_NAME_VERSION)
-
-tarballs: local-archive
- -mkdir -p dist/sources
- cd dist; tar cfj sources/$(TARBALL) $(RPM_NAME_VERSION)
- rm -rf dist/$(RPM_NAME_VERSION)
-
-rpmroot:
- rm -rf $(RPMBUILD)
- mkdir -p $(RPMBUILD)/BUILD
- mkdir -p $(RPMBUILD)/RPMS
- mkdir -p $(RPMBUILD)/SOURCES
- mkdir -p $(RPMBUILD)/SPECS
- mkdir -p $(RPMBUILD)/SRPMS
-
-rpmdistdir:
- mkdir -p dist/rpms
- mkdir -p dist/srpms
-
-rpms: rpmroot rpmdistdir tarballs
- cp dist/sources/$(TARBALL) $(RPMBUILD)/SOURCES/
- cp $(srcdir)/rpm/$(PACKAGE)-* $(RPMBUILD)/SOURCES/
- sed -e s/__VERSION__/$(RPM_VERSION)/ -e s/__RELEASE__/$(RPM_RELEASE)/ \
- $(srcdir)/rpm/$(PACKAGE).spec.in > $(RPMBUILD)/SPECS/$(PACKAGE).spec
- rpmbuild --define "_topdir $(RPMBUILD)" -ba $(RPMBUILD)/SPECS/$(PACKAGE).spec
- cp $(RPMBUILD)/RPMS/*/$(RPM_NAME_VERSION)-*.rpm dist/rpms/
- cp $(RPMBUILD)/RPMS/*/$(PACKAGE)-*-$(RPM_VERSION)-*.rpm dist/rpms/
- cp $(RPMBUILD)/SRPMS/$(RPM_NAME_VERSION)-*.src.rpm dist/srpms/
- rm -rf $(RPMBUILD)
-
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/configure b/configure
index 5c57f94..2e4c799 100755
--- a/configure
+++ b/configure
@@ -616,8 +616,6 @@ ac_default_prefix=/opt/$PACKAGE_NAME
ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
-rpm_release
-rpm_version
vendor
capbrand
brand
@@ -3345,10 +3343,6 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-# Set the version and release for developer RPM builds
-rpm_version=$RPM_VERSION
-rpm_release=$RPM_RELEASE
-
# Checks for programs.
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
@@ -21168,9 +21162,6 @@ fi
-
-
-
# AC_DEFINE([USE_OLD_UNHASHED], [], [Use old unhashed code])
$as_echo "#define LDAP_DEBUG 1" >>confdefs.h
diff --git a/configure.ac b/configure.ac
index 7d61149..c6edbfa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,10 +21,6 @@ AC_SUBST([CONSOLE_VERSION])
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
-# Set the version and release for developer RPM builds
-rpm_version=$RPM_VERSION
-rpm_release=$RPM_RELEASE
-
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
@@ -690,9 +686,6 @@ AC_SUBST(brand)
AC_SUBST(capbrand)
AC_SUBST(vendor)
-AC_SUBST(rpm_version)
-AC_SUBST(rpm_release)
-
# AC_DEFINE([USE_OLD_UNHASHED], [], [Use old unhashed code])
AC_DEFINE([LDAP_DEBUG], [1], [LDAP debug flag])
AC_DEFINE([LDAP_DONT_USE_SMARTHEAP], [1], [Don't use smartheap])
diff --git a/rpm.mk b/rpm.mk
new file mode 100644
index 0000000..dfbadc6
--- /dev/null
+++ b/rpm.mk
@@ -0,0 +1,51 @@
+RPMBUILD ?= $(PWD)/rpmbuild
+RPM_VERSION ?= $(shell $(PWD)/rpm/rpmverrel.sh version)
+RPM_RELEASE ?= $(shell $(PWD)/rpm/rpmverrel.sh release)
+PACKAGE = 389-ds-base
+RPM_NAME_VERSION = $(PACKAGE)-$(RPM_VERSION)
+TARBALL = $(RPM_NAME_VERSION).tar.bz2
+
+clean:
+ rm -rf dist
+ rm -rf rpmbuild
+
+local-archive:
+ -mkdir -p dist/$(RPM_NAME_VERSION)
+ rsync -a --exclude=dist --exclude=.git --exclude=rpmbuild . dist/$(RPM_NAME_VERSION)
+
+tarballs: local-archive
+ -mkdir -p dist/sources
+ cd dist; tar cfj sources/$(TARBALL) $(RPM_NAME_VERSION)
+ rm -rf dist/$(RPM_NAME_VERSION)
+
+rpmroot:
+ rm -rf $(RPMBUILD)
+ mkdir -p $(RPMBUILD)/BUILD
+ mkdir -p $(RPMBUILD)/RPMS
+ mkdir -p $(RPMBUILD)/SOURCES
+ mkdir -p $(RPMBUILD)/SPECS
+ mkdir -p $(RPMBUILD)/SRPMS
+
+rpmdistdir:
+ mkdir -p dist/rpms
+
+srpmdistdir:
+ mkdir -p dist/srpms
+
+rpmbuildprep:
+ cp dist/sources/$(TARBALL) $(RPMBUILD)/SOURCES/
+ cp rpm/$(PACKAGE)-* $(RPMBUILD)/SOURCES/
+ sed -e s/__VERSION__/$(RPM_VERSION)/ -e s/__RELEASE__/$(RPM_RELEASE)/ \
+ rpm/$(PACKAGE).spec.in > $(RPMBUILD)/SPECS/$(PACKAGE).spec
+
+srpms: rpmroot srpmdistdir tarballs rpmbuildprep
+ rpmbuild --define "_topdir $(RPMBUILD)" -bs $(RPMBUILD)/SPECS/$(PACKAGE).spec
+ cp $(RPMBUILD)/SRPMS/$(RPM_NAME_VERSION)-*.src.rpm dist/srpms/
+ rm -rf $(RPMBUILD)
+
+rpms: rpmroot srpmdistdir rpmdistdir tarballs rpmbuildprep
+ rpmbuild --define "_topdir $(RPMBUILD)" -ba $(RPMBUILD)/SPECS/$(PACKAGE).spec
+ cp $(RPMBUILD)/RPMS/*/$(RPM_NAME_VERSION)-*.rpm dist/rpms/
+ cp $(RPMBUILD)/RPMS/*/$(PACKAGE)-*-$(RPM_VERSION)-*.rpm dist/rpms/
+ cp $(RPMBUILD)/SRPMS/$(RPM_NAME_VERSION)-*.src.rpm dist/srpms/
+ rm -rf $(RPMBUILD)
diff --git a/rpm/rpmverrel.sh b/rpm/rpmverrel.sh
new file mode 100755
index 0000000..064b052
--- /dev/null
+++ b/rpm/rpmverrel.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# Source VERSION.sh to set the version
+# and release environment variables.
+source ./VERSION.sh
+
+if [ "$1" = "version" ]; then
+ echo $RPM_VERSION
+elif [ "$1" = "release" ]; then
+ echo $RPM_RELEASE
+fi
11 years
ldap/admin
by Richard Allen Megginson
ldap/admin/src/logconv.pl | 33 ++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)
New commits:
commit 27f2595bfd54c85bb169ac45cac2cdbfd4de17fc
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Fri Apr 19 14:55:41 2013 -0600
Ticket #47336 - logconv.pl -m not working for all stats
https://fedorahosted.org/389/ticket/47336
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: Code was using $reportStat instead of $reportStats. Also,
some fields such as connections, ssl connections were not being kept.
Finally, some headers were missing.
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 7e0bfd8..757f799 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -1564,7 +1564,7 @@ sub parseLineNormal
# Additional performance stats
($time, $tzone) = split (' ', $_);
- if ($reportStat && $time ne $last_tm)
+ if ($reportStats && $time ne $last_tm)
{
$last_tm = $time;
$time =~ s/\[//;
@@ -1597,11 +1597,11 @@ sub parseLineNormal
if (m/ RESULT err/){
$allResults++;
- if($reportStat){ inc_stats('results',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('results',$s_stats,$m_stats); }
}
if (m/ SRCH/){
$srchCount++;
- if($reportStat){ inc_stats('srch',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('srch',$s_stats,$m_stats); }
if ($_ =~ / attrs=\"(.*)\"/i){
$anyAttrs++;
$attrs = $1 . " ";
@@ -1620,7 +1620,7 @@ sub parseLineNormal
}
if (m/ DEL/){
$delCount++;
- if($reportStat){ inc_stats('del',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('del',$s_stats,$m_stats); }
if ($verb eq "yes"){
if ($_ =~ /conn= *([0-9]+)/i){ writeFile($DEL_CONN, $1);}
if ($_ =~ /op= *([0-9]+)/i){ writeFile($DEL_OP, $1);}
@@ -1628,7 +1628,7 @@ sub parseLineNormal
}
if (m/ MOD dn=/){
$modCount++;
- if($reportStat){ inc_stats('mod',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('mod',$s_stats,$m_stats); }
if ($verb eq "yes"){
if ($_ =~ /conn= *([0-9]+)/i){ writeFile($MOD_CONN, $1);}
if ($_ =~ /op= *([0-9]+)/i){ writeFile($MOD_OP, $1); }
@@ -1636,7 +1636,7 @@ sub parseLineNormal
}
if (m/ ADD/){
$addCount++;
- if($reportStat){ inc_stats('add',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('add',$s_stats,$m_stats); }
if ($verb eq "yes"){
if ($_ =~ /conn= *([0-9]+)/i){ writeFile($ADD_CONN, $1); }
if ($_ =~ /op= *([0-9]+)/i){ writeFile($ADD_OP, $1); }
@@ -1644,7 +1644,7 @@ sub parseLineNormal
}
if (m/ MODRDN/){
$modrdnCount++;
- if($reportStat){ inc_stats('modrdn',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('modrdn',$s_stats,$m_stats); }
if ($verb eq "yes"){
if ($_ =~ /conn= *([0-9]+)/i){ writeFile($MODRDN_CONN, $1); }
if ($_ =~ /op= *([0-9]+)/i){ writeFile($MODRDN_OP, $1); }
@@ -1652,7 +1652,7 @@ sub parseLineNormal
}
if (m/ CMP dn=/){
$cmpCount++;
- if($reportStat){ inc_stats('cmp',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('cmp',$s_stats,$m_stats); }
if ($verb eq "yes" || $usage =~ /g/i){
if ($_ =~ /conn= *([0-9]+)/i){ writeFile($CMP_CONN, $1);}
if ($_ =~ /op= *([0-9]+)/i){ writeFile($CMP_OP, $1);}
@@ -1660,7 +1660,7 @@ sub parseLineNormal
}
if (m/ ABANDON /){
$abandonCount++;
- if($reportStat){ inc_stats('abandon',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('abandon',$s_stats,$m_stats); }
$allResults++;
if ($_ =~ /targetop= *([0-9a-zA-Z]+)/i ){
writeFile($TARGET_OP, $1);
@@ -1680,12 +1680,12 @@ sub parseLineNormal
if (m/ version=2/){$v2BindCount++}
if (m/ version=3/){$v3BindCount++}
if (m/ conn=1 fd=/){$serverRestartCount++}
- if (m/ SSL connection from/){$sslCount++;}
+ 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=\"(.*)\"/){
$autobindCount++;
$bindCount++;
- if($reportStat){ inc_stats('bind',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('bind',$s_stats,$m_stats); }
if ($1 ne ""){
$tmpp = $1;
$tmpp =~ tr/A-Z/a-z/;
@@ -1705,7 +1705,10 @@ sub parseLineNormal
for ($xxx =0; $xxx <= $#excludeIP; $xxx++){
if ($excludeIP[$xxx] eq $1){$exc = "yes";}
}
- if ($exc ne "yes"){ $connectionCount++;}
+ if ($exc ne "yes"){
+ $connectionCount++;
+ if($reportStats){ inc_stats('conns',$s_stats,$m_stats); }
+ }
}
$simConnection++;
if ($simConnection > $maxsimConnection) {
@@ -1740,7 +1743,7 @@ sub parseLineNormal
if ($diff >= 16) { $latency[6] ++;}
}
if (m/ BIND/ && $_ =~ /dn=\"(.*)\" method/i ){
- if($reportStat){ inc_stats('bind',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('bind',$s_stats,$m_stats); }
$bindCount++;
if ($1 ne ""){
if($1 eq $rootDN){$rootDNBindCount++;}
@@ -1782,7 +1785,7 @@ sub parseLineNormal
# We don't want to record vlv unindexed searches for our regular "bad"
# unindexed search stat, as VLV unindexed searches aren't that bad
$unindexedSrchCount++;
- if($reportStat){ inc_stats('notesu',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('notesu',$s_stats,$m_stats); }
}
if ($usage =~ /u/ || $verb eq "yes"){
if ($isVlvNnotes == 0 ){
@@ -2242,7 +2245,7 @@ print_stats_block
"\n" );
} else {
$stats->{'fh'}->print(
- "Time,time_t,Results,Search,Add,Mod,Modrdn,Delete,Abandon,".
+ "Time,time_t,Results,Search,Add,Mod,Modrdn,Moddn,Compare,Delete,Abandon,".
"Connections,SSL Conns,Bind,Anon Bind,Unbind,Unindexed\n"
);
}
11 years
Branch '389-ds-base-1.3.1' - ldap/admin
by Richard Allen Megginson
ldap/admin/src/logconv.pl | 33 ++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)
New commits:
commit 26bd66a10ab942c8782294d89a9e3e1768bc7936
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Fri Apr 19 14:55:41 2013 -0600
Ticket #47336 - logconv.pl -m not working for all stats
https://fedorahosted.org/389/ticket/47336
Reviewed by: nhosoi (Thanks!)
Branch: 389-ds-base-1.3.1
Fix Description: Code was using $reportStat instead of $reportStats. Also,
some fields such as connections, ssl connections were not being kept.
Finally, some headers were missing.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 27f2595bfd54c85bb169ac45cac2cdbfd4de17fc)
diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
index 7e0bfd8..757f799 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -1564,7 +1564,7 @@ sub parseLineNormal
# Additional performance stats
($time, $tzone) = split (' ', $_);
- if ($reportStat && $time ne $last_tm)
+ if ($reportStats && $time ne $last_tm)
{
$last_tm = $time;
$time =~ s/\[//;
@@ -1597,11 +1597,11 @@ sub parseLineNormal
if (m/ RESULT err/){
$allResults++;
- if($reportStat){ inc_stats('results',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('results',$s_stats,$m_stats); }
}
if (m/ SRCH/){
$srchCount++;
- if($reportStat){ inc_stats('srch',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('srch',$s_stats,$m_stats); }
if ($_ =~ / attrs=\"(.*)\"/i){
$anyAttrs++;
$attrs = $1 . " ";
@@ -1620,7 +1620,7 @@ sub parseLineNormal
}
if (m/ DEL/){
$delCount++;
- if($reportStat){ inc_stats('del',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('del',$s_stats,$m_stats); }
if ($verb eq "yes"){
if ($_ =~ /conn= *([0-9]+)/i){ writeFile($DEL_CONN, $1);}
if ($_ =~ /op= *([0-9]+)/i){ writeFile($DEL_OP, $1);}
@@ -1628,7 +1628,7 @@ sub parseLineNormal
}
if (m/ MOD dn=/){
$modCount++;
- if($reportStat){ inc_stats('mod',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('mod',$s_stats,$m_stats); }
if ($verb eq "yes"){
if ($_ =~ /conn= *([0-9]+)/i){ writeFile($MOD_CONN, $1);}
if ($_ =~ /op= *([0-9]+)/i){ writeFile($MOD_OP, $1); }
@@ -1636,7 +1636,7 @@ sub parseLineNormal
}
if (m/ ADD/){
$addCount++;
- if($reportStat){ inc_stats('add',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('add',$s_stats,$m_stats); }
if ($verb eq "yes"){
if ($_ =~ /conn= *([0-9]+)/i){ writeFile($ADD_CONN, $1); }
if ($_ =~ /op= *([0-9]+)/i){ writeFile($ADD_OP, $1); }
@@ -1644,7 +1644,7 @@ sub parseLineNormal
}
if (m/ MODRDN/){
$modrdnCount++;
- if($reportStat){ inc_stats('modrdn',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('modrdn',$s_stats,$m_stats); }
if ($verb eq "yes"){
if ($_ =~ /conn= *([0-9]+)/i){ writeFile($MODRDN_CONN, $1); }
if ($_ =~ /op= *([0-9]+)/i){ writeFile($MODRDN_OP, $1); }
@@ -1652,7 +1652,7 @@ sub parseLineNormal
}
if (m/ CMP dn=/){
$cmpCount++;
- if($reportStat){ inc_stats('cmp',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('cmp',$s_stats,$m_stats); }
if ($verb eq "yes" || $usage =~ /g/i){
if ($_ =~ /conn= *([0-9]+)/i){ writeFile($CMP_CONN, $1);}
if ($_ =~ /op= *([0-9]+)/i){ writeFile($CMP_OP, $1);}
@@ -1660,7 +1660,7 @@ sub parseLineNormal
}
if (m/ ABANDON /){
$abandonCount++;
- if($reportStat){ inc_stats('abandon',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('abandon',$s_stats,$m_stats); }
$allResults++;
if ($_ =~ /targetop= *([0-9a-zA-Z]+)/i ){
writeFile($TARGET_OP, $1);
@@ -1680,12 +1680,12 @@ sub parseLineNormal
if (m/ version=2/){$v2BindCount++}
if (m/ version=3/){$v3BindCount++}
if (m/ conn=1 fd=/){$serverRestartCount++}
- if (m/ SSL connection from/){$sslCount++;}
+ 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=\"(.*)\"/){
$autobindCount++;
$bindCount++;
- if($reportStat){ inc_stats('bind',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('bind',$s_stats,$m_stats); }
if ($1 ne ""){
$tmpp = $1;
$tmpp =~ tr/A-Z/a-z/;
@@ -1705,7 +1705,10 @@ sub parseLineNormal
for ($xxx =0; $xxx <= $#excludeIP; $xxx++){
if ($excludeIP[$xxx] eq $1){$exc = "yes";}
}
- if ($exc ne "yes"){ $connectionCount++;}
+ if ($exc ne "yes"){
+ $connectionCount++;
+ if($reportStats){ inc_stats('conns',$s_stats,$m_stats); }
+ }
}
$simConnection++;
if ($simConnection > $maxsimConnection) {
@@ -1740,7 +1743,7 @@ sub parseLineNormal
if ($diff >= 16) { $latency[6] ++;}
}
if (m/ BIND/ && $_ =~ /dn=\"(.*)\" method/i ){
- if($reportStat){ inc_stats('bind',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('bind',$s_stats,$m_stats); }
$bindCount++;
if ($1 ne ""){
if($1 eq $rootDN){$rootDNBindCount++;}
@@ -1782,7 +1785,7 @@ sub parseLineNormal
# We don't want to record vlv unindexed searches for our regular "bad"
# unindexed search stat, as VLV unindexed searches aren't that bad
$unindexedSrchCount++;
- if($reportStat){ inc_stats('notesu',$s_stats,$m_stats); }
+ if($reportStats){ inc_stats('notesu',$s_stats,$m_stats); }
}
if ($usage =~ /u/ || $verb eq "yes"){
if ($isVlvNnotes == 0 ){
@@ -2242,7 +2245,7 @@ print_stats_block
"\n" );
} else {
$stats->{'fh'}->print(
- "Time,time_t,Results,Search,Add,Mod,Modrdn,Delete,Abandon,".
+ "Time,time_t,Results,Search,Add,Mod,Modrdn,Moddn,Compare,Delete,Abandon,".
"Connections,SSL Conns,Bind,Anon Bind,Unbind,Unindexed\n"
);
}
11 years