[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#818906: marked as done (wheezy-pu: package dpkg/1.16.18)



Your message dated Sat, 04 Jun 2016 14:54:37 +0100
with message-id <1465048477.7545.10.camel@adam-barratt.org.uk>
and subject line Closing bugs for fixed included in 7.11
has caused the Debian Bug report #818906,
regarding wheezy-pu: package dpkg/1.16.18
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
818906: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818906
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
Tags: wheezy
User: release.debian.org@packages.debian.org
Usertags: pu

Hi!

Here's a proposed dpkg 1.16.18, with cherry picked fixes from master
(already in unstable). These include fixes for regressions, memory leaks,
segmentation faults, portability and interaction with tools such as
GNU tar or the system shell.

The change for Config-Version should be safe, as at worst it will have
no effect, otherwise packages relying on the correct behavior will
start to work now.

The «git log» fix is not yet in master though, but it should also be safe,
otherwise the build would simply fail. And I've just realized it's not
documented in debian/changelog, it will be in the ChangeLog, but I could
add it to debian/changelog too.

The changes have passed all unit tests which are part of the build,
and all functional test in the dpkg-tests git repo. Attached a diff
with translation updates filtered.

Thanks,
Guillem
diff --git a/Makefile.am b/Makefile.am
index 406d3dd..cb12880 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -140,7 +140,7 @@ update-po:
 DISTCLEANFILES = ChangeLog
 
 ChangeLog:
-	git log -C --stat 1.15.0.. >$@
+	XDG_CONFIG_HOME= HOME= git log -C --stat 1.15.0.. >$@
 
 # If we create the dist tarball from the git repository, make sure
 # that we're not forgetting some files...
diff --git a/debian/changelog b/debian/changelog
index 1c5a662..19b76f3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,29 @@
+dpkg (1.16.18) wheezy; urgency=medium
+
+  * Remove trailing space before handling blank line dot-separator in
+    Dpkg::Control::Hash. Regression introduced in dpkg 1.16.16.
+    Reported by Jakub Wilk <jwilk@debian.org>. Closes: #789580
+  * Only use the SHELL environment variable for interactive shells.
+    Closes: #788819
+  * Move tar option --no-recursion before -T in dpkg-deb. With tar > 1.28 the
+    --no-recursion option is now positional, and needs to be passed before
+    the -T option, otherwise the tarball will end up with duplicated entries.
+    Thanks to Richard Purdie <richard.purdie@linuxfoundation.org>.
+    Closes: #807940
+  * Initialize Config-Version also for packages previously in triggers-pending
+    state, otherwise we end up not passing the previously configured version
+    to «postinst configure», which might consider this a first install instead
+    of an upgrade. Closes: #801156
+  * Fix memory leaks in dpkg infodb format upgrade logic.
+  * Fix physical file offset comparison in dpkg. Closes: #808912
+    Thanks to Yuri Gribov <tetra2005@gmail.com>.
+  * Do not accept empty field names in dpkg. Closes: #769111
+  * When sys_siglist is defined in the system, try to use NSIG as we cannot
+    compute the array size with sizeof(). If NSIG is missing fallback to 32
+    items. Prompted by Igor Pashev <pashev.igor@gmail.com>.
+
+ -- Guillem Jover <guillem@debian.org>  Sun, 20 Mar 2016 10:23:24 +0100
+
 dpkg (1.16.17) wheezy-security; urgency=high
 
   [ Guillem Jover ]
diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
index b798b1f..e83ed51 100644
--- a/dpkg-deb/build.c
+++ b/dpkg-deb/build.c
@@ -545,7 +545,8 @@ do_build(const char *const *argv)
     m_dup2(p2[1],1); close(p2[0]); close(p2[1]);
     if (chdir(dir))
       ohshite(_("failed to chdir to `%.255s'"), dir);
-    execlp(TAR, "tar", "-cf", "-", "--format=gnu", "--null", "-T", "-", "--no-recursion", NULL);
+    execlp(TAR, "tar", "-cf", "-", "--format=gnu", "--null", "--no-recursion",
+                       "-T", "-", NULL);
     ohshite(_("unable to execute %s (%s)"), "tar -cf", TAR);
   }
   close(p1[0]);
