[Pkg-openldap-devel] [openldap] 03/03: Use fixed grep and raw read in case olcSuffixes contains metacharacters (#864719)

Ryan Tandy rtandy-guest at moszumanska.debian.org
Sun Jun 25 03:43:47 UTC 2017


This is an automated email from the git hooks/post-receive script.

rtandy-guest pushed a commit to branch master
in repository openldap.

commit 57cde5d2a470baf542e67e7a8e17f5dd630ccb4f
Author: Ryan Tandy <ryan at nardis.ca>
Date:   Sat Jun 24 20:33:18 2017 -0700

    Use fixed grep and raw read in case olcSuffixes contains metacharacters (#864719)
---
 debian/changelog            | 1 +
 debian/slapd.scripts-common | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 3804b6a..fce0812 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ openldap (2.4.44+dfsg-6) UNRELEASED; urgency=medium
 
   * Update the list of non-translatable strings for the 
     slapd/ppolicy_schema_needs_update template. Thanks Ferenc Wágner.
+  * Fix upgrade failure when olcSuffix contains a backslash. (Closes: #864719)
 
  -- Ryan Tandy <ryan at nardis.ca>  Sat, 24 Jun 2017 19:57:36 -0700
 
diff --git a/debian/slapd.scripts-common b/debian/slapd.scripts-common
index 74cc97e..3193803 100644
--- a/debian/slapd.scripts-common
+++ b/debian/slapd.scripts-common
@@ -105,7 +105,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
@@ -296,8 +296,8 @@ get_suffix() {								# {{{
 # }}}
 get_directory() {							# {{{
 # Returns the db directory for a given suffix
-	if [ -d "${SLAPD_CONF}" ] && get_suffix | grep -q "$1" ; then
-		sed -n 's/^olcDbDirectory: *//p' `grep -l "^olcSuffix: $1" ${SLAPD_CONF}/cn\=config/olcDatabase*.ldif`
+	if [ -d "${SLAPD_CONF}" ] && get_suffix | grep -Fq "$1" ; then
+		sed -n 's/^olcDbDirectory: *//p' `grep -Fl "^olcSuffix: $1" ${SLAPD_CONF}/cn\=config/olcDatabase*.ldif`
 	elif [ -f "${SLAPD_CONF}" ]; then
 		# Extract the directory for the given suffix ($1)
 		for f in `get_all_slapd_conf_files`; do

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openldap/openldap.git



More information about the Pkg-openldap-devel mailing list