ソースを参照

dpkg-maintscript-helper: Use fixed string matching for pathnames

Signed-off-by: Guillem Jover <guillem@debian.org>
Carsten Hey 10 年 前
コミット
9fb91dd0a2
共有2 個のファイルを変更した4 個の追加2 個の削除を含む
  1. 2 0
      debian/changelog
  2. 2 2
      scripts/dpkg-maintscript-helper.sh

+ 2 - 0
debian/changelog

@@ -27,6 +27,8 @@ dpkg (1.18.5) UNRELEASED; urgency=medium
   * Add MIPS R6 architectures to arch tables. Closes: #807340
     Thanks to YunQiang Su <wzssyqa@gmail.com>.
   * Fix memory leak when unpacking conffiles.
+  * Use fixed string matching for pathnames in dpkg-maintscript-helper.
+    Thanks to Carsten Hey <carsten@debian.org>.
   * Portability:
     - Move DPKG_ADMINDIR environment variable name out from update-alternatives
       code, to make life easier for non-dpkg-based systems.

+ 2 - 2
scripts/dpkg-maintscript-helper.sh

@@ -401,7 +401,7 @@ prepare_dir_to_symlink()
 	find "$PATHNAME" -print0 | xargs -0 -n1 sh -c '
 		package="$1"
 		file="$2"
-		if ! dpkg-query -L "$package" | grep -q -x "$file"; then
+		if ! dpkg-query -L "$package" | grep -F -q -x "$file"; then
 			exit 1
 		fi
 		exit 0
@@ -481,7 +481,7 @@ ensure_package_owns_file() {
 	local PACKAGE="$1"
 	local FILE="$2"
 
-	if ! dpkg-query -L "$PACKAGE" | grep -q -x "$FILE"; then
+	if ! dpkg-query -L "$PACKAGE" | grep -F -q -x "$FILE"; then
 		debug "File '$FILE' not owned by package " \
 		      "'$PACKAGE', skipping $command"
 		return 1