Your message dated Fri, 27 Apr 2012 08:47:46 +0000
with message-id <[email protected]>
and subject line Bug#588077: fixed in dpkg 1.16.3
has caused the Debian Bug report #588077,
regarding /usr/bin/dpkg-divert: --add --rename should not rename a file
currently owned by --package
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 [email protected]
immediately.)
--
588077: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588077
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: dpkg
Version: 1.15.7.2
Severity: important
File: /usr/bin/dpkg-divert
Tags: patch
Hi,
dpkg-divert --add --rename incorrectly renames an existing file that is
owned by the package given with --package. For example see the following
commands:
# dpkg -S /usr/bin/users
coreutils: /usr/bin/users
# ls -la /usr/bin/users*
-rwxr-xr-x 1 root root 28368 Apr 28 04:05 /usr/bin/users
# dpkg-divert --add --rename --package coreutils --divert
/usr/bin/users.diverted /usr/bin/users
Adding `diversion of /usr/bin/users to /usr/bin/users.diverted by coreutils'
# ls -la /usr/bin/users*
-rwxr-xr-x 1 root root 28368 Apr 28 04:05 /usr/bin/users.diverted
Oops, that should not have happened!
A patch that adds a check for the owning package of the to be renamed
file is attached.
Andreas
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (800, 'testing'), (800, 'stable'), (600, 'unstable'), (130,
'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.31-0-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages dpkg depends on:
ii coreutils 8.5-1 GNU core utilities
ii libbz2-1.0 1.0.5-4 high-quality block-sorting file co
ii libc6 2.11.1-3 Embedded GNU C Library: Shared lib
ii libselinux1 2.0.94-1 SELinux runtime shared libraries
ii xz-utils 4.999.9beta+20100527-1 XZ-format compression utilities
ii zlib1g 1:1.2.3.4.dfsg-3 compression library - runtime
dpkg recommends no packages.
Versions of packages dpkg suggests:
ii apt 0.7.25.3 Advanced front-end for dpkg
-- no debconf information
--- dpkg-divert 2010-05-30 13:21:36.000000000 +0200
+++ dpkg-divert.mine 2010-07-04 18:41:01.088037663 +0200
@@ -182,6 +182,7 @@
push(@package,$package);
printf(_g("Adding \`%s'")."\n", infon($#contest)) if $verbose > 0;
checkrename($file, $divertto);
+ checkowner($file, $package);
save();
dorename($file, $divertto);
exit(0);
@@ -303,6 +304,24 @@
}
}
+sub checkowner {
+ return unless $dorename;
+ my ($file,$package) = @_;
+ # the $file has alredy been checked to a) exist and b) not being diverted
+ # now check if it is owned by $package and prevent renaming in that case
+ if (open (DPKG, "dpkg -S $file |")) {
+ my $owner = <DPKG>;
+ if ($owner =~ /^([^:]+):/) {
+ if ($1 eq $package) {
+ $dorename = ! $dorename;
+ }
+ }
+ close DPKG;
+ } else {
+ # error handling ?
+ }
+}
+
sub rename_mv($$)
{
return (rename($_[0], $_[1]) || (system(("mv", $_[0], $_[1])) == 0));
--- End Message ---
--- Begin Message ---
Source: dpkg
Source-Version: 1.16.3
We believe that the bug you reported is fixed in the latest version of
dpkg, which is due to be installed in the Debian FTP archive:
dpkg-dev_1.16.3_all.deb
to main/d/dpkg/dpkg-dev_1.16.3_all.deb
dpkg_1.16.3.dsc
to main/d/dpkg/dpkg_1.16.3.dsc
dpkg_1.16.3.tar.bz2
to main/d/dpkg/dpkg_1.16.3.tar.bz2
dpkg_1.16.3_amd64.deb
to main/d/dpkg/dpkg_1.16.3_amd64.deb
dselect_1.16.3_amd64.deb
to main/d/dpkg/dselect_1.16.3_amd64.deb
libdpkg-dev_1.16.3_amd64.deb
to main/d/dpkg/libdpkg-dev_1.16.3_amd64.deb
libdpkg-perl_1.16.3_all.deb
to main/d/dpkg/libdpkg-perl_1.16.3_all.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Guillem Jover <[email protected]> (supplier of updated dpkg package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Fri, 27 Apr 2012 10:10:10 +0200
Source: dpkg
Binary: libdpkg-dev dpkg dpkg-dev libdpkg-perl dselect
Architecture: source amd64 all
Version: 1.16.3
Distribution: unstable
Urgency: low
Maintainer: Dpkg Developers <[email protected]>
Changed-By: Guillem Jover <[email protected]>
Description:
dpkg - Debian package management system
dpkg-dev - Debian package development tools
dselect - Debian package management front-end
libdpkg-dev - Debian package management static library
libdpkg-perl - Dpkg perl modules
Closes: 21722 155676 155799 552517 588077 664964 665050 666752 667037 669012
669047 670048
Changes:
dpkg (1.16.3) unstable; urgency=low
.
[ Guillem Jover ]
* Do not look for newline beyond the read buffer on dpkg-deb extract.
* Check update-alternative name and link arguments for all commands.
Closes: #665050
* Check all dpkg-divert filename arguments to be absolute and to not
contain newlines. Closes: #21722
* Print errors while reading the file list files on a new line instead
of just after the progress percentage. Closes: #552517
* Document in dpkg-source(1) that patches for source format “3.0 (quilt)”
are expected to apply without any fuzz. Closes: #666752
Based on a patch by Luca Capello <[email protected]>.
* Remove redundant -Wformat-security from default dpkg-buildflags, which
is already implied by -Werror=format-security. Closes: #664964
Suggested by Peter Eisentraut <[email protected]>.
* Document in dpkg-query(1) that commands producing multiple paragraphs
will preserve the order of the packages specified on the argument list.
* Change start-stop-daemon --exec on GNU/Hurd, FreeBSD, NetBSD, OpenBSD
and Solaris to check for executables matching device and inode numbers
instead of filenames.
* Change start-stop-daemon --name on GNU/Hurd to check the process' argv[1]
in addition to argv[0], to handle both binaries and interpreted scripts.
Reported by Mats Erik Andersson <[email protected]>.
* Handle deb format versions as major.minor integers instead of strings or
floats, the latter being susceptible to parsing errors depending on the
current locale (although this was only affecting the old deb format).
* Ignore the minor format version number for deb-split format, unifying
the behaviour with the deb format.
* Add support for an abitable containing arch attribute overrides.
* Add x32 support to abitable, ostable and triplettable. Closes: #667037
* Fix start-stop-daemon to work with relative --exec arguments and --chdir.
Closes: #669047
* Ignore request to rename a file owned by the diverting package on
«dpkg-divert --add --rename». Closes: #588077
* Clarify dpkg-gensymbols(1) by way of examples that architecture wildcards
are supported in symbols files. Closes: #670048
* Fix memory leak due to Dpkg::Control objects not being garbage-collected.
Thanks to Ben Harris <[email protected]>. Closes: #669012
* Compute the md5sum hash on unpack for empty files too, so that these
can be checked correctly for matching content when installing multiple
package instances.
* Generate md5sums files automatically at unpack time if missing from the
binary package. Closes: #155676, #155799
* Add missing list and md5sums database file checks to «dpkg --audit».
.
[ Helge Kreutzmann ]
* Fix a typo in man/dpkg-buildflags.1.
.
[ Updated dpkg translations ]
* French (Christian Perrier).
* German (Sven Joachim).
* Swedish (Peter Krefting).
.
[ Updated dselect translations ]
* French (Christian Perrier).
* German (Sven Joachim).
* Swedish (Peter Krefting).
.
[ Updated scripts translations ]
* French (Christian Perrier).
* Swedish (Peter Krefting).
.
[ Updated scripts translations ]
* French (Christian Perrier).
* German (Helge Kreutzmann).
* Swedish (Peter Krefting).
Checksums-Sha1:
bb4963fae9946db782220765afbd3743d1896383 1362 dpkg_1.16.3.dsc
b82a62c1b5e85adcc947f28a264ef7b7ee8580ca 5599915 dpkg_1.16.3.tar.bz2
29a3fc00855cd8a0365acb11d473b7bf82bed6d5 640096 libdpkg-dev_1.16.3_amd64.deb
153ac818bcd482b1d42e8823ed4f9334dd40db20 2354904 dpkg_1.16.3_amd64.deb
4cf4bb413809e3981900ef03a664891bc180b397 1079334 dselect_1.16.3_amd64.deb
e2d9f21746f0ba2f803fff16f215eb65b56a6792 1184282 dpkg-dev_1.16.3_all.deb
475bfac569ad4865bf5c9a134b6d55c3e63a85b7 881242 libdpkg-perl_1.16.3_all.deb
Checksums-Sha256:
d49eb619ebe10cfdf0ab13ab59a627518ae57e1b3d793ab05f23f105060a44f6 1362
dpkg_1.16.3.dsc
8048890ca92a3ca317a4fdd557f8e9b2b3ce560743e8e70813496f9a7096d8d8 5599915
dpkg_1.16.3.tar.bz2
83571879e30c5ee19f17038adb2b3d88604ddeec0d0bd60623c6a4e303782fa3 640096
libdpkg-dev_1.16.3_amd64.deb
ccfa31ca47729ed42f79367cfa9e6ae3dc5b76616e1708d190c52a1b0f768b26 2354904
dpkg_1.16.3_amd64.deb
c86ceea341dca6704dc5b4fe63fc9c262751a9fa654d73930acc691c25dec379 1079334
dselect_1.16.3_amd64.deb
352173d2e19d4b40c0e596e01a5bc41e4f24e8c2514020e73adc38bba9ef7bb0 1184282
dpkg-dev_1.16.3_all.deb
a25a757012281ce83dde6a727cf1587f18a670c63186964c3192ffc617b94f50 881242
libdpkg-perl_1.16.3_all.deb
Files:
c48022e8aacde7046c5b8b9163fea8cb 1362 admin required dpkg_1.16.3.dsc
20189e2926ada3dda4f77ef2e36999af 5599915 admin required dpkg_1.16.3.tar.bz2
525113c10668ca1edeccf81f63300562 640096 libdevel optional
libdpkg-dev_1.16.3_amd64.deb
a7096c5f626d1fa1d5cc5b3d0e94f9c7 2354904 admin required dpkg_1.16.3_amd64.deb
c276e506628a9c218a8fc25343fef1f7 1079334 admin optional
dselect_1.16.3_amd64.deb
e269f80cd82dc477cfeae69edfa07129 1184282 utils optional dpkg-dev_1.16.3_all.deb
4251ef6c75be3087e2202f4803d4df7a 881242 perl optional
libdpkg-perl_1.16.3_all.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAk+aV7YACgkQuW9ciZ2SjJu8OwCfTAK3+/za0kD9SwhYkxrsVwwF
0YQAoKt6GKTLul6ylFX21YTBbfegF/Xw
=cztM
-----END PGP SIGNATURE-----
--- End Message ---