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

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=7d883c90afa3b4608c082b146f90209180fdcb74

commit 7d883c90afa3b4608c082b146f90209180fdcb74
Author: Guillem Jover <[email protected]>
AuthorDate: Tue May 5 05:30:06 2020 +0200

    t-deb-conffiles: Add new non-relative conffiles case
    
    The conffiles file must not contain relative pathnames. This happens
    to work because when parsing the file the dpkg filesystem lookup
    function prepends a / if missing, but we should not accept these
    bogus entries in the first place.
    
    Fix the t-unpack-hardlink test case to not use relative pathnames.
    
    Reported-by: Niels Thykier <[email protected]>
---
 Feature.mk                                                          | 1 +
 t-deb-conffiles/Makefile                                            | 6 ++++++
 t-deb-conffiles/pkg-conff-noabs/DEBIAN/conffiles                    | 1 +
 .../pkg-c => t-deb-conffiles/pkg-conff-noabs}/DEBIAN/control        | 5 ++---
 .../pkg-conff-noabs/test-conffile-rel                               | 0
 t-unpack-hardlink/pkg-hardlink/DEBIAN/conffiles                     | 4 ++--
 6 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/Feature.mk b/Feature.mk
index 8c76fef9f..e0a6de78e 100644
--- a/Feature.mk
+++ b/Feature.mk
@@ -56,6 +56,7 @@ endif
 # dpkg >= 1.20.x
 ifeq ($(call CHECK_VERSION,$(DPKG_SERIES),ge,1.20.x),yes)
 $(info Assuming checks for dpkg >= 1.20.x)
+export DPKG_HAS_STRICT_CONFFILE_PARSER_NOABS ?= 1
 # FIXME: dpkg-maintscript-helper does not support $DPKG_ROOT (#832176)
 #export DPKG_HAS_WORKING_ROOTDIR_MAINTSCRIPT_HELPER ?= 1
 endif
diff --git a/t-deb-conffiles/Makefile b/t-deb-conffiles/Makefile
index 95a38dc8f..bbf73f3c5 100644
--- a/t-deb-conffiles/Makefile
+++ b/t-deb-conffiles/Makefile
@@ -16,6 +16,12 @@ else
          ( echo Fail: missing warning in output && exit 1 )
 endif
 
+ifdef DPKG_HAS_STRICT_CONFFILE_PARSER_NOABS
+       # Conffiles must use absolute pathnames.
+       ! $(DPKG_BUILD_DEB) pkg-conff-noabs
+endif
+
 test-clean:
        $(RM) pkg-conff-duped.deb
        $(RM) pkg-conff-noeol.deb
+       $(RM) pkg-conff-noabs.deb
diff --git a/t-deb-conffiles/pkg-conff-noabs/DEBIAN/conffiles 
b/t-deb-conffiles/pkg-conff-noabs/DEBIAN/conffiles
new file mode 100644
index 000000000..78eb95d93
--- /dev/null
+++ b/t-deb-conffiles/pkg-conff-noabs/DEBIAN/conffiles
@@ -0,0 +1 @@
+test-conffile-rel
diff --git a/t-breaks-multiarch/pkg-c/DEBIAN/control 
b/t-deb-conffiles/pkg-conff-noabs/DEBIAN/control
similarity index 57%
copy from t-breaks-multiarch/pkg-c/DEBIAN/control
copy to t-deb-conffiles/pkg-conff-noabs/DEBIAN/control
index 95ebbacf6..9a59d9938 100644
--- a/t-breaks-multiarch/pkg-c/DEBIAN/control
+++ b/t-deb-conffiles/pkg-conff-noabs/DEBIAN/control
@@ -1,8 +1,7 @@
-Package: pkg-c
+Package: pkg-conff-noabs
 Version: 0
 Section: test
 Priority: extra
 Maintainer: Dpkg Developers <[email protected]>
 Architecture: all
-Breaks: lib-b (<< 1)
-Description: test package - breaking package
+Description: test package - conffile with a relative pathname
diff --git a/t-conffile-divert-conffile/pkg-conff/test-conffile 
b/t-deb-conffiles/pkg-conff-noabs/test-conffile-rel
similarity index 100%
copy from t-conffile-divert-conffile/pkg-conff/test-conffile
copy to t-deb-conffiles/pkg-conff-noabs/test-conffile-rel
diff --git a/t-unpack-hardlink/pkg-hardlink/DEBIAN/conffiles 
b/t-unpack-hardlink/pkg-hardlink/DEBIAN/conffiles
index accb4b084..4634045e4 100644
--- a/t-unpack-hardlink/pkg-hardlink/DEBIAN/conffiles
+++ b/t-unpack-hardlink/pkg-hardlink/DEBIAN/conffiles
@@ -1,2 +1,2 @@
-test-conffile-link0
-test-conffile-link1
+/test-conffile-link0
+/test-conffile-link1

-- 
Dpkg.Org's dpkg

Reply via email to