Your message dated Wed, 23 Sep 2009 16:56:44 +0000
with message-id <[email protected]>
and subject line Bug#517556: fixed in openldap 2.4.17-2
has caused the Debian Bug report #517556,
regarding upgrading slapd fails with multiple databases and dbconfig settings 
in slapd.conf
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
517556: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=517556
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: slapd
Version: 2.4.15-1pm1
Severity: important
Tags: patch

Hi,

on an update from versions below 2.1.14 slapd 2.1.15's postinst script
dumps and reloads the databases.
When trying to relaod the databases the postinst script checks whether the
database directory is empty.
Unfortunately this fails on the second database when slapd.conf contains
"dbconfig" settings.

Cause:
When creating the first database slapadd creates DB_CONFIG files in the
directories of all databases with "dbconfig" settings in slapd.conf.

The attached patch changes the reload routine so that it accepts a
DB_CONFIG in an otherwise empty directory. This makes the upgrade.

This - freshly created - DB_CONFIG file will not be overwritten from
a DB_CONFIG file from the backup (rationale: the admin gave these values
in slapd.conf - no need to get something back from backup).

In addition to that the patch fixes a warning message generated by find
because of the wrong order of parameters.

Hope it helps
Peter

PS: Don't worry about the version number: it's Debian's slapd + the attached 
patch.



