summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/acquire-item.cc2
-rw-r--r--apt-pkg/aptconfiguration.cc2
-rw-r--r--apt-pkg/contrib/cmndline.cc1
-rw-r--r--apt-pkg/contrib/fileutl.cc3
-rw-r--r--apt-pkg/contrib/strutl.cc2
-rw-r--r--apt-pkg/tagfile.cc10
-rw-r--r--apt-pkg/tagfile.h2
-rw-r--r--cmdline/apt-mark.cc4
-rw-r--r--debian/control5
-rwxr-xr-xtest/integration/test-bug-507998-dist-upgrade-recommends25
10 files changed, 49 insertions, 7 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 95dadcd6d..97b2d1e29 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -984,6 +984,8 @@ void pkgAcqIndex::Done(string Message,unsigned long long Size,string Hash,
DestFile += ".decomp";
Desc.URI = decompProg + ":" + FileName;
QueueURI(Desc);
+
+ // FIXME: this points to a c++ string that goes out of scope
Mode = decompProg.c_str();
}
/*}}}*/
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc
index e32e553a4..4f9b84e00 100644
--- a/apt-pkg/aptconfiguration.cc
+++ b/apt-pkg/aptconfiguration.cc
@@ -392,7 +392,7 @@ std::vector<std::string> const Configuration::getArchitectures(bool const &Cache
dup2(nullfd, STDIN_FILENO);
dup2(external[1], STDOUT_FILENO);
dup2(nullfd, STDERR_FILENO);
- if (chrootDir != "/" && chroot(chrootDir.c_str()) != 0)
+ if (chrootDir != "/" && chroot(chrootDir.c_str()) != 0 && chdir("/") != 0)
_error->WarningE("getArchitecture", "Couldn't chroot into %s for dpkg --print-foreign-architectures", chrootDir.c_str());
execvp(Args[0], (char**) &Args[0]);
_error->WarningE("getArchitecture", "Can't detect foreign architectures supported by dpkg!");
diff --git a/apt-pkg/contrib/cmndline.cc b/apt-pkg/contrib/cmndline.cc
index 8cef80368..2086d91ca 100644
--- a/apt-pkg/contrib/cmndline.cc
+++ b/apt-pkg/contrib/cmndline.cc
@@ -397,6 +397,7 @@ bool CommandLine::DispatchArg(Dispatch *Map,bool NoMatch)
void CommandLine::SaveInConfig(unsigned int const &argc, char const * const * const argv)
{
char cmdline[100 + argc * 50];
+ memset(cmdline, 0, sizeof(cmdline));
unsigned int length = 0;
bool lastWasOption = false;
bool closeQuote = false;
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index dca468c63..47a91c294 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -1777,7 +1777,8 @@ std::vector<std::string> Glob(std::string const &pattern, int flags)
{
std::vector<std::string> result;
glob_t globbuf;
- int glob_res, i;
+ int glob_res;
+ unsigned int i;
glob_res = glob(pattern.c_str(), flags, NULL, &globbuf);
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index d06637155..0955b69f7 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -943,6 +943,8 @@ bool StrToTime(const string &Val,time_t &Result)
Tm.tm_isdst = 0;
if (Month[0] != 0)
Tm.tm_mon = MonthConv(Month);
+ else
+ Tm.tm_mon = 0; // we don't have a month, so pick something
Tm.tm_year -= 1900;
// Convert to local time and then to GMT
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc
index 10bc08d95..b91e868e2 100644
--- a/apt-pkg/tagfile.cc
+++ b/apt-pkg/tagfile.cc
@@ -233,6 +233,16 @@ bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long long Offset)
return true;
}
/*}}}*/
+// pkgTagSection::pkgTagSection - Constructor /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+pkgTagSection::pkgTagSection()
+ : Section(0), TagCount(0), d(NULL), Stop(0)
+{
+ memset(&Indexes, 0, sizeof(Indexes));
+ memset(&AlphaIndexes, 0, sizeof(AlphaIndexes));
+}
+ /*}}}*/
// TagSection::Scan - Scan for the end of the header information /*{{{*/
// ---------------------------------------------------------------------
/* This looks for the first double new line in the data stream.
diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h
index 66c56799d..518d3dbcd 100644
--- a/apt-pkg/tagfile.h
+++ b/apt-pkg/tagfile.h
@@ -84,7 +84,7 @@ class pkgTagSection
Stop = this->Stop;
};
- pkgTagSection() : Section(0), TagCount(0), d(NULL), Stop(0) {};
+ pkgTagSection();
virtual ~pkgTagSection() {};
};
diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc
index eb3410be1..ebb1f9892 100644
--- a/cmdline/apt-mark.cc
+++ b/cmdline/apt-mark.cc
@@ -209,7 +209,7 @@ bool DoHold(CommandLine &CmdL)
dup2(nullfd, STDIN_FILENO);
dup2(nullfd, STDOUT_FILENO);
dup2(nullfd, STDERR_FILENO);
- if (chrootDir != "/" && chroot(chrootDir.c_str()) != 0)
+ if (chrootDir != "/" && chroot(chrootDir.c_str()) != 0 && chdir("/") != 0)
_error->WarningE("getArchitecture", "Couldn't chroot into %s for dpkg --assert-multi-arch", chrootDir.c_str());
execvp(Args[0], (char**) &Args[0]);
_error->WarningE("dpkgGo", "Can't detect if dpkg supports multi-arch!");
@@ -279,7 +279,7 @@ bool DoHold(CommandLine &CmdL)
{
close(external[1]);
std::string const chrootDir = _config->FindDir("DPkg::Chroot-Directory");
- if (chrootDir != "/" && chroot(chrootDir.c_str()) != 0)
+ if (chrootDir != "/" && chroot(chrootDir.c_str()) != 0 && chdir("/") != 0)
_error->WarningE("getArchitecture", "Couldn't chroot into %s for dpkg --set-selections", chrootDir.c_str());
int const nullfd = open("/dev/null", O_RDONLY);
dup2(external[0], STDIN_FILENO);
diff --git a/debian/control b/debian/control
index ca18ff01f..3c5d14fe8 100644
--- a/debian/control
+++ b/debian/control
@@ -18,7 +18,8 @@ Vcs-Browser: http://anonscm.debian.org/gitweb/?p=apt/apt.git
Package: apt
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, debian-archive-keyring, gnupg
-Replaces: manpages-pl (<< 20060617-3~), manpages-it
+Replaces: manpages-pl (<< 20060617-3~), manpages-it (<< 2.80-4~)
+Breaks: manpages-pl (<< 20060617-3~), manpages-it (<< 2.80-4~)
Conflicts: python-apt (<< 0.7.93.2~)
Suggests: aptitude | synaptic | wajig, dpkg-dev, apt-doc, xz-utils, python-apt
Description: commandline package manager
@@ -41,7 +42,7 @@ Architecture: any
Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}
-Breaks: apt (<< 0.9.4~)
+Breaks: apt (<< 0.9.4~), libapt-inst1.5 (<< 0.9.9~)
Section: libs
Description: package management runtime library
This library provides the common functionality for searching and
diff --git a/test/integration/test-bug-507998-dist-upgrade-recommends b/test/integration/test-bug-507998-dist-upgrade-recommends
new file mode 100755
index 000000000..513421a94
--- /dev/null
+++ b/test/integration/test-bug-507998-dist-upgrade-recommends
@@ -0,0 +1,25 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64'
+
+insertinstalledpackage 'tshark' 'amd64' '1.0.4-1' 'Depends: wireshark-common'
+insertinstalledpackage 'wireshark-common' 'amd64' '1.0.4-1' 'Recommends: wireshark (>= 1.0.4-1) | tshark (>= 1.0.4-1)'
+insertpackage 'unstable' 'tshark' 'amd64' '1.2.1-2' 'Depends: wireshark-common (= 1.2.1-2)'
+insertpackage 'unstable' 'wireshark-common' 'amd64' '1.2.1-2' 'Recommends: wireshark (>= 1.2.1-2) | tshark (>= 1.2.1-2)'
+insertpackage 'unstable' 'wireshark' 'amd64' '1.2.1-2' 'Depends: wireshark-common (= 1.2.1-2)'
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be upgraded:
+ tshark wireshark-common
+2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+Inst wireshark-common [1.0.4-1] (1.2.1-2 unstable [amd64])
+Inst tshark [1.0.4-1] (1.2.1-2 unstable [amd64])
+Conf wireshark-common (1.2.1-2 unstable [amd64])
+Conf tshark (1.2.1-2 unstable [amd64])' aptget dist-upgrade -s