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

Ryan Tandy rtandy-guest at moszumanska.debian.org
Fri Aug 11 02:05:46 UTC 2017


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

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

commit 25d8f0c0d7d9308ad0e71ad77fcd1c024e8f3e56
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 eaa71e6..b0b2e34 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ openldap (2.4.44+dfsg-5+deb9u1) UNRELEASED; urgency=medium
     later versions. (Closes: #860774)
   * Disable test060-mt-hot on ppc64el temporarily to avoid failing tests until 
     the underlying kernel bug #866122 is fixed.
+  * Fix upgrade failure when olcSuffix contains a backslash. (Closes: #864719)
 
  -- Ryan Tandy <ryan at nardis.ca>  Tue, 08 Aug 2017 18:19:08 -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