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

Matthijs Mohlmann active2-guest at costa.debian.org
Wed Jul 12 21:50:47 UTC 2006


Author: active2-guest
Date: 2006-07-12 21:50:46 +0000 (Wed, 12 Jul 2006)
New Revision: 680

Modified:
   openldap/trunk-2.3/debian/changelog
   openldap/trunk-2.3/debian/slapd.scripts-common
Log:
 * Fixed a typo in previous_version_older
 * A global scope variable caused write_slapd_conf to stop writing after an
   include.
 * update_access_config_directives now also follow includes.
 * config_migrate_backend now also follow includes.


Modified: openldap/trunk-2.3/debian/changelog
===================================================================
--- openldap/trunk-2.3/debian/changelog	2006-07-11 07:26:28 UTC (rev 679)
+++ openldap/trunk-2.3/debian/changelog	2006-07-12 21:50:46 UTC (rev 680)
@@ -1,6 +1,8 @@
 openldap2.3 (2.3.24-2) unstable; urgency=low
 
   * Switch slapd from running as root to running as user. (Closes: #292845)
+  * Changing configuration in slapd.conf by the postinst will now also follow
+    includes. (Closes: #304488)
   * Patches by Quanah Gibson-Mount <quanah at stanford.edu>
     - fix a lock bug with a virtual root entry in the BDB backend.
     - fix boolean logic in the overlays.

Modified: openldap/trunk-2.3/debian/slapd.scripts-common
===================================================================
--- openldap/trunk-2.3/debian/slapd.scripts-common	2006-07-11 07:26:28 UTC (rev 679)
+++ openldap/trunk-2.3/debian/slapd.scripts-common	2006-07-12 21:50:46 UTC (rev 680)
@@ -372,7 +372,7 @@
 			my ($fh, $name) = mkstemp($template);
 
 			open(HANDLE, "<". $conf) || return;
-			@data = <HANDLE>;
+			my @data = <HANDLE>;
 			close(HANDLE);
 
 			foreach $line (@data) {
@@ -728,10 +728,9 @@
 	old="$1"
 	new="$2"
 
-	sed -i \
-	  -e "s/^moduleload[[:space:]]\+back_$old/moduleload back_$new/g" \
-	  -e "s/^database[[:space:]]\+$old/database $new/g" \
-	  -e "s/^backend[[:space:]]\+$old/backend $new/g" "$SLAPD_CONF"
+	write_slapd_conf "$SLAPD_CONF" "s|^(moduleload\s+)back_$old|\$1back_$new|"
+	write_slapd_conf "$SLAPD_CONF" "s|^(database\s+)$old|\$1$new|"
+	write_slapd_conf "$SLAPD_CONF" "s|^(backend\s+)$old|\$1$new|"
 } 
 
 # }}}
@@ -862,11 +861,6 @@
 # access to attribute=<attr> becomes access to attrs=<attr>
 # access to dn=".*,..." becomes access to dn.regex=".*,..."
 
-# For now only the main configuration file is fixed, includes are not 
-# handled.
-
-	local new_conf
-
 	# Check if we have to apply these changes
 	# First changed in Debian release 2.2.23, better update if we are
 	# upgrading something older.
@@ -882,16 +876,12 @@
 	fi
 
 	echo -n "  Updating config access directives... " >&2
-	new_conf="`mktemp -q ${SLAPD_CONF}.XXXXXX`"
 
-	perl -p \
-		-e 'm/^\S/ && ($acl=0);' \
-		-e 'm/^access\s+to/ && ($acl=1);' \
-		-e 'if ($acl) { s/dn=/dn.regex=/g; s/attribute=/attrs=/g; }' \
-		< "$SLAPD_CONF" >"$new_conf"
-	install_new_slapd_conf "$new_conf"
-	echo done. >&2
+	write_slapd_conf "$SLAPD_CONF" 's/^(access\s+to\s+)dn=/$1dn.regex=/g'
+	write_slapd_conf "$SLAPD_CONF" 's/^(access\s+to\s+)(attribute=|attr=)/$1attrs=/g'
 
+	echo "done." >&2
+
 } # }}}
 stop_slapd() {								# {{{
 # Make sure slapd is shut down before mucking with the db files
@@ -1160,7 +1150,7 @@
 # Check if the previous version is newer than the reference version passed.
 # If we are not upgrading the previous version is assumed to be newer than
 # any reference version.
-# Usage: previous_version_newer <package version>
+# Usage: previous_version_older <package version>
 	
 	if dpkg --compare-versions "$OLD_VERSION" lt-nl "$1"; then
 		return 0




More information about the Pkg-openldap-devel mailing list