Wednesday, April 22, 2020

[389-commits] [389-ds-base] branch 389-ds-base-1.4.3 updated: Issue 49731 - undo db_home_dir under /dev/shm/dirsrv for now

This is an automated email from the git hooks/post-receive script.

mreynolds 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 8fbdf92 Issue 49731 - undo db_home_dir under /dev/shm/dirsrv for now
8fbdf92 is described below

commit 8fbdf92aca65fde081604babbaa13047c066d214
Author: Mark Reynolds <mreynolds@redhat.com>
AuthorDate: Tue Apr 21 14:48:11 2020 -0400

Issue 49731 - undo db_home_dir under /dev/shm/dirsrv for now

Bug Description: There are several issues with using /dec/shm/disrv/
for the db home directory. Cantainers have issues,
and system reboots can cause issues too.

Fix Description: Using just /dev/shm/slapd-INST solves all the permission
issues, but that requires a new selinux label, so
for now we will just set the db home directory to the
database directory (effectively disabling the change).

relates: https://pagure.io/389-ds-base/issue/49731

Reviewed by: firstyear & tbordaz(Thanks!)
---
ldap/admin/src/defaults.inf.in | 2 +-
ldap/servers/slapd/util.c | 2 +-
rpm/389-ds-base.spec.in | 2 --
src/lib389/lib389/instance/setup.py | 4 ++--
4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/ldap/admin/src/defaults.inf.in b/ldap/admin/src/defaults.inf.in
index 23ea09d..2f630f9 100644
--- a/ldap/admin/src/defaults.inf.in
+++ b/ldap/admin/src/defaults.inf.in
@@ -58,7 +58,7 @@ access_log = @localstatedir@/log/dirsrv/slapd-{instance_name}/access
audit_log = @localstatedir@/log/dirsrv/slapd-{instance_name}/audit
error_log = @localstatedir@/log/dirsrv/slapd-{instance_name}/errors
db_dir = @localstatedir@/lib/dirsrv/slapd-{instance_name}/db
-db_home_dir = /dev/shm/dirsrv/slapd-{instance_name}
+db_home_dir = @localstatedir@/lib/dirsrv/slapd-{instance_name}/db
backup_dir = @localstatedir@/lib/dirsrv/slapd-{instance_name}/bak
ldif_dir = @localstatedir@/lib/dirsrv/slapd-{instance_name}/ldif

diff --git a/ldap/servers/slapd/util.c b/ldap/servers/slapd/util.c
index e563528..b4f31ff 100644
--- a/ldap/servers/slapd/util.c
+++ b/ldap/servers/slapd/util.c
@@ -471,7 +471,7 @@ slapi_escape_filter_value(char *filter_str, int len)
void
replace_char(char *str, char c, char c2)
{
- for (size_t i = 0; (str != NULL) && (str[i] != NULL); i++) {
+ for (size_t i = 0; (str != NULL) && (str[i] != '\0'); i++) {
if (c == str[i]) {
str[i] = c2;
}
diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in
index d633732..b9f8548 100644
--- a/rpm/389-ds-base.spec.in
+++ b/rpm/389-ds-base.spec.in
@@ -431,7 +431,6 @@ popd
mkdir -p $RPM_BUILD_ROOT/var/log/%{pkgname}
mkdir -p $RPM_BUILD_ROOT/var/lib/%{pkgname}
mkdir -p $RPM_BUILD_ROOT/var/lock/%{pkgname}
-mkdir -p $RPM_BUILD_ROOT/dev/shm/%{pkgname}

# for systemd
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/systemd/system/%{groupname}.wants
@@ -637,7 +636,6 @@ exit 0
%{_prefix}/lib/sysctl.d/*
%dir %{_localstatedir}/lib/%{pkgname}
%dir %{_localstatedir}/log/%{pkgname}
-%dir /dev/shm/%{pkgname}
%ghost %dir %{_localstatedir}/lock/%{pkgname}
%exclude %{_sbindir}/ldap-agent*
%exclude %{_mandir}/man1/ldap-agent.1.gz
diff --git a/src/lib389/lib389/instance/setup.py b/src/lib389/lib389/instance/setup.py
index bc514c7..8039922 100644
--- a/src/lib389/lib389/instance/setup.py
+++ b/src/lib389/lib389/instance/setup.py
@@ -747,7 +747,7 @@ class SetupDs(object):

# Create all the needed paths
# we should only need to make bak_dir, cert_dir, config_dir, db_dir, ldif_dir, lock_dir, log_dir, run_dir?
- for path in ('backup_dir', 'cert_dir', 'db_dir', 'db_home_dir', 'ldif_dir', 'lock_dir', 'log_dir', 'run_dir'):
+ for path in ('backup_dir', 'cert_dir', 'db_dir', 'ldif_dir', 'lock_dir', 'log_dir', 'run_dir'):
self.log.debug("ACTION: creating %s", slapd[path])
try:
os.umask(0o007) # For parent dirs that get created -> sets 770 for perms
@@ -868,7 +868,7 @@ class SetupDs(object):
# Do selinux fixups
if general['selinux']:
selinux_paths = ('backup_dir', 'cert_dir', 'config_dir', 'db_dir',
- 'db_home_dir', 'ldif_dir', 'lock_dir', 'log_dir',
+ 'ldif_dir', 'lock_dir', 'log_dir',
'run_dir', 'schema_dir', 'tmp_dir')
for path in selinux_paths:
selinux_restorecon(slapd[path])

--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
389-commits mailing list -- 389-commits@lists.fedoraproject.org
To unsubscribe send an email to 389-commits-leave@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/389-commits@lists.fedoraproject.org

No comments:

Post a Comment