diff --git a/lib/compat/strsignal.c b/lib/compat/strsignal.c
index 92fad03..7ff23e2 100644
--- a/lib/compat/strsignal.c
+++ b/lib/compat/strsignal.c
@@ -52,7 +52,12 @@ const char *const sys_siglist[] = {
 	"SIGTTIN",	/* 21 */
 	"SIGTTOU",	/* 22 */
 };
+# define COMPAT_NSIGLIST (int)(sizeof(sys_siglist) / sizeof(sys_siglist[0]))
 #else
+# ifndef NSIG
+#  define NSIG 32
+# endif
+# define COMPAT_NSIGLIST NSIG
 extern const char *const sys_siglist[];
 #endif
 
@@ -61,7 +66,7 @@ strsignal(int s)
 {
 	static char buf[100];
 
-	if (s > 0 && s < sizeof(sys_siglist) / sizeof(sys_siglist[0]))
+	if (s > 0 && s < COMPAT_NSIGLIST)
 		return sys_siglist[s];
 
 	sprintf(buf, _("Unknown signal %d"), s);
diff --git a/lib/dpkg/command.c b/lib/dpkg/command.c
index 859f8a1..f9b3302 100644
--- a/lib/dpkg/command.c
+++ b/lib/dpkg/command.c
@@ -216,14 +216,16 @@ command_shell(const char *cmd, const char *name)
 	const char *shell;
 	const char *mode;
 
-	shell = getenv("SHELL");
-	if (str_is_unset(shell))
-		shell = DEFAULTSHELL;
-
-	if (cmd == NULL)
+	if (cmd == NULL) {
 		mode = "-i";
-	else
+		shell = getenv("SHELL");
+	} else {
 		mode = "-c";
+		shell = NULL;
+	}
+
+	if (str_is_unset(shell))
+		shell = DEFAULTSHELL;
 
 	execlp(shell, shell, mode, cmd, NULL);
 	ohshite(_("unable to execute %s (%s)"), name, cmd);
diff --git a/lib/dpkg/parse.c b/lib/dpkg/parse.c
index e790ec5..efb1bff 100644
--- a/lib/dpkg/parse.c
+++ b/lib/dpkg/parse.c
@@ -222,18 +222,24 @@ pkg_parse_verify(struct parsedb_state *ps,
       if (!dop->arch)
         dop->arch = pkgbin->arch;
 
-  /* Check the Config-Version information:
-   * If there is a Config-Version it is definitely to be used, but
-   * there shouldn't be one if the package is ‘installed’ (in which case
-   * the Version and/or Revision will be copied) or if the package is
-   * ‘not-installed’ (in which case there is no Config-Version). */
+  /*
+   * Check the Config-Version information:
+   *
+   * If there is a Config-Version it is definitely to be used, but there
+   * should not be one if the package is ‘installed’ or ‘triggers-pending’
+   * (in which case the Version will be copied) or if the package is
+   * ‘not-installed’ (in which case there is no Config-Version).
+   */
   if (!(ps->flags & pdb_recordavailable)) {
     if (pkg->configversion.version) {
-      if (pkg->status == stat_installed || pkg->status == stat_notinstalled)
+      if (pkg->status == stat_installed ||
+          pkg->status == stat_notinstalled ||
+          pkg->status == stat_triggerspending)
         parse_error(ps,
                     _("Configured-Version for package with inappropriate Status"));
     } else {
-      if (pkg->status == stat_installed)
+      if (pkg->status == stat_installed ||
+          pkg->status == stat_triggerspending)
         pkg->configversion = pkgbin->version;
     }
   }
@@ -583,6 +589,8 @@ parse_stanza(struct parsedb_state *ps, struct field_state *fs,
     while (!parse_EOF(ps) && !isspace(c) && c != ':' && c != MSDOS_EOF_CHAR)
       c = parse_getc(ps);
     fs->fieldlen = ps->dataptr - fs->fieldstart - 1;
+    if (fs->fieldlen == 0)
+      parse_error(ps,  _("empty field name"));
 
     /* Skip spaces before ‘:’. */
     while (!parse_EOF(ps) && c != '\n' && isspace(c))
diff --git a/man/dpkg.1 b/man/dpkg.1
index 0196cb8..6fa02f1 100644
--- a/man/dpkg.1
+++ b/man/dpkg.1
@@ -644,8 +644,9 @@ Sent just before a processing stage starts. \fIstage\fR is one of
 .TP
 \fB\-\-status\-logger\fR=\fIcommand\fR
 Send machine-readable package status and progress information to the
-shell \fIcommand\fR's standard input. This option can be specified
-multiple times. The output format used is the same as in \fB\-\-status\-fd.
+shell \fIcommand\fR's standard input, to be run via \*(lqsh \-c\*(rq.
+This option can be specified multiple times.
+The output format used is the same as in \fB\-\-status\-fd.
 .RE
 .TP
 \fB\-\-log=\fP\fIfilename\fP
@@ -731,7 +732,7 @@ temporary files and directories.
 The program \fBdpkg\fP will execute when displaying the conffiles.
 .TP
 .B SHELL
-The program \fBdpkg\fP will execute when starting a new shell.
+The program \fBdpkg\fP will execute when starting a new interactive shell.
 .TP
 .B COLUMNS
 Sets the number of columns \fBdpkg\fP should use when displaying formatted
diff --git a/scripts/Dpkg/Control/Hash.pm b/scripts/Dpkg/Control/Hash.pm
index a21b75d..278928b 100644
--- a/scripts/Dpkg/Control/Hash.pm
+++ b/scripts/Dpkg/Control/Hash.pm
@@ -195,10 +195,10 @@ sub parse {
 	    unless (defined($cf)) {
                 syntaxerr($desc, _g("continued value line not in field"));
             }
+	    $line =~ s/\s*$//;
 	    if ($line =~ /^\.+$/) {
 		$line = substr $line, 1;
 	    }
-	    $line =~ s/\s*$//;
 	    $self->{$cf} .= "\n$line";
 	} elsif (m/^-----BEGIN PGP SIGNED MESSAGE-----[\r\t ]*$/) {
 	    $expect_pgp_sig = 1;
diff --git a/scripts/t/700_Dpkg_Control.t b/scripts/t/700_Dpkg_Control.t
index 2331b10..c9345e1 100644
--- a/scripts/t/700_Dpkg_Control.t
+++ b/scripts/t/700_Dpkg_Control.t
@@ -51,6 +51,7 @@ Long-Field: line1
  line 2 line 2 line 2
  .
    line 3 line 3 line 3
+ .
  ..
  line 4
 Empty-Field: 
@@ -80,6 +81,7 @@ is($src->{'long-field'},
 line 2 line 2 line 2
 
   line 3 line 3 line 3
+
 .
 line 4', "Get multi-line field");
 is($src->{'Empty-field'}, "", "Get empty field");
diff --git a/scripts/t/700_Dpkg_Control/control-1 b/scripts/t/700_Dpkg_Control/control-1
index 85bdbb5..434fdb7 100644
--- a/scripts/t/700_Dpkg_Control/control-1
+++ b/scripts/t/700_Dpkg_Control/control-1
@@ -6,6 +6,7 @@ long-field: line1
  line 2 line 2 line 2    
  .
    line 3 line 3 line 3
+ .	  
  ..
  line 4
 empty-field: 
diff --git a/src/filesdb.c b/src/filesdb.c
index af34810..79677b9 100644
--- a/src/filesdb.c
+++ b/src/filesdb.c
@@ -343,8 +343,10 @@ pkg_sorter_by_listfile_phys_offs(const void *a, const void *b)
    * INT_MAX. */
   if (pa->clientdata->listfile_phys_offs < pb->clientdata->listfile_phys_offs)
     return -1;
-  else
+  else if (pa->clientdata->listfile_phys_offs > pb->clientdata->listfile_phys_offs)
     return 1;
+  else
+    return 0;
 }
 
 static void
diff --git a/src/infodb-upgrade.c b/src/infodb-upgrade.c
index 5ccd2fe..3cb4c15 100644
--- a/src/infodb-upgrade.c
+++ b/src/infodb-upgrade.c
@@ -149,6 +149,7 @@ pkg_infodb_link_multiarch_files(void)
 	}
 	pop_cleanup(ehflag_normaltidy); /* closedir */
 
+	varbuf_destroy(&pkgname);
 	varbuf_destroy(&newname);
 	varbuf_destroy(&oldname);
 }

--- End Message ---
--- Begin Message ---
Version: 7.11

Hi,

The fixes referred to in each of these bugs were included in today's
7.11 point release.

Regards,

Adam

--- End Message ---

Reply to: