2012-05-24 09:36:54 |
Kenny Millington |
bug |
|
|
added bug |
2012-05-24 13:01:27 |
Scott Moser |
openldap (Ubuntu): importance |
Undecided |
Medium |
|
2012-05-24 13:01:27 |
Scott Moser |
openldap (Ubuntu): status |
New |
Confirmed |
|
2012-05-24 13:01:38 |
Scott Moser |
nominated for series |
|
Ubuntu Precise |
|
2012-05-24 13:01:38 |
Scott Moser |
bug task added |
|
openldap (Ubuntu Precise) |
|
2012-05-24 13:01:47 |
Scott Moser |
openldap (Ubuntu Precise): status |
New |
Confirmed |
|
2012-05-24 13:01:51 |
Scott Moser |
openldap (Ubuntu Precise): importance |
Undecided |
Medium |
|
2012-10-17 14:48:30 |
Maarten Rijke |
bug |
|
|
added subscriber Maarten Rijke |
2012-12-08 07:25:24 |
Rolf Leggewie |
tags |
|
lucid2precise |
|
2012-12-08 07:27:23 |
Rolf Leggewie |
tags |
lucid2precise |
lucid2precise patch |
|
2012-12-08 07:32:40 |
Rolf Leggewie |
openldap (Ubuntu Precise): assignee |
|
Rolf Leggewie (r0lf) |
|
2013-02-26 00:39:30 |
Rolf Leggewie |
openldap (Ubuntu Precise): assignee |
Rolf Leggewie (r0lf) |
|
|
2013-10-03 11:41:29 |
Paul Bergene |
description |
Hi,
I've just performed an upgrade of our LDAP server on Ubuntu 10.04.4 LTS to Ubuntu 12.04 (I acknowledge this upgrade path is not officially supported yet).
The incompatible database upgrading process in the preinst/postinst files failed in the following scenario.
We have two suffixes/databases at the following paths:-
* /var/lib/ldap
* /var/lib/ldap/accesslog
The preinst database dumping part of the process worked just fine and created the appropriate LDIF files under /var/backup/slapd-2.4.21-0ubuntu5.7, however the restore failed stating:-
"""
Loading from /var/backups/slapd-2.4.21-0ubuntu5.7:
- directory dc=REDACTEDs,dc=co,dc=uk... failed.
Loading the database from the LDIF dump failed with the following
error while running slapadd:
4fbdfebf olcDbDirectory: value #0: invalid path: No such file or directory
4fbdfebf config error processing olcDatabase={2}hdb,cn=config: olcDbDirectory: value #0: invalid path: No such file or directory
slapadd: bad configuration directory!
"""
This is because when move_incompatible_databases_away() runs it finds the main database first (/var/lib/ldap) and moves all top level entries (find -mindepth 1 -maxdepth 1 ...) into the backup directory and this includes the accesslog subdirectory which then no longer exists. When slapadd runs it checks config specifying that directory and bails with the above error given it is indeed missing.
I've tested a tentative fix and that's to patch the two find commands (one in is_empty_dir() one in move_old_database_away to also specify -type f so that the directory structure is preserved when moving the old database away (accesslog will be backed up separately when its suffx is iterated over in move_incompatible_databases_away()).
The simple and very tentative patch for this is:-
"""
# diff -u slapd.scripts-common.old slapd.scripts-common
--- slapd.scripts-common.old 2012-05-24 10:33:01.746206585 +0100
+++ slapd.scripts-common 2012-05-24 10:33:23.967902747 +0100
@@ -391,7 +391,7 @@
echo -n " - directory $suffix... " >&2
mkdir -p "$backupdir"
find "$databasedir" -mindepth 1 -maxdepth 1 \
- -exec mv {} "$backupdir" \;
+ -type f -exec mv {} "$backupdir" \;
echo done. >&2
else
cat >&2 <<EOF
@@ -728,7 +728,7 @@
# (i.e., contains no files except for an optional DB_CONFIG).
# Usage: if is_empty_dir "$dir"; then ... fi
- output=`find "$1" -mindepth 1 -maxdepth 1 \! -name DB_CONFIG 2>/dev/null`
+ output=`find "$1" -mindepth 1 -maxdepth 1 -type f \! -name DB_CONFIG 2>/dev/null`
if [ -n "$output" ]; then
return 1
else
""" |
Hi,
I've just performed an upgrade of our LDAP server on Ubuntu 10.04.4 LTS to Ubuntu 12.04 (I acknowledge this upgrade path is not officially supported yet).
The incompatible database upgrading process in the preinst/postinst files failed in the following scenario.
We have two suffixes/databases at the following paths:-
* /var/lib/ldap
* /var/lib/ldap/accesslog
The preinst database dumping part of the process worked just fine and created the appropriate LDIF files under /var/backup/slapd-2.4.21-0ubuntu5.7, however the restore failed stating:-
"""
Loading from /var/backups/slapd-2.4.21-0ubuntu5.7:
- directory dc=REDACTEDs,dc=co,dc=uk... failed.
Loading the database from the LDIF dump failed with the following
error while running slapadd:
4fbdfebf olcDbDirectory: value #0: invalid path: No such file or directory
4fbdfebf config error processing olcDatabase={2}hdb,cn=config: olcDbDirectory: value #0: invalid path: No such file or directory
slapadd: bad configuration directory!
"""
This is because when move_incompatible_databases_away() runs it finds the main database first (/var/lib/ldap) and moves all top level entries (find -mindepth 1 -maxdepth 1 ...) into the backup directory and this includes the accesslog subdirectory which then no longer exists. When slapadd runs it checks config specifying that directory and bails with the above error given it is indeed missing.
I've tested a tentative fix and that's to patch the two find commands (one in is_empty_dir() one in move_old_database_away to also specify -type f so that the directory structure is preserved when moving the old database away (accesslog will be backed up separately when its suffx is iterated over in move_incompatible_databases_away()).
The simple and very tentative patch for this is:-
"""
# diff -u slapd.scripts-common.old slapd.scripts-common
--- slapd.scripts-common.old 2012-05-24 10:33:01.746206585 +0100
+++ slapd.scripts-common 2012-05-24 10:33:23.967902747 +0100
@@ -391,7 +391,7 @@
echo -n " - directory $suffix... " >&2
mkdir -p "$backupdir"
find "$databasedir" -mindepth 1 -maxdepth 1 \
- -exec mv {} "$backupdir" \;
+ -type f -exec mv {} "$backupdir" \;
echo done. >&2
else
cat >&2 <<EOF
@@ -728,7 +728,7 @@
# (i.e., contains no files except for an optional DB_CONFIG).
# Usage: if is_empty_dir "$dir"; then ... fi
- output=`find "$1" -mindepth 1 -maxdepth 1 \! -name DB_CONFIG 2>/dev/null`
+ output=`find "$1" -mindepth 1 -maxdepth 1 -type f \! -name DB_CONFIG 2>/dev/null`
if [ -n "$output" ]; then
return 1
else
""" |
|
2013-10-03 11:42:06 |
Paul Bergene |
bug |
|
|
added subscriber Paul Bergene |
2014-05-05 05:05:18 |
Ryan Tandy |
bug task added |
|
openldap (Debian) |
|
2014-05-05 05:05:40 |
Ryan Tandy |
openldap (Debian): status |
New |
Fix Committed |
|
2014-10-20 04:37:15 |
Launchpad Janitor |
branch linked |
|
lp:debian/openldap |
|
2014-10-22 22:45:02 |
Ryan Tandy |
openldap (Debian): status |
Fix Committed |
Fix Released |
|
2015-05-29 09:46:59 |
Launchpad Janitor |
openldap (Ubuntu): status |
Confirmed |
Fix Released |
|
2015-05-29 09:46:59 |
Launchpad Janitor |
cve linked |
|
2013-4449 |
|
2015-05-29 09:46:59 |
Launchpad Janitor |
cve linked |
|
2015-1545 |
|
2015-05-29 09:46:59 |
Launchpad Janitor |
cve linked |
|
2015-1546 |
|
2021-10-14 05:34:47 |
Steve Langasek |
openldap (Ubuntu Precise): status |
Confirmed |
Won't Fix |
|
2022-06-13 18:23:01 |
Launchpad Janitor |
merge proposal linked |
|
https://code.launchpad.net/~sergiodj/ubuntu/+source/openldap/+git/openldap/+merge/424341 |
|
2022-06-13 19:08:48 |
Launchpad Janitor |
merge proposal unlinked |
https://code.launchpad.net/~sergiodj/ubuntu/+source/openldap/+git/openldap/+merge/424341 |
|
|