-- System Information:
Debian Release: 5.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages slapd depends on:
ii  adduser                  3.110           add and remove users and groups
ii  coreutils                6.10-6          The GNU core utilities
ii  debconf [debconf-2.0]    1.5.24          Debian configuration management sy
ii  libc6                    2.7-18          GNU C Library: Shared libraries
ii  libdb4.7                 4.7.25-6        Berkeley v4.7 Database Libraries [
ii  libgnutls26              2.6.4-2         the GNU TLS library - runtime libr
ii  libgssapi2-heimdal       1.2.dfsg.1-2.1  Heimdal Kerberos - GSSAPI support 
ii  libldap-2.4-2            2.4.15-1pm1     OpenLDAP libraries
ii  libltdl3                 1.5.26-4        A system independent dlopen wrappe
ii  libperl5.10              5.10.0-19       Shared Perl library
ii  libsasl2-2               2.1.22.dfsg1-23 Cyrus SASL - authentication abstra
ii  libslp1                  1.2.1-7.5       OpenSLP libraries
ii  libwrap0                 7.6.q-16        Wietse Venema's TCP wrappers libra
ii  perl [libmime-base64-per 5.10.0-19       Larry Wall's Practical Extraction 
ii  psmisc                   22.6-1          Utilities that use the proc filesy
ii  unixodbc                 2.2.11-16       ODBC tools libraries

Versions of packages slapd recommends:
ii  libsasl2-modules         2.1.22.dfsg1-23 Cyrus SASL - pluggable authenticat

Versions of packages slapd suggests:
ii  ldap-utils                   2.4.15-1pm1 OpenLDAP utilities

-- debconf information:
  slapd/tlsciphersuite:
  shared/organization: adpm.de
  slapd/upgrade_slapcat_failure:
  slapd/backend: HDB
  slapd/allow_ldap_v2: false
  slapd/no_configuration: false
  slapd/move_old_database: true
  slapd/suffix_change: false
  slapd/dump_database_destdir: /var/backups/slapd-VERSION
  slapd/domain: adpm.de
  slapd/password_mismatch:
  slapd/invalid_config: true
  slapd/slurpd_obsolete:
  slapd/dump_database: when needed
  slapd/migrate_ldbm_to_bdb: false
  slapd/purge_database: false
--- debian/slapd.scripts-common
+++ debian/slapd.scripts-common 2009-02-28 14:14:36.000000000 +0100
@@ -160,7 +160,8 @@
        for db in `get_database_list`; do
                suffix=`get_suffix $db`
                dbdir=`get_directory $db`
-               if ! is_empty_dir "$dbdir"; then
+               if ! is_empty_dir "$dbdir" &&
+                  ! dir_only_contains_DB_CONFIG "$dbdir"; then
                        echo >&2 \
                          "  Directory $dbdir for $suffix not empty, aborting."
                        exit 1
@@ -169,13 +170,16 @@
                file="$dir/$suffix.ldif"
                echo -n "  - directory $suffix... " >&2
 
-               # If there is an old DB_CONFIG file, restore it before
-               # running slapadd
-               backupdir=`compute_backup_path -n "$dbdir" "$suffix"`
-               if [ -e "$backupdir"/DB_CONFIG ]; then
-                       cp -a "$backupdir"/DB_CONFIG "$dbdir"/
-               else
-                       copy_example_DB_CONFIG "$dbdir"/
+               # If there is no DB_CONFIG file in the database dir, but
+               # an old DB_CONFIG file in the backup dir,
+               # restore it before running slapadd
+               if [ ! -e "$dbdir"/DB_CONFIG ]; then
+                       backupdir=`compute_backup_path -n "$dbdir" "$suffix"`
+                       if [ -e "$backupdir"/DB_CONFIG ]; then
+                               cp -a "$backupdir"/DB_CONFIG "$dbdir"/
+                       else
+                               copy_example_DB_CONFIG "$dbdir"/
+                       fi
                fi
 
                capture_diagnostics slapadd -q -b "$suffix" -l "$file" \
@@ -1014,7 +1018,7 @@
 # Check if a path refers to an empty directory
 # Usage: if is_empty_dir "$dir"; then ... fi
 
-       output=`find "$1" -type d -maxdepth 0 -empty 2>/dev/null`
+       output=`find "$1" -maxdepth 0 -type d -empty 2>/dev/null`
        if [ "$output" ]; then
                return 0
        else
@@ -1024,6 +1028,24 @@
 
 # }}}
 
+# }}}
+dir_only_contains_DB_CONFIG() {                                                
        # {{{
+# Check if a path refers to a directory
+# that is empty or contains only DB_CONFIG
+# Usage: if dir_only_contains_DB_CONFIG "$dir"; then ... fi
+
+       test -d "$1" || return 1
+
+       output=`find "$1" -mindepth 1 -maxdepth 1 2>/dev/null | grep -v 
/DB_CONFIG$`
+       if [ "$output" ]; then
+               return 1
+       else
+               return 0
+       fi
+}
+
+# }}}
+
 # ===== Global variables ================================================ {{{
 #
 # At some points we need to know which version we are upgrading from if

--- End Message ---
--- Begin Message ---
Source: openldap
Source-Version: 2.4.17-2

We believe that the bug you reported is fixed in the latest version of
openldap, which is due to be installed in the Debian FTP archive:

ldap-utils_2.4.17-2_amd64.deb
  to pool/main/o/openldap/ldap-utils_2.4.17-2_amd64.deb
libldap-2.4-2-dbg_2.4.17-2_amd64.deb
  to pool/main/o/openldap/libldap-2.4-2-dbg_2.4.17-2_amd64.deb
libldap-2.4-2_2.4.17-2_amd64.deb
  to pool/main/o/openldap/libldap-2.4-2_2.4.17-2_amd64.deb
libldap2-dev_2.4.17-2_amd64.deb
  to pool/main/o/openldap/libldap2-dev_2.4.17-2_amd64.deb
openldap_2.4.17-2.diff.gz
  to pool/main/o/openldap/openldap_2.4.17-2.diff.gz
openldap_2.4.17-2.dsc
  to pool/main/o/openldap/openldap_2.4.17-2.dsc
slapd-dbg_2.4.17-2_amd64.deb
  to pool/main/o/openldap/slapd-dbg_2.4.17-2_amd64.deb
slapd_2.4.17-2_amd64.deb
  to pool/main/o/openldap/slapd_2.4.17-2_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Steve Langasek <[email protected]> (supplier of updated openldap package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Tue, 22 Sep 2009 20:06:34 -0700
Source: openldap
Binary: slapd ldap-utils libldap-2.4-2 libldap-2.4-2-dbg libldap2-dev slapd-dbg
Architecture: source amd64
Version: 2.4.17-2
Distribution: unstable
Urgency: low
Maintainer: Debian OpenLDAP Maintainers 
<[email protected]>
Changed-By: Steve Langasek <[email protected]>
Description: 
 ldap-utils - OpenLDAP utilities
 libldap-2.4-2 - OpenLDAP libraries
 libldap-2.4-2-dbg - Debugging information for OpenLDAP libraries
 libldap2-dev - OpenLDAP development libraries
 slapd      - OpenLDAP server (slapd)
 slapd-dbg  - Debugging information for the OpenLDAP server (slapd)
Closes: 517556 545898 546885
Changes: 
 openldap (2.4.17-2) unstable; urgency=low
 .
   * Fix up the lintian warnings:
     - add missing misc-depends on all packages
     - slapd, libldap-2.4-2-dbg sections changed to 'debug' to match archive
       overrides
     - bump Standards-Version to 3.8.2, no changes required.
   * slapd.scripts-common: fix upgrade to correctly handle multiple database
     declarations; thanks, Peter Marschall <[email protected]>!  Closes: #517556
   * Add 'status' argument to init script; thanks to Peter Eisentraut
     <[email protected]>.  Closes: #545898.
   * New patch, do-not-second-guess-sonames, to remove an incorrect check for
     the Cyrus SASL version number at runtime.  If there's any reason this is
     needed, it needs to be addressed in the cyrus-sasl soname and Debian
     shlibs, not here.  Closes: #546885.
Checksums-Sha1: 
 1f499a34faebc9dc21d141534f480c6a37edffe2 1809 openldap_2.4.17-2.dsc
 3c0a77de40b89373655ffef0bf680898752ac045 147903 openldap_2.4.17-2.diff.gz
 966f9a1c151ba57a97a9f915c350db844378772a 1567776 slapd_2.4.17-2_amd64.deb
 daee9eaf5bcdfca2a1876258b11a8e963824fa59 313308 ldap-utils_2.4.17-2_amd64.deb
 04b6c918f9ffdf8391cbcfddc942ebad6a9af626 208288 
libldap-2.4-2_2.4.17-2_amd64.deb
 cba3d509d2d7d31acbcb6e83d14dd0789925d614 315470 
libldap-2.4-2-dbg_2.4.17-2_amd64.deb
 1e5281ae8c10e2b4571cb7fe425c30bc9daebecc 1012224 
libldap2-dev_2.4.17-2_amd64.deb
 b870e4d12b1b66147f32b869a01d632821e85923 3933292 slapd-dbg_2.4.17-2_amd64.deb
Checksums-Sha256: 
 a04374eb4ead7a659baae215d3bba1e1af9c3c07dfacca2057cead99799d7294 1809 
openldap_2.4.17-2.dsc
 b95d5eb05e31fa3341a806c3d061d3ab4b05d803850561d9da709b27a8254c1d 147903 
openldap_2.4.17-2.diff.gz
 e08dc040d9b445da5520356705fe0a64c879ff0c6f73cbfc5c2d06a78cf21cb6 1567776 
slapd_2.4.17-2_amd64.deb
 97936910a7a86104433b6df8f7b63d1ea1a62e5045d748bfec621d146362db5d 313308 
ldap-utils_2.4.17-2_amd64.deb
 76c1a502f7e9791cd52afd0b6430c4b92bbd4a94d4128150a849dd995d0b6cbe 208288 
libldap-2.4-2_2.4.17-2_amd64.deb
 ab7d018914ab05d7eee310d19347e71d9c7a219649d33b19ad5512c200d13cfa 315470 
libldap-2.4-2-dbg_2.4.17-2_amd64.deb
 d43576b4fb0f23645f02db6c2a1318ce412fb7e3bacfe48dbde503bb6120e6b2 1012224 
libldap2-dev_2.4.17-2_amd64.deb
 385c84f27a9eeb685dcf1f74b34eb460815258e4ab9ab19b4acb2a73ce528e81 3933292 
slapd-dbg_2.4.17-2_amd64.deb
Files: 
 7ada1e23ec5013f3dcee42832242b72f 1809 net optional openldap_2.4.17-2.dsc
 b6a1c65bb391ae908715fa7613dd15b6 147903 net optional openldap_2.4.17-2.diff.gz
 b34cfeb92e7f586831d70f88eb1528c5 1567776 net optional slapd_2.4.17-2_amd64.deb
 82c95bbcd04949a5b48e3ec52f7a225c 313308 net optional 
ldap-utils_2.4.17-2_amd64.deb
 34c415ef11519678e1b337eeeb2279e6 208288 libs standard 
libldap-2.4-2_2.4.17-2_amd64.deb
 bf7933edd27e061ed74efc9cd4663427 315470 debug extra 
libldap-2.4-2-dbg_2.4.17-2_amd64.deb
 f3cb6730d0ea27b2e3daa6b330b7a3f8 1012224 libdevel extra 
libldap2-dev_2.4.17-2_amd64.deb
 cb7b46698f86fd8acafa7792e28bd400 3933292 debug extra 
slapd-dbg_2.4.17-2_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iD8DBQFKuikUKN6ufymYLloRAtKYAKDQRKcUCJEYpqRzH3j6yN95B2HpdACfYwXF
hIp1M9ekqrZCutAVl1X4R6w=
=phtB
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to