diff --git a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_bdbreader_glue.c b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_bdbreader_glue.c index 539bb9d73..77cb1570e 100644 --- a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_bdbreader_glue.c +++ b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_bdbreader_glue.c @@ -9,8 +9,6 @@ #include "bdb_layer.h" #include -#define DEBUG 1 - /* * This file contains the stub that transform usual bdb API (limited to the function 389-ds needs to export a db and a changelog * to bdb_ro callbacks @@ -248,7 +246,7 @@ int db_close(DB *db, u_int32_t flags) int dbc_close(DBC *dbc) { - bdbreader_bdb_close(dbc->impl); + bdbreader_cur_close(dbc->impl); dbc->impl = NULL; slapi_ch_free((void **)&dbc); return DB_SUCCESS; diff --git a/ldap/servers/slapd/back-ldbm/dbimpl.c b/ldap/servers/slapd/back-ldbm/dbimpl.c index 487dc44d1..f00779c3c 100644 --- a/ldap/servers/slapd/back-ldbm/dbimpl.c +++ b/ldap/servers/slapd/back-ldbm/dbimpl.c @@ -397,7 +397,6 @@ const char *dblayer_op2str(dbi_op_t op) return str[idx]; } -<<<<<<< HEAD /* Get the li_directory directory from the database instance name - * Caller should free the returned value */ @@ -440,8 +439,6 @@ get_li_directory(const char *fname) } /* Open db env, db and db file privately (for dbscan) */ -======= -/* Open db env, db and db file privately (used by dbscan) */ int dblayer_private_open(const char *plgname, const char *dbfilename, int rw, Slapi_Backend **be, dbi_env_t **env, dbi_db_t **db) { struct ldbminfo *li; diff --git a/lib/librobdb/README.md b/lib/librobdb/README.md index c2c87cf6e..a79bca9ea 100644 --- a/lib/librobdb/README.md +++ b/lib/librobdb/README.md @@ -18,9 +18,13 @@ See test/test.c (Using a 389ds entries database as example, It shows how to dump # Running tests dnf install -y dist/RPMS/*/*.rpm - make test +or + +make localtest + + # LICENSE Same as lib part for rpm: GPLv2 or alternatively LGPL (See COPYING and COPYING.RPM for full details) diff --git a/lib/librobdb/robdb.spec b/lib/librobdb/robdb.spec index f7072d9b6..0bf415072 100644 --- a/lib/librobdb/robdb.spec +++ b/lib/librobdb/robdb.spec @@ -3,9 +3,9 @@ Version: 1.1 Release: %{autorelease -n %{?dist}} Summary: Provide basic functions to search and read Berkeley Database records -License: GPL-2.0-or-later +License: GPL-2.0-or-later OR LGPL-2.1-or-later URL: https://github.com/389ds/389-ds-base/lib/librobdb -Source0: %{name}-%{version}.tar.bz2 +Source0: %{name}-%{version}.tar.bz2 BuildRequires: gcc # Requires: @@ -46,6 +46,9 @@ some basic functions to search and read Berkeley Database records %{?ldconfig_scriptlets} +%check +make localtest + %files libs %license COPYING COPYING.RPM diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in index c684d5a90..b01ea9a16 100644 --- a/rpm/389-ds-base.spec.in +++ b/rpm/389-ds-base.spec.in @@ -582,11 +582,11 @@ if ! make DESTDIR="$RPM_BUILD_ROOT" check; then cat ./test-suite.log && false; f %post if [ -n "$DEBUGPOSTTRANS" ] ; then -output=$DEBUGPOSTTRANS -output2=${DEBUGPOSTTRANS}.upgrade + output=$DEBUGPOSTTRANS + output2=${DEBUGPOSTTRANS}.upgrade else -output=/dev/null -output2=/dev/null + output=/dev/null + output2=/dev/null fi # reload to pick up any changes to systemd files @@ -606,11 +606,11 @@ HOMEDIR="/usr/share/dirsrv" getent group $GROUPNAME >/dev/null || groupadd -f -g $ALLOCATED_GID -r $GROUPNAME if ! getent passwd $USERNAME >/dev/null ; then -if ! getent passwd $ALLOCATED_UID >/dev/null ; then -useradd -r -u $ALLOCATED_UID -g $GROUPNAME -d $HOMEDIR -s /sbin/nologin -c "user for 389-ds-base" $USERNAME -else -useradd -r -g $GROUPNAME -d $HOMEDIR -s /sbin/nologin -c "user for 389-ds-base" $USERNAME -fi + if ! getent passwd $ALLOCATED_UID >/dev/null ; then + useradd -r -u $ALLOCATED_UID -g $GROUPNAME -d $HOMEDIR -s /sbin/nologin -c "user for 389-ds-base" $USERNAME + else + useradd -r -g $GROUPNAME -d $HOMEDIR -s /sbin/nologin -c "user for 389-ds-base" $USERNAME + fi fi # Reload our sysctl before we restart (if we can) @@ -620,46 +620,46 @@ sysctl --system &> $output; true instbase="%{_sysconfdir}/%{pkgname}" ninst=0 for dir in $instbase/slapd-* ; do -echo dir = $dir >> $output 2>&1 || : -if [ ! -d "$dir" ] ; then continue ; fi -case "$dir" in *.removed) continue ;; esac -basename=`basename $dir` -inst="%{pkgname}@`echo $basename | sed -e 's/slapd-//g'`" -echo found instance $inst - getting status >> $output 2>&1 || : -if /bin/systemctl -q is-active $inst ; then -echo instance $inst is running >> $output 2>&1 || : -instances="$instances $inst" -else -echo instance $inst is not running >> $output 2>&1 || : -fi -ninst=`expr $ninst + 1` + echo dir = $dir >> $output 2>&1 || : + if [ ! -d "$dir" ] ; then continue ; fi + case "$dir" in *.removed) continue ;; esac + basename=`basename $dir` + inst="%{pkgname}@`echo $basename | sed -e 's/slapd-//g'`" + echo found instance $inst - getting status >> $output 2>&1 || : + if /bin/systemctl -q is-active $inst ; then + echo instance $inst is running >> $output 2>&1 || : + instances="$instances $inst" + else + echo instance $inst is not running >> $output 2>&1 || : + fi + ninst=`expr $ninst + 1` done if [ $ninst -eq 0 ] ; then -echo no instances to upgrade >> $output 2>&1 || : -exit 0 # have no instances to upgrade - just skip the rest + echo no instances to upgrade >> $output 2>&1 || : + exit 0 # have no instances to upgrade - just skip the rest else -# restart running instances -echo shutting down all instances . . . >> $output 2>&1 || : -for inst in $instances ; do -echo stopping instance $inst >> $output 2>&1 || : -/bin/systemctl stop $inst >> $output 2>&1 || : -done -for inst in $instances ; do -echo starting instance $inst >> $output 2>&1 || : -/bin/systemctl start $inst >> $output 2>&1 || : -done + # restart running instances + echo shutting down all instances . . . >> $output 2>&1 || : + for inst in $instances ; do + echo stopping instance $inst >> $output 2>&1 || : + /bin/systemctl stop $inst >> $output 2>&1 || : + done + for inst in $instances ; do + echo starting instance $inst >> $output 2>&1 || : + /bin/systemctl start $inst >> $output 2>&1 || : + done fi %preun if [ $1 -eq 0 ]; then # Final removal -# remove instance specific service files/links -rm -rf %{_sysconfdir}/systemd/system/%{groupname}.wants/* > /dev/null 2>&1 || : + # remove instance specific service files/links + rm -rf %{_sysconfdir}/systemd/system/%{groupname}.wants/* > /dev/null 2>&1 || : fi %postun if [ $1 = 0 ]; then # Final removal -rm -rf /var/run/%{pkgname} + rm -rf /var/run/%{pkgname} fi %post snmp