This is an automated email from the git hooks/post-receive script.
firstyear pushed a commit to branch 389-ds-base-1.4.3
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.3 by this push:
new 23e0d64 Ticket 50989 - ignore pid when it is ourself in protect_db
23e0d64 is described below
commit 23e0d64908b9480285b82670f9c850da48e3f107
Author: William Brown <william(a)blackhats.net.au>
AuthorDate: Mon Mar 30 12:37:23 2020 +1000
Ticket 50989 - ignore pid when it is ourself in protect_db
Bug Description: In protect_db.c, there are some cases (especially containers)
where a pid number can be re-used. Following a bad shutdown, the lock files
in /run/lock/{export,import,server}/* remain, and the pid they hold could
be allocated to ourself. When this occurs, the server fails to start.
Fix Description: If the pid of the lock file is our own pid, that is proof
that the previous pid/lock file can not exist, and therfore it is safe to
proceed with the startup.
https://pagure.io/389-ds-base/issue/50989
Author: William Brown <william(a)blackhats.net.au>
Review by: tbordaz (Thanks!)
---
ldap/servers/slapd/protect_db.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/ldap/servers/slapd/protect_db.c b/ldap/servers/slapd/protect_db.c
index ccde08b..c4d50d8 100644
--- a/ldap/servers/slapd/protect_db.c
+++ b/ldap/servers/slapd/protect_db.c
@@ -251,7 +251,19 @@ sample_and_update(char *dir_name)
* didn't put it there */
continue;
}
- if (is_process_up(pid)) {
+ if (pid == getpid()) {
+ /*
+ * We have re-used our pid number, and we are now checking for ourself!
+ *
+ * pagure:
https://pagure.io/389-ds-base/issue/50989
+ *
+ * This situation is common in containers, where the process name space means
we
+ * may be checking ourself, and have low pids that get re-used. Worse, we
cant
+ * actually check the pid of any other instance in a different container.
+ * So at the very least in THIS case, we ignore it, since we are the pid
+ * that has the lock, and it's probably a left over from a bad startup.
+ */
+ } else if (is_process_up(pid)) {
result = (long)pid;
} else {
PR_snprintf(file_name, MAXPATHLEN, "%s/%s", dir_name,
entry->name);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.