[Pkg-openldap-devel] r827 - openldap/trunk-2.3/debian

Russ Allbery rra at alioth.debian.org
Sat Jun 2 01:32:18 UTC 2007


Author: rra
Date: 2007-06-02 01:32:18 +0000 (Sat, 02 Jun 2007)
New Revision: 827

Modified:
   openldap/trunk-2.3/debian/changelog
   openldap/trunk-2.3/debian/slapd.postrm
   openldap/trunk-2.3/debian/slapd.scripts-common
Log:
* If automatic configuration is selected and slapd.conf doesn't exist
  during an upgrade, treat this as a fresh installation rather than
  aborting with an error.  Also try to provide a better error message if
  the user has deleted /etc/ldap/schema but we just generated a new
  configuration that references it.  These cases can occur if someone
  removes (rather than purges) the package, manually deletes /etc/ldap,
  and then reinstalls.  (Closes: #205010)
* Don't fail in slapd's postrm if /etc/ldap/schema has already been
  deleted.

Modified: openldap/trunk-2.3/debian/changelog
===================================================================
--- openldap/trunk-2.3/debian/changelog	2007-06-01 23:50:49 UTC (rev 826)
+++ openldap/trunk-2.3/debian/changelog	2007-06-02 01:32:18 UTC (rev 827)
@@ -1,5 +1,14 @@
 openldap2.3 (2.3.35-2) UNRELEASED; urgency=low
 
+  * If automatic configuration is selected and slapd.conf doesn't exist
+    during an upgrade, treat this as a fresh installation rather than
+    aborting with an error.  Also try to provide a better error message if
+    the user has deleted /etc/ldap/schema but we just generated a new
+    configuration that references it.  These cases can occur if someone
+    removes (rather than purges) the package, manually deletes /etc/ldap,
+    and then reinstalls.  (Closes: #205010)
+  * Don't fail in slapd's postrm if /etc/ldap/schema has already been
+    deleted.
   * Remove slapd conflicts with libbind-dev and bind-dev.  There no longer
     appears to be anything in those packages that would break slapd's
     resolver.  (Closes: #225896)
@@ -10,7 +19,7 @@
   * Add to /etc/default/slapd a commented-out example of how to change the
     keytab file used for GSSAPI authentication.  (Closes: #412017)
 
- -- Russ Allbery <rra at debian.org>  Fri, 01 Jun 2007 16:50:23 -0700
+ -- Russ Allbery <rra at debian.org>  Fri, 01 Jun 2007 18:11:18 -0700
 
 openldap2.3 (2.3.35-1) unstable; urgency=low
 

Modified: openldap/trunk-2.3/debian/slapd.postrm
===================================================================
--- openldap/trunk-2.3/debian/slapd.postrm	2007-06-01 23:50:49 UTC (rev 826)
+++ openldap/trunk-2.3/debian/slapd.postrm	2007-06-02 01:32:18 UTC (rev 827)
@@ -22,7 +22,7 @@
 if [ "$1" = "purge" ]; then
   echo -n "Removing slapd configuration... "
   rm -f /etc/ldap/slapd.conf 2>/dev/null || true
-  rmdir --ignore-fail-on-non-empty /etc/ldap/schema
+  rmdir /etc/ldap/schema || true
   echo done
 
   echo -n "Removing maintainer script flag files... "

Modified: openldap/trunk-2.3/debian/slapd.scripts-common
===================================================================
--- openldap/trunk-2.3/debian/slapd.scripts-common	2007-06-01 23:50:49 UTC (rev 826)
+++ openldap/trunk-2.3/debian/slapd.scripts-common	2007-06-02 01:32:18 UTC (rev 827)
@@ -681,6 +681,24 @@
     -e "s/@BACKENDOPTIONS@/$backendoptions/g"
 	install_new_slapd_conf "$conf_new"
 	echo "done." >&2
+
+	# If /etc/ldap/schema/core.schema doesn't exist, the configuration
+	# file we're about to write will be horribly broken.  Try to give the
+	# user some warning rather than failing later.
+	if [ ! -e /etc/ldap/schema/core.schema ]; then
+		echo "failed." >&2
+		echo >&2
+		cat >&2 <<-EOF
+	/etc/ldap/schema/core.schema does not exist, which means the slapd
+	configuration will not work.  If you have moved the schema files
+	elsewhere, you will need to modify $SLAPD_CONF accordingly.
+	If you deleted the schema files inadvertantly, you may need to
+	purge this package and then reinstall it to restore them (be
+	careful to back up your database first if necessary).
+
+EOF
+		exit 1
+	fi
 } 
 # }}}
 noisy_slapadd() {							# {{{
@@ -1217,6 +1235,12 @@
 	if [ "$1" = reconfigure ] || [ "$DEBCONF_RECONFIGURE" ]; then
     		return 0
   	fi
+	# Upgrade but slapd.conf doesn't exist.  If the user is doing this
+	# intentionally because they want to put it somewhere else, they
+	# should select manual configuration in debconf.
+	if [ "$1" = configure ] && [ ! -e "$SLAPD_CONF" ]; then
+		return 0
+	fi
   	return 1
 }
 




More information about the Pkg-openldap-devel mailing list