For the backslashes case, the attached ought to do. Would you be willing to test it? It should apply to /var/lib/dpkg/info/slapd.postinst.

Still thinking about the base64 case. Since we use the suffix to name files and directories for backup and restore, I guess it's most robust to just use the base64 directly - even if it's not quite as nice for showing to users.
diff --git a/debian/slapd.scripts-common b/debian/slapd.scripts-common
index 9b1219e..e0e5e56 100644
--- a/debian/slapd.scripts-common
+++ b/debian/slapd.scripts-common
@@ -100,7 +100,7 @@ update_permissions() {	# {{{
 }
 # }}}
 update_databases_permissions() {	# {{{
-	get_suffix | while read suffix; do
+	get_suffix | while read -r suffix; do
 		dbdir=`get_directory "$suffix"`
 		update_permissions "$dbdir"
 	done
@@ -281,8 +281,8 @@ get_suffix() {
 # }}}
 get_directory() {							# {{{
 # Returns the db directory for a given suffix
-	if [ -d "${SLAPD_CONF}" ] && get_suffix | grep -q "$1" ; then
-		grep "olcDbDirectory:" `grep -l "olcSuffix: $1" ${SLAPD_CONF}/cn\=config/olcDatabase*.ldif` | cut -d: -f 2 | sed 's/^  *//g'
+	if [ -d "${SLAPD_CONF}" ] && get_suffix | grep -Fq "$1" ; then
+		grep "olcDbDirectory:" `grep -Fl "olcSuffix: $1" ${SLAPD_CONF}/cn\=config/olcDatabase*.ldif` | cut -d: -f 2 | sed 's/^  *//g'
 	elif [ -f "${SLAPD_CONF}" ]; then
 		# Extract the directory for the given suffix ($1)
 		for f in `get_all_slapd_conf_files`; do

Reply via email to