Package: cdebootstrap
Version: 0.7.3
Severity: normal
Tags: patch

Hi,

since dpkg 1.18.5 reached sid and testing cdeboostrap fails with (if run with --debug):

dpkg (subprocess): failed to chdir to '': No such file or directory

cdebootstrap is calling dpkg with --force-all which enables --force-script-chrootless and that means dpkg tries to chdir to it's instdir which cdebootstrap does not set.

dpkg will likely not fail in this way with its next upload (presumably 1.18.8).

This bug is really to say that dpkg --force-all does not appear sensible for any real use and is likely to repeatedly lead to odd things as long as it exists and is being used by cdebootstrap. It simply enables every dpkg force option and not any set that tries to make any sense. So for example it sets confnew and confold simultaneously.

dpkg --force-all does everything from disable verification to enabling unsafe-io to allowing breaks and conflicts, I don't think cdebootstrap needs or wants nearly any of these options. In future it only seems likely to break or do unexpected things to cdebootstrap.

The (hopefully) attached patch works for cdebootstrapping into a clean target but I don't know how it should behave for an unlean target (confold or confnew? confdef?). I'm also not sure if --force-architecture could be needed or not in any cdebootstrap uses. What it does do is prevent ugly things like packages overwriting each other or introducing breaks/conflicts but hopefully nobody is depending on that kind of behaviour.

debootstrap does force confold at times, and I'm not sure how you intend cdebootstrap to behave into a dirty target (or if it matters at all to dpkg and base-passwd, the only packages installed this way in the default suite), but I think the current behaviour ends up undefined by passing the buck to --force-all.

Hope this helps.

Thanks,

Niall

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Versions of packages cdebootstrap depends on:
ii  debian-archive-keyring      2014.3
ii  gpgv                        1.4.20-6
ii  libbz2-1.0                  1.0.6-8
ii  libc6                       2.22-8
ii  libcurl3-gnutls             7.47.0-1
ii  libdebian-installer-extra4  0.104
ii  libdebian-installer4        0.104
ii  liblzma5                    5.1.1alpha+20120614-2.1
ii  zlib1g                      1:1.2.8.dfsg-2+b1

cdebootstrap recommends no packages.

cdebootstrap suggests no packages.

-- no debconf information
--- ../cdebootstrap-0.7.3/src/install.c	2016-05-14 17:21:23.678022968 +0100
+++ src/install.c	2016-05-14 19:51:30.675105075 +0100
@@ -285,8 +285,6 @@
   *c++ = "dpkg";
   *c++ = "--configure";
   *c++ = "-a";
-  if (force)
-    *c++ = "--force-all";
   if (!simulate_handler)
     *c++ = "--status-fd=3";
   *c = NULL;
@@ -312,7 +310,7 @@
   *c++ = "dpkg";
   *c++ = "--install";
   if (force)
-    *c++ = "--force-all";
+    *c++ = "--force-depends";
   if (!simulate_handler)
     *c++ = "--status-fd=3";
   *c = NULL;
@@ -326,7 +324,7 @@
 
   *c++ = "dpkg";
   *c++ = "--unpack";
-  *c++ = "--force-all";
+  *c++ = "--force-depends";
   if (!simulate_handler)
     *c++ = "--status-fd=3";
   *c = NULL;

Reply via email to