[389-ds-base] branch 389-ds-base-1.4.1 updated: Issue 50599 - Fix memory leak when removing db region files
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.1
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.1 by this push:
new 44d9b73 Issue 50599 - Fix memory leak when removing db region files
44d9b73 is described below
commit 44d9b73563d7dcc9aff8b3b58e54db26b11abf98
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Fri Jan 17 10:53:03 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: tbordaz(Thanks!)
---
ldap/servers/slapd/back-ldbm/dblayer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index 3d4abda..ef93136 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -1371,7 +1371,7 @@ dblayer_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]);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 2 months
[389-ds-base] branch 389-ds-base-1.4.2 updated: Issue 50599 - Fix memory leak when removing db region files
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.2
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.2 by this push:
new b747be0 Issue 50599 - Fix memory leak when removing db region files
b747be0 is described below
commit b747be067caf79615ecf5fa62dae2fc58be4e5cd
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: 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:
---
ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 a929c88..1678529 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]);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 2 months
[389-ds-base] branch 389-ds-base-1.4.1 updated: Issue 49395 - Set the default TLS version min to TLS1.2
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.1
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.1 by this push:
new 07c4799 Issue 49395 - Set the default TLS version min to TLS1.2
07c4799 is described below
commit 07c479972384ca0c21575961041c3266be1c302d
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Thu Jan 16 10:26:29 2020 -0500
Issue 49395 - Set the default TLS version min to TLS1.2
Description: On fedora the NSS default minimum is still TLS1.0,
we need to force the default min to be TLS1.2 unless
explicity set using sslVersionMin in cn=encryption,cn=config
entry.
This is also to comply with our healthcheck tool that
complains about TLS1.0 min setting.
relates: https://pagure.io/389-ds-base/issue/49395
Reviewed by: firstyear (Thanks!)
---
ldap/servers/slapd/ssl.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/ldap/servers/slapd/ssl.c b/ldap/servers/slapd/ssl.c
index 6a07f1a..8365b29 100644
--- a/ldap/servers/slapd/ssl.c
+++ b/ldap/servers/slapd/ssl.c
@@ -48,8 +48,8 @@
* sslVersionMax: max ssl version supported by NSS
******************************************************************************/
-#define DEFVERSION "TLS1.0"
-#define CURRENT_DEFAULT_SSL_VERSION SSL_LIBRARY_VERSION_TLS_1_0
+#define DEFVERSION "TLS1.2"
+#define CURRENT_DEFAULT_SSL_VERSION SSL_LIBRARY_VERSION_TLS_1_2
extern char *slapd_SSL3ciphers;
extern symbol_t supported_ciphers[];
@@ -151,7 +151,7 @@ PRBool enableSSL2 = PR_FALSE;
PRBool enableSSL3 = PR_FALSE;
/*
* nsTLS1: on -- enable TLS1 by default.
- * Corresonding to SSL_LIBRARY_VERSION_TLS_1_0 and greater.
+ * Corresonding to SSL_LIBRARY_VERSION_TLS_1_2 and greater.
*/
PRBool enableTLS1 = PR_TRUE;
@@ -1780,7 +1780,11 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS)
}
val = slapi_entry_attr_get_ref(e, "sslVersionMin");
if (val) {
+ /* Use the user defined minimum */
(void)set_NSS_version((char *)val, &NSSVersionMin, 1);
+ } else {
+ /* Force our default minimum */
+ (void)set_NSS_version(DEFVERSION, &NSSVersionMin, 1);
}
val = slapi_entry_attr_get_ref(e, "sslVersionMax");
if (val) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 2 months
[389-ds-base] branch 389-ds-base-1.4.2 updated: Issue 49395 - Set the default TLS version min to TLS1.2
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.2
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.2 by this push:
new 2a1a0d7 Issue 49395 - Set the default TLS version min to TLS1.2
2a1a0d7 is described below
commit 2a1a0d732524d2cbd9a7fd208abf3e26ccc89a23
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Thu Jan 16 10:26:29 2020 -0500
Issue 49395 - Set the default TLS version min to TLS1.2
Description: On fedora the NSS default minimum is still TLS1.0,
we need to force the default min to be TLS1.2 unless
explicity set using sslVersionMin in cn=encryption,cn=config
entry.
This is also to comply with our healthcheck tool that
complains about TLS1.0 min setting.
relates: https://pagure.io/389-ds-base/issue/49395
Reviewed by: firstyear (Thanks!)
---
ldap/servers/slapd/ssl.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/ldap/servers/slapd/ssl.c b/ldap/servers/slapd/ssl.c
index 6a07f1a..8365b29 100644
--- a/ldap/servers/slapd/ssl.c
+++ b/ldap/servers/slapd/ssl.c
@@ -48,8 +48,8 @@
* sslVersionMax: max ssl version supported by NSS
******************************************************************************/
-#define DEFVERSION "TLS1.0"
-#define CURRENT_DEFAULT_SSL_VERSION SSL_LIBRARY_VERSION_TLS_1_0
+#define DEFVERSION "TLS1.2"
+#define CURRENT_DEFAULT_SSL_VERSION SSL_LIBRARY_VERSION_TLS_1_2
extern char *slapd_SSL3ciphers;
extern symbol_t supported_ciphers[];
@@ -151,7 +151,7 @@ PRBool enableSSL2 = PR_FALSE;
PRBool enableSSL3 = PR_FALSE;
/*
* nsTLS1: on -- enable TLS1 by default.
- * Corresonding to SSL_LIBRARY_VERSION_TLS_1_0 and greater.
+ * Corresonding to SSL_LIBRARY_VERSION_TLS_1_2 and greater.
*/
PRBool enableTLS1 = PR_TRUE;
@@ -1780,7 +1780,11 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS)
}
val = slapi_entry_attr_get_ref(e, "sslVersionMin");
if (val) {
+ /* Use the user defined minimum */
(void)set_NSS_version((char *)val, &NSSVersionMin, 1);
+ } else {
+ /* Force our default minimum */
+ (void)set_NSS_version(DEFVERSION, &NSSVersionMin, 1);
}
val = slapi_entry_attr_get_ref(e, "sslVersionMax");
if (val) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 2 months
[389-ds-base] branch 389-ds-base-1.4.1 updated: Issue 50818 - dsconf pwdpolicy get error
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.1
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.1 by this push:
new 51c604f Issue 50818 - dsconf pwdpolicy get error
51c604f is described below
commit 51c604fe6aadcfe3e7cb592906838dd68c4f62ab
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Mon Jan 13 19:17:04 2020 -0500
Issue 50818 - dsconf pwdpolicy get error
Description: When trying to retrieve a global or local policy we now see:
policyError: 'PwPolicyManager' object has no attribute 'get_attr_list'
Someone removed the function get_attr_list() along the way.
Added the same logic back, and improved it to only report attributes
that are set.
relates: https://pagure.io/389-ds-base/issue/50818
Reviewed by: spichugi(Thanks!)
---
src/lib389/lib389/cli_conf/pwpolicy.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/lib389/lib389/cli_conf/pwpolicy.py b/src/lib389/lib389/cli_conf/pwpolicy.py
index f911997..67bfd87 100644
--- a/src/lib389/lib389/cli_conf/pwpolicy.py
+++ b/src/lib389/lib389/cli_conf/pwpolicy.py
@@ -35,16 +35,17 @@ def _get_policy_type(inst, dn=None):
def _get_pw_policy(inst, targetdn, log, use_json=None):
pwp_manager = PwPolicyManager(inst)
policy_type = _get_policy_type(inst, targetdn)
- attr_list = pwp_manager.get_attr_list()
+ attr_list = list(pwp_manager.arg_to_attr.values())
if "global" in policy_type.lower():
targetdn = 'cn=config'
attr_list.extend(['passwordIsGlobalPolicy', 'nsslapd-pwpolicy_local'])
- attrs = inst.config.get_attrs_vals_utf8(attr_list)
+ all_attrs = inst.config.get_attrs_vals_utf8(attr_list)
+ attrs = {k: v for k, v in all_attrs.items() if len(v) > 0}
else:
policy = pwp_manager.get_pwpolicy_entry(targetdn)
targetdn = policy.dn
- attrs = policy.get_attrs_vals_utf8(attr_list)
-
+ all_attrs = policy.get_attrs_vals_utf8(attr_list)
+ attrs = {k: v for k, v in all_attrs.items() if len(v) > 0}
if use_json:
print(json.dumps({"type": "entry", "pwp_type": policy_type, "dn": ensure_str(targetdn), "attrs": attrs}))
else:
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 2 months
[389-ds-base] branch 389-ds-base-1.4.2 updated: Issue 50818 - dsconf pwdpolicy get error
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.2
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.2 by this push:
new d971bac Issue 50818 - dsconf pwdpolicy get error
d971bac is described below
commit d971bac58dfd3d0e9bf79433303b507a07f883d5
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Mon Jan 13 19:17:04 2020 -0500
Issue 50818 - dsconf pwdpolicy get error
Description: When trying to retrieve a global or local policy we now see:
policyError: 'PwPolicyManager' object has no attribute 'get_attr_list'
Someone removed the function get_attr_list() along the way.
Added the same logic back, and improved it to only report attributes
that are set.
relates: https://pagure.io/389-ds-base/issue/50818
Reviewed by: spichugi(Thanks!)
---
src/lib389/lib389/cli_conf/pwpolicy.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/lib389/lib389/cli_conf/pwpolicy.py b/src/lib389/lib389/cli_conf/pwpolicy.py
index f911997..67bfd87 100644
--- a/src/lib389/lib389/cli_conf/pwpolicy.py
+++ b/src/lib389/lib389/cli_conf/pwpolicy.py
@@ -35,16 +35,17 @@ def _get_policy_type(inst, dn=None):
def _get_pw_policy(inst, targetdn, log, use_json=None):
pwp_manager = PwPolicyManager(inst)
policy_type = _get_policy_type(inst, targetdn)
- attr_list = pwp_manager.get_attr_list()
+ attr_list = list(pwp_manager.arg_to_attr.values())
if "global" in policy_type.lower():
targetdn = 'cn=config'
attr_list.extend(['passwordIsGlobalPolicy', 'nsslapd-pwpolicy_local'])
- attrs = inst.config.get_attrs_vals_utf8(attr_list)
+ all_attrs = inst.config.get_attrs_vals_utf8(attr_list)
+ attrs = {k: v for k, v in all_attrs.items() if len(v) > 0}
else:
policy = pwp_manager.get_pwpolicy_entry(targetdn)
targetdn = policy.dn
- attrs = policy.get_attrs_vals_utf8(attr_list)
-
+ all_attrs = policy.get_attrs_vals_utf8(attr_list)
+ attrs = {k: v for k, v in all_attrs.items() if len(v) > 0}
if use_json:
print(json.dumps({"type": "entry", "pwp_type": policy_type, "dn": ensure_str(targetdn), "attrs": attrs}))
else:
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 2 months
[389-ds-base] branch 389-ds-base-1.4.2 updated: Issue 50824 - dsctl remove fails with "name 'ensure_str' is not defined"
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mhonek pushed a commit to branch 389-ds-base-1.4.2
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.2 by this push:
new 9d3bde5 Issue 50824 - dsctl remove fails with "name 'ensure_str' is not defined"
9d3bde5 is described below
commit 9d3bde5f8e47f8f0de79cef10223b6850adf1bd3
Author: Matus Honek <mhonek(a)redhat.com>
AuthorDate: Thu Jan 16 12:21:45 2020 +0100
Issue 50824 - dsctl remove fails with "name 'ensure_str' is not defined"
Bug Description:
Missing import since commit c39c7bb.
Fix Description:
Add the import.
Fixes https://pagure.io/389-ds-base/issue/50824
Author: Matus Honek <mhonek(a)redhat.com>
Review by: Mark (thanks!)
(cherry picked from commit 4f9aafca9a9927812da5e37ce71d79d1fd23b25a)
---
src/lib389/lib389/instance/remove.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib389/lib389/instance/remove.py b/src/lib389/lib389/instance/remove.py
index e54e64e..e48b294 100644
--- a/src/lib389/lib389/instance/remove.py
+++ b/src/lib389/lib389/instance/remove.py
@@ -11,7 +11,7 @@ import shutil
import subprocess
import logging
from lib389.nss_ssl import NssSsl
-from lib389.utils import selinux_label_port, assert_c, ensure_list_str
+from lib389.utils import selinux_label_port, assert_c, ensure_str, ensure_list_str
######################## WARNING #############################
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 2 months
[389-ds-base] branch 389-ds-base-1.3.10 updated: Issue 50599 - Remove db region files prior to db recovery
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.3.10
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.3.10 by this push:
new 73928c4 Issue 50599 - Remove db region files prior to db recovery
73928c4 is described below
commit 73928c4bea7e0151180c3e9b86066b1473def577
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Tue Jan 14 14:25:25 2020 -0500
Issue 50599 - Remove db region files prior to db recovery
Bug Description: If the server crashes then the region files can become
corrupted and this prevents the server from starting.
Fix Description: If we encounter a disorderly shutdown, then remove
the region files so there is a clean slate to start
with.
relates: https://pagure.io/389-ds-base/issue/50599
Reviewed by: firstyear & lkrispen (Thanks!!)
---
ldap/servers/slapd/back-ldbm/dblayer.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index 64a4e9e..f679bb1 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -66,6 +66,7 @@
#include <prclist.h>
#include <sys/types.h>
#include <sys/statvfs.h>
+#include <glob.h>
#define DB_OPEN(oflags, db, txnid, file, database, type, flags, mode, rval) \
{ \
@@ -1362,9 +1363,20 @@ dblayer_start(struct ldbminfo *li, int dbmode)
slapi_log_err(SLAPI_LOG_NOTICE, "dblayer_start", "Clean up db environment and start "
"from archive.\n");
} else {
+ glob_t globbuf;
+ char file_pattern[MAXPATHLEN];
slapi_log_err(SLAPI_LOG_NOTICE, "dblayer_start", "Detected Disorderly Shutdown last "
"time Directory Server was running, recovering database.\n");
slapi_disordely_shutdown(PR_TRUE);
+
+ /* 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) {
+ for (size_t i = 0; i < globbuf.gl_pathc; i++) {
+ remove(globbuf.gl_pathv[i]);
+ }
+ globfree(&globbuf);
+ }
}
}
switch (dbmode & DBLAYER_RESTORE_MASK) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 2 months
[389-ds-base] branch 389-ds-base-1.4.1 updated: Issue 50599 - Remove db region files prior to db recovery
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.1
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.1 by this push:
new 9f3f5d5 Issue 50599 - Remove db region files prior to db recovery
9f3f5d5 is described below
commit 9f3f5d5ea98ac8ee6f7a694512f310769ecfaa60
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Tue Jan 14 14:25:25 2020 -0500
Issue 50599 - Remove db region files prior to db recovery
Bug Description: If the server crashes then the region files can become
corrupted and this prevents the server from starting.
Fix Description: If we encounter a disorderly shutdown, then remove
the region files so there is a clean slate to start
with.
relates: https://pagure.io/389-ds-base/issue/50599
Reviewed by: firstyear & lkrispen (Thanks!!)
---
ldap/servers/slapd/back-ldbm/dblayer.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index 8c93119..3d4abda 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -66,6 +66,7 @@
#include <prclist.h>
#include <sys/types.h>
#include <sys/statvfs.h>
+#include <glob.h>
#define DB_OPEN(oflags, db, txnid, file, database, type, flags, mode, rval) \
{ \
@@ -1362,9 +1363,20 @@ dblayer_start(struct ldbminfo *li, int dbmode)
slapi_log_err(SLAPI_LOG_NOTICE, "dblayer_start", "Clean up db environment and start "
"from archive.\n");
} else {
+ glob_t globbuf;
+ char file_pattern[MAXPATHLEN];
slapi_log_err(SLAPI_LOG_NOTICE, "dblayer_start", "Detected Disorderly Shutdown last "
"time Directory Server was running, recovering database.\n");
slapi_disordely_shutdown(PR_TRUE);
+
+ /* 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) {
+ for (size_t i = 0; i < globbuf.gl_pathc; i++) {
+ remove(globbuf.gl_pathv[i]);
+ }
+ globfree(&globbuf);
+ }
}
}
switch (dbmode & DBLAYER_RESTORE_MASK) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 2 months
[389-ds-base] branch 389-ds-base-1.4.2 updated: Issue 50599 - Remove db region files prior to db recovery
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.2
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.2 by this push:
new f09adba Issue 50599 - Remove db region files prior to db recovery
f09adba is described below
commit f09adba48ef8a92f6acf171c5a00d2d520111f32
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Sun Jan 12 20:11:07 2020 -0500
Issue 50599 - Remove db region files prior to db recovery
Bug Description: If the server crashes then the region files can become
corrupted and this prevents the server from starting.
Fix Description: If we encounter a disorderly shutdown, then remove
the region files so there is a clean slate to start
with.
Also cleaned up function typo: slapi_disordely_shutdown
relates: https://pagure.io/389-ds-base/issue/50599
Reviewed by: firstyear & lkrispen (Thanks!!)
---
ldap/servers/plugins/replication/repl5_replica.c | 4 +-
ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c | 88 +++++++++++++-----------
ldap/servers/slapd/plugin.c | 8 +--
ldap/servers/slapd/slapi-plugin.h | 2 +-
4 files changed, 54 insertions(+), 48 deletions(-)
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
index 94507bf..02caa88 100644
--- a/ldap/servers/plugins/replication/repl5_replica.c
+++ b/ldap/servers/plugins/replication/repl5_replica.c
@@ -1657,7 +1657,7 @@ replica_check_for_data_reload(Replica *r, void *arg __attribute__((unused)))
* sessions.
*/
- if (slapi_disordely_shutdown(PR_FALSE)) {
+ if (slapi_disorderly_shutdown(PR_FALSE)) {
slapi_log_err(SLAPI_LOG_WARNING, repl_plugin_name, "replica_check_for_data_reload - "
"Disorderly shutdown for replica %s. Check if DB RUV needs to be updated\n",
slapi_sdn_get_dn(r->repl_root));
@@ -1701,7 +1701,7 @@ replica_check_for_data_reload(Replica *r, void *arg __attribute__((unused)))
slapi_sdn_get_dn(r->repl_root));
rc = 0;
}
- } /* slapi_disordely_shutdown */
+ } /* slapi_disorderly_shutdown */
object_release(ruv_obj);
} else /* we have no changes currently logged for this replica */
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 e02fc07..a929c88 100644
--- a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c
+++ b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c
@@ -15,6 +15,8 @@
#include <prclist.h>
#include <sys/types.h>
#include <sys/statvfs.h>
+#include <glob.h>
+
#define DB_OPEN(oflags, db, txnid, file, database, type, flags, mode, rval) \
{ \
@@ -990,10 +992,9 @@ bdb_start(struct ldbminfo *li, int dbmode)
return_value = dblayer_grok_directory(region_dir,
DBLAYER_DIRECTORY_READWRITE_ACCESS);
if (0 != return_value) {
- slapi_log_err(SLAPI_LOG_CRIT, "bdb_start", "Can't start because the database "
- "directory \"%s\" either doesn't exist, or is not "
- "accessible\n",
- region_dir);
+ slapi_log_err(SLAPI_LOG_CRIT, "bdb_start",
+ "Can't start because the database directory \"%s\" either doesn't exist, or is not accessible\n",
+ region_dir);
return return_value;
}
@@ -1003,10 +1004,9 @@ bdb_start(struct ldbminfo *li, int dbmode)
return_value = dblayer_grok_directory(log_dir,
DBLAYER_DIRECTORY_READWRITE_ACCESS);
if (0 != return_value) {
- slapi_log_err(SLAPI_LOG_CRIT, "bdb_start", "Can't start because the log "
- "directory \"%s\" either doesn't exist, or is not "
- "accessible\n",
- log_dir);
+ slapi_log_err(SLAPI_LOG_CRIT, "bdb_start",
+ "Can't start because the log directory \"%s\" either doesn't exist, or is not accessible\n",
+ log_dir);
return return_value;
}
}
@@ -1057,15 +1057,27 @@ bdb_start(struct ldbminfo *li, int dbmode)
if (conf->bdb_recovery_required) {
open_flags |= DB_RECOVER;
if (DBLAYER_RESTORE_MODE & dbmode) {
- slapi_log_err(SLAPI_LOG_NOTICE, "bdb_start", "Recovering database after restore "
- "from archive.\n");
+ slapi_log_err(SLAPI_LOG_NOTICE, "bdb_start",
+ "Recovering database after restore from archive.\n");
} else if (DBLAYER_CLEAN_RECOVER_MODE & dbmode) {
- slapi_log_err(SLAPI_LOG_NOTICE, "bdb_start", "Clean up db environment and start "
- "from archive.\n");
+ slapi_log_err(SLAPI_LOG_NOTICE, "bdb_start",
+ "Clean up db environment and start from archive.\n");
} else {
- slapi_log_err(SLAPI_LOG_NOTICE, "bdb_start", "Detected Disorderly Shutdown last "
- "time Directory Server was running, recovering database.\n");
- slapi_disordely_shutdown(PR_TRUE);
+ glob_t globbuf;
+ char file_pattern[MAXPATHLEN];
+
+ slapi_log_err(SLAPI_LOG_NOTICE, "bdb_start",
+ "Detected Disorderly Shutdown last time Directory Server was running, recovering database.\n");
+ slapi_disorderly_shutdown(PR_TRUE);
+
+ /* 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) {
+ for (size_t i = 0; i < globbuf.gl_pathc; i++) {
+ remove(globbuf.gl_pathv[i]);
+ }
+ globfree(&globbuf);
+ }
}
}
switch (dbmode & DBLAYER_RESTORE_MASK) {
@@ -1121,7 +1133,7 @@ bdb_start(struct ldbminfo *li, int dbmode)
*/
if (conf->bdb_lock_config <= BDB_LOCK_NB_MIN) {
slapi_log_err(SLAPI_LOG_NOTICE, "bdb_start", "New max db lock count is too small. "
- "Resetting it to the default value %d.\n",
+ "Resetting it to the default value %d.\n",
BDB_LOCK_NB_MIN);
conf->bdb_lock_config = BDB_LOCK_NB_MIN;
}
@@ -1165,29 +1177,26 @@ bdb_start(struct ldbminfo *li, int dbmode)
if ((open_flags & DB_RECOVER) || (open_flags & DB_RECOVER_FATAL)) {
/* Recover, then close, then open again */
int recover_flags = open_flags & ~DB_THREAD;
-
if (DBLAYER_CLEAN_RECOVER_MODE & dbmode) /* upgrade case */
{
DB_ENV *thisenv = pEnv->bdb_DB_ENV;
return_value = thisenv->remove(thisenv, region_dir, DB_FORCE);
if (0 != return_value) {
- slapi_log_err(SLAPI_LOG_CRIT,
- "bdb_start", "Failed to remove old db env "
- "in %s: %s\n",
- region_dir,
- dblayer_strerror(return_value));
+ slapi_log_err(SLAPI_LOG_CRIT, "bdb_start",
+ "Failed to remove old db env in %s: %s\n",
+ region_dir, dblayer_strerror(return_value));
return return_value;
}
dbmode = DBLAYER_NORMAL_MODE;
if ((return_value = bdb_make_env(&pEnv, li)) != 0) {
- slapi_log_err(SLAPI_LOG_CRIT,
- "bdb_start", "Failed to create DBENV (returned: %d).\n",
- return_value);
+ slapi_log_err(SLAPI_LOG_CRIT, "bdb_start",
+ "Failed to create DBENV (returned: %d).\n", return_value);
return return_value;
}
}
+
return_value = (pEnv->bdb_DB_ENV->open)(
pEnv->bdb_DB_ENV,
region_dir,
@@ -1201,27 +1210,25 @@ bdb_start(struct ldbminfo *li, int dbmode)
*/
slapi_log_err(SLAPI_LOG_CRIT,
"bdb_start", "mmap in opening database environment (recovery mode) "
- "failed trying to allocate %" PRIu64 " bytes. (OS err %d - %s)\n",
+ "failed trying to allocate %" PRIu64 " bytes. (OS err %d - %s)\n",
li->li_dbcachesize, return_value, dblayer_strerror(return_value));
bdb_free_env(&priv->dblayer_env);
priv->dblayer_env = CATASTROPHIC;
} else {
slapi_log_err(SLAPI_LOG_CRIT, "bdb_start", "Database Recovery Process FAILED. "
- "The database is not recoverable. err=%d: %s\n",
+ "The database is not recoverable. err=%d: %s\n",
return_value, dblayer_strerror(return_value));
- slapi_log_err(SLAPI_LOG_CRIT,
- "bdb_start", "Please make sure there is enough disk space for "
- "dbcache (%" PRIu64 " bytes) and db region files\n",
- li->li_dbcachesize);
+ slapi_log_err(SLAPI_LOG_CRIT, "bdb_start",
+ "Please make sure there is enough disk space for dbcache (%" PRIu64 " bytes) and db region files\n",
+ li->li_dbcachesize);
}
return return_value;
} else {
open_flags &= ~(DB_RECOVER | DB_RECOVER_FATAL);
pEnv->bdb_DB_ENV->close(pEnv->bdb_DB_ENV, 0);
if ((return_value = bdb_make_env(&pEnv, li)) != 0) {
- slapi_log_err(SLAPI_LOG_CRIT,
- "bdb_start", "Failed to create DBENV (returned: %d).\n",
- return_value);
+ slapi_log_err(SLAPI_LOG_CRIT, "bdb_start",
+ "Failed to create DBENV (returned: %d).\n", return_value);
return return_value;
}
bdb_free_env(&priv->dblayer_env);
@@ -1288,16 +1295,15 @@ bdb_start(struct ldbminfo *li, int dbmode)
* https://blackflag.mcom.com/show_bug.cgi?id=557319
* Crash ns-slapd while running scalab01 after restart slapd
*/
- slapi_log_err(SLAPI_LOG_CRIT,
- "bdb_start", "mmap in opening database environment "
- "failed trying to allocate %" PRIu64 " bytes. (OS err %d - %s)\n",
- li->li_dbcachesize, return_value, dblayer_strerror(return_value));
+ slapi_log_err(SLAPI_LOG_CRIT, "bdb_start",
+ "mmap in opening database environment failed trying to allocate %" PRIu64 " bytes. (OS err %d - %s)\n",
+ li->li_dbcachesize, return_value, dblayer_strerror(return_value));
bdb_free_env(&priv->dblayer_env);
priv->dblayer_env = CATASTROPHIC;
} else {
- slapi_log_err(SLAPI_LOG_CRIT,
- "bdb_start", "Opening database environment (%s) failed. err=%d: %s\n",
- region_dir, return_value, dblayer_strerror(return_value));
+ slapi_log_err(SLAPI_LOG_CRIT, "bdb_start",
+ "Opening database environment (%s) failed. err=%d: %s\n",
+ region_dir, return_value, dblayer_strerror(return_value));
}
}
return return_value;
diff --git a/ldap/servers/slapd/plugin.c b/ldap/servers/slapd/plugin.c
index b00c1bd..282b987 100644
--- a/ldap/servers/slapd/plugin.c
+++ b/ldap/servers/slapd/plugin.c
@@ -4383,14 +4383,14 @@ slapi_set_plugin_open_rootdn_bind(Slapi_PBlock *pb)
}
PRBool
-slapi_disordely_shutdown(PRBool set)
+slapi_disorderly_shutdown(PRBool set)
{
- static PRBool is_disordely_shutdown = PR_FALSE;
+ static PRBool is_disorderly_shutdown = PR_FALSE;
if (set) {
- is_disordely_shutdown = PR_TRUE;
+ is_disorderly_shutdown = PR_TRUE;
}
- return (is_disordely_shutdown);
+ return (is_disorderly_shutdown);
}
/*
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index adcc349..40b5c91 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -7901,7 +7901,7 @@ uint64_t slapi_str_to_u64(const char *s);
void slapi_set_plugin_open_rootdn_bind(Slapi_PBlock *pb);
-PRBool slapi_disordely_shutdown(PRBool set);
+PRBool slapi_disorderly_shutdown(PRBool set);
/*
* Public entry extension getter/setter functions
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 2 months