diff options
23 files changed, 570 insertions, 97 deletions
diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index 49ed5db56..fb4db42f8 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -161,8 +161,8 @@ bool ExtractTar::Go(pkgDirStream &Stream) return false; // Loop over all blocks - string LastLongLink; - string LastLongName; + string LastLongLink, ItemLink; + string LastLongName, ItemName; while (1) { bool BadRecord = false; @@ -208,25 +208,23 @@ bool ExtractTar::Go(pkgDirStream &Stream) StrToNum(Tar->Major,Itm.Major,sizeof(Tar->Major),8) == false || StrToNum(Tar->Minor,Itm.Minor,sizeof(Tar->Minor),8) == false) return _error->Error(_("Corrupted archive")); - - // Grab the filename + + // Grab the filename and link target: use last long name if one was + // set, otherwise use the header value as-is, but remember that it may + // fill the entire 100-byte block and needs to be zero-terminated. + // See Debian Bug #689582. if (LastLongName.empty() == false) Itm.Name = (char *)LastLongName.c_str(); else - { - Tar->Name[sizeof(Tar->Name)-1] = 0; - Itm.Name = Tar->Name; - } + Itm.Name = (char *)ItemName.assign(Tar->Name, sizeof(Tar->Name)).c_str(); if (Itm.Name[0] == '.' && Itm.Name[1] == '/' && Itm.Name[2] != 0) Itm.Name += 2; - - // Grab the link target - Tar->Name[sizeof(Tar->LinkName)-1] = 0; - Itm.LinkTarget = Tar->LinkName; if (LastLongLink.empty() == false) Itm.LinkTarget = (char *)LastLongLink.c_str(); - + else + Itm.LinkTarget = (char *)ItemLink.assign(Tar->LinkName, sizeof(Tar->LinkName)).c_str(); + // Convert the type over switch (Tar->LinkFlag) { diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc index ab4037915..79434d8b5 100644 --- a/apt-inst/deb/debfile.cc +++ b/apt-inst/deb/debfile.cc @@ -51,8 +51,7 @@ debDebFile::debDebFile(FileFd &File) : File(File), AR(File) !CheckMember("data.tar.bz2") && !CheckMember("data.tar.lzma") && !CheckMember("data.tar.xz")) { - // FIXME: add data.tar.xz here - adding it now would require a Translation round for a very small gain - _error->Error(_("This is not a valid DEB archive, it has no '%s', '%s' or '%s' member"), "data.tar.gz", "data.tar.bz2", "data.tar.lzma"); + _error->Error(_("This is not a valid DEB archive, missing '%s' member"), "data.tar"); return; } } diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 97b2d1e29..222b78671 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -1719,27 +1719,34 @@ pkgAcqArchive::pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources, } // check if we have one trusted source for the package. if so, switch - // to "TrustedOnly" mode + // to "TrustedOnly" mode - but only if not in AllowUnauthenticated mode + bool const allowUnauth = _config->FindB("APT::Get::AllowUnauthenticated", false); + bool const debugAuth = _config->FindB("Debug::pkgAcquire::Auth", false); + bool seenUntrusted = false; for (pkgCache::VerFileIterator i = Version.FileList(); i.end() == false; ++i) { pkgIndexFile *Index; if (Sources->FindIndex(i.File(),Index) == false) continue; - if (_config->FindB("Debug::pkgAcquire::Auth", false)) - { + + if (debugAuth == true) std::cerr << "Checking index: " << Index->Describe() - << "(Trusted=" << Index->IsTrusted() << ")\n"; - } - if (Index->IsTrusted()) { + << "(Trusted=" << Index->IsTrusted() << ")" << std::endl; + + if (Index->IsTrusted() == true) + { Trusted = true; - break; + if (allowUnauth == false) + break; } + else + seenUntrusted = true; } // "allow-unauthenticated" restores apts old fetching behaviour // that means that e.g. unauthenticated file:// uris are higher // priority than authenticated http:// uris - if (_config->FindB("APT::Get::AllowUnauthenticated",false) == true) + if (allowUnauth == true && seenUntrusted == true) Trusted = false; // Select a source diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 87aab6ee2..68d544e1f 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -635,7 +635,7 @@ bool debListParser::ParseDepends(pkgCache::VerIterator &Ver, string Version; unsigned int Op; - Start = ParseDepends(Start,Stop,Package,Version,Op,false,!MultiArchEnabled); + Start = ParseDepends(Start, Stop, Package, Version, Op, false, false); if (Start == 0) return _error->Error("Problem parsing dependency %s",Tag); size_t const found = Package.rfind(':'); @@ -717,9 +717,7 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver) } } - if (MultiArchEnabled == false) - return true; - else if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed) + if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed) { string const Package = string(Ver.ParentPkg().Name()).append(":").append("any"); return NewProvidesAllArch(Ver, Package, Ver.VerStr()); diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index b91e868e2..e0802e3d5 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -164,7 +164,7 @@ bool pkgTagFile::Fill() unsigned long long const dataSize = d->Size - ((d->End - d->Buffer) + 1); if (d->Fd.Read(d->End, dataSize, &Actual) == false) return false; - if (Actual != dataSize || d->Fd.Eof() == true) + if (Actual != dataSize) d->Done = true; d->End += Actual; } diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 8902f07d5..e8a21cb0c 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -62,8 +62,12 @@ bool addArgumentsAPTCache(std::vector<CommandLine::Args> &Args, char const * con { addArg(0, "all-names", "APT::Cache::AllNames", 0); } + else if (CmdMatches("unmet")) + { + addArg('i', "important", "APT::Cache::Important", 0); + } else if (CmdMatches("gencaches", "showsrc", "showpkg", "stats", "dump", - "dumpavail", "unmet", "showauto", "policy", "madison")) + "dumpavail", "showauto", "policy", "madison")) ; else return false; diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index b03f131a4..c07d060f3 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -94,8 +94,6 @@ static bool CheckAuth(pkgAcquire& Fetcher) return _error->Error(_("There are problems and -y was used without --force-yes")); } /*}}}*/ - - // InstallPackages - Actually download and install the packages /*{{{*/ // --------------------------------------------------------------------- /* This displays the informative messages describing what is going to @@ -301,7 +299,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) { pkgAcquire::UriIterator I = Fetcher.UriBegin(); for (; I != Fetcher.UriEnd(); ++I) - c1out << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << + std::cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << I->Owner->FileSize << ' ' << I->Owner->HashSum() << std::endl; return true; } @@ -429,8 +427,6 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) return true; } /*}}}*/ - - // DoAutomaticRemove - Remove all automatic unused packages /*{{{*/ // --------------------------------------------------------------------- /* Remove unused automatic packages */ @@ -576,7 +572,7 @@ bool DoAutomaticRemove(CacheFile &Cache) return true; } /*}}}*/ - +// DoCacheManipulationFromCommandLine /*{{{*/ static const unsigned short MOD_REMOVE = 1; static const unsigned short MOD_INSTALL = 2; @@ -585,7 +581,6 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache) std::map<unsigned short, APT::VersionSet> verset; return DoCacheManipulationFromCommandLine(CmdL, Cache, verset); } - bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache, std::map<unsigned short, APT::VersionSet> &verset) { @@ -719,8 +714,7 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache, return true; } - - + /*}}}*/ // DoInstall - Install packages from the command line /*{{{*/ // --------------------------------------------------------------------- /* Install named packages */ diff --git a/apt-private/private-list.cc b/apt-private/private-list.cc index c3a21aafc..8c61fcae8 100644 --- a/apt-private/private-list.cc +++ b/apt-private/private-list.cc @@ -42,7 +42,7 @@ #include <apti18n.h> /*}}}*/ -struct PackageSortAlphabetic +struct PackageSortAlphabetic /*{{{*/ { bool operator () (const pkgCache::PkgIterator &p_lhs, const pkgCache::PkgIterator &p_rhs) @@ -52,12 +52,12 @@ struct PackageSortAlphabetic return (l_name < r_name); } }; - + /*}}}*/ +class PackageNameMatcher : public Matcher /*{{{*/ +{ #ifdef PACKAGE_MATCHER_ABI_COMPAT #define PackageMatcher PackageNameMatchesFnmatch #endif -class PackageNameMatcher : public Matcher -{ public: PackageNameMatcher(const char **patterns) { @@ -98,9 +98,8 @@ private: std::vector<APT::CacheFilter::PackageMatcher*>::const_iterator J; #undef PackageMatcher }; - - -void ListAllVersions(pkgCacheFile &CacheFile, pkgRecords &records, + /*}}}*/ +void ListAllVersions(pkgCacheFile &CacheFile, pkgRecords &records, /*{{{*/ pkgCache::PkgIterator P, std::ostream &outs) { @@ -108,7 +107,7 @@ void ListAllVersions(pkgCacheFile &CacheFile, pkgRecords &records, Ver.end() == false; Ver++) ListSingleVersion(CacheFile, records, Ver, outs); } - + /*}}}*/ // list - list package based on criteria /*{{{*/ // --------------------------------------------------------------------- bool List(CommandLine &Cmd) diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc index 659975476..6fadf7274 100644 --- a/apt-private/private-output.cc +++ b/apt-private/private-output.cc @@ -28,8 +28,7 @@ std::ostream c2out(0); std::ofstream devnull("/dev/null"); unsigned int ScreenWidth = 80 - 1; /* - 1 for the cursor */ - -bool InitOutput() +bool InitOutput() /*{{{*/ { c0out.rdbuf(cout.rdbuf()); c1out.rdbuf(cout.rdbuf()); @@ -60,8 +59,8 @@ bool InitOutput() return true; } - -std::string GetArchiveSuite(pkgCacheFile &CacheFile, pkgCache::VerIterator ver) + /*}}}*/ +std::string GetArchiveSuite(pkgCacheFile &CacheFile, pkgCache::VerIterator ver) /*{{{*/ { std::string suite = ""; if (ver && ver.FileList() && ver.FileList()) @@ -77,8 +76,8 @@ std::string GetArchiveSuite(pkgCacheFile &CacheFile, pkgCache::VerIterator ver) } return suite; } - -std::string GetFlagsStr(pkgCacheFile &CacheFile, pkgCache::PkgIterator P) + /*}}}*/ +std::string GetFlagsStr(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/ { pkgDepCache *DepCache = CacheFile.GetDepCache(); pkgDepCache::StateCache &state = (*DepCache)[P]; @@ -94,23 +93,23 @@ std::string GetFlagsStr(pkgCacheFile &CacheFile, pkgCache::PkgIterator P) flags_str = "-"; return flags_str; } - -std::string GetCandidateVersion(pkgCacheFile &CacheFile, pkgCache::PkgIterator P) + /*}}}*/ +std::string GetCandidateVersion(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/ { pkgPolicy *policy = CacheFile.GetPolicy(); pkgCache::VerIterator cand = policy->GetCandidateVer(P); return cand ? cand.VerStr() : "(none)"; } - -std::string GetInstalledVersion(pkgCacheFile &CacheFile, pkgCache::PkgIterator P) + /*}}}*/ +std::string GetInstalledVersion(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/ { pkgCache::VerIterator inst = P.CurrentVer(); return inst ? inst.VerStr() : "(none)"; } - -std::string GetVersion(pkgCacheFile &CacheFile, pkgCache::VerIterator V) + /*}}}*/ +std::string GetVersion(pkgCacheFile &CacheFile, pkgCache::VerIterator V)/*{{{*/ { pkgCache::PkgIterator P = V.ParentPkg(); if (V == P.CurrentVer()) @@ -127,8 +126,8 @@ std::string GetVersion(pkgCacheFile &CacheFile, pkgCache::VerIterator V) return DeNull(V.VerStr()); return "(none)"; } - -std::string GetArchitecture(pkgCacheFile &CacheFile, pkgCache::PkgIterator P) + /*}}}*/ +std::string GetArchitecture(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/ { pkgPolicy *policy = CacheFile.GetPolicy(); pkgCache::VerIterator inst = P.CurrentVer(); @@ -136,8 +135,8 @@ std::string GetArchitecture(pkgCacheFile &CacheFile, pkgCache::PkgIterator P) return inst ? inst.Arch() : cand.Arch(); } - -std::string GetShortDescription(pkgCacheFile &CacheFile, pkgRecords &records, pkgCache::PkgIterator P) + /*}}}*/ +std::string GetShortDescription(pkgCacheFile &CacheFile, pkgRecords &records, pkgCache::PkgIterator P)/*{{{*/ { pkgPolicy *policy = CacheFile.GetPolicy(); @@ -157,8 +156,8 @@ std::string GetShortDescription(pkgCacheFile &CacheFile, pkgRecords &records, pk } return ShortDescription; } - -void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records, + /*}}}*/ +void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records, /*{{{*/ pkgCache::VerIterator V, std::ostream &out) { pkgCache::PkgIterator P = V.ParentPkg(); @@ -230,8 +229,7 @@ void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records, << std::endl; } } - - + /*}}}*/ // ShowList - Show a list /*{{{*/ // --------------------------------------------------------------------- /* This prints out a string of space separated words with a title and diff --git a/apt-private/private-search.cc b/apt-private/private-search.cc index 6881f482f..ff4140fa7 100644 --- a/apt-private/private-search.cc +++ b/apt-private/private-search.cc @@ -1,3 +1,4 @@ +// Includes /*{{{*/ #include <apt-pkg/error.h> #include <apt-pkg/cachefile.h> #include <apt-pkg/cachefilter.h> @@ -34,9 +35,9 @@ #include "private-search.h" #include "private-cacheset.h" + /*}}}*/ - -bool FullTextSearch(CommandLine &CmdL) +bool FullTextSearch(CommandLine &CmdL) /*{{{*/ { pkgCacheFile CacheFile; pkgCache *Cache = CacheFile.GetPkgCache(); @@ -97,3 +98,4 @@ bool FullTextSearch(CommandLine &CmdL) return true; } + /*}}}*/ diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc index e26a2b30a..ddc75dbeb 100644 --- a/apt-private/private-show.cc +++ b/apt-private/private-show.cc @@ -1,3 +1,4 @@ +// Includes /*{{{*/ #include <apt-pkg/error.h> #include <apt-pkg/cachefile.h> #include <apt-pkg/cachefilter.h> @@ -23,6 +24,7 @@ #include "private-output.h" #include "private-cacheset.h" + /*}}}*/ namespace APT { namespace Cmd { @@ -87,8 +89,7 @@ bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V, return true; } /*}}}*/ - -bool ShowPackage(CommandLine &CmdL) +bool ShowPackage(CommandLine &CmdL) /*{{{*/ { pkgCacheFile CacheFile; CacheSetHelperVirtuals helper(true, GlobalError::NOTICE); @@ -102,7 +103,7 @@ bool ShowPackage(CommandLine &CmdL) Pkg != helper.virtualPkgs.end(); ++Pkg) { c1out << "Package: " << Pkg.FullName(true) << std::endl; - c1out << "State: " << _("not a real pacakge (virtual)") << std::endl; + c1out << "State: " << _("not a real package (virtual)") << std::endl; // FIXME: show providers, see private-cacheset.h // CacheSetHelperAPTGet::showVirtualPackageErrors() } diff --git a/apt-private/private-upgrade.cc b/apt-private/private-upgrade.cc index 09085c2db..9a5286b57 100644 --- a/apt-private/private-upgrade.cc +++ b/apt-private/private-upgrade.cc @@ -1,13 +1,13 @@ - +// Includes /*{{{*/ #include <apt-pkg/algorithms.h> #include "private-install.h" #include "private-cachefile.h" #include "private-upgrade.h" #include "private-output.h" + /*}}}*/ - -// DoUpgradeNoNewPackages - Upgrade all packages /*{{{*/ +// DoUpgradeNoNewPackages - Upgrade all packages /*{{{*/ // --------------------------------------------------------------------- /* Upgrade all packages without installing new packages or erasing old packages */ @@ -31,7 +31,6 @@ bool DoUpgradeNoNewPackages(CommandLine &CmdL) return InstallPackages(Cache,true); } /*}}}*/ - // DoSafeUpgrade - Upgrade all packages with install but not remove /*{{{*/ bool DoUpgradeWithAllowNewPackages(CommandLine &CmdL) { diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index c273dfaaa..8a30ac38d 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -84,11 +84,8 @@ #include <apti18n.h> /*}}}*/ - using namespace std; - - // TryToInstallBuildDep - Try to install a single package /*{{{*/ // --------------------------------------------------------------------- /* This used to be inlined in DoInstall, but with the advent of regex package @@ -1625,15 +1622,14 @@ void SigWinch(int) #endif } /*}}}*/ - -bool DoUpgrade(CommandLine &CmdL) +bool DoUpgrade(CommandLine &CmdL) /*{{{*/ { if (_config->FindB("APT::Get::UpgradeAllowNew", false) == true) return DoUpgradeWithAllowNewPackages(CmdL); else return DoUpgradeNoNewPackages(CmdL); } - + /*}}}*/ int main(int argc,const char *argv[]) /*{{{*/ { CommandLine::Dispatch Cmds[] = {{"update",&DoUpdate}, diff --git a/debian/changelog b/debian/changelog index 25f5c5552..6e31784f2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,39 @@ +apt (0.9.11.5) UNRELEASED; urgency=low + + * Fix typo in apt-private/private-show.cc. Thanks to Benjamin + Keresa. Closes: #724073 + + -- Christian Perrier <bubulle@debian.org> Mon, 23 Sep 2013 07:05:34 +0200 + +apt (0.9.11.4) unstable; urgency=low + + [ Oskari Saarenmaa ] + * don't truncate 100 char long paths in tar extraction. + Thanks to Mika Eloranta for the testcase! (Closes: #689582) + + [ David Kalnischkies ] + * do not trust FileFd::Eof() in pkgTagFile::Fill() + Thanks to Cyril Brulebois (Closes: 723705) + + -- Michael Vogt <mvo@debian.org> Fri, 20 Sep 2013 16:12:07 +0200 + +apt (0.9.11.3) unstable; urgency=low + + [ Michael Vogt ] + * Add DPkgPM::Progress option to enable terminal install + progress + * fix typo (mkostemp->mkstemp) + * Remove invalid "-f" option for apt-get check, thanks to + Philipp Weis (closes: #721477) + * Fix regression of "apt-cache unmet -i", thanks to Daniel Schepler + (closes: #722324) + + [ David Kalnischkies ] + * use FileFd in HashSum test to unbreak non-linux ports. + Thanks to Aaron M. Ucko (Closes: 721723) + + -- Michael Vogt <mvo@debian.org> Tue, 10 Sep 2013 17:32:02 +0200 + apt (0.9.11.2) unstable; urgency=low [ Milo Casagrande ] diff --git a/test/integration/Packages-bug-723705-tagfile-truncates-fields b/test/integration/Packages-bug-723705-tagfile-truncates-fields new file mode 100644 index 000000000..c42b85072 --- /dev/null +++ b/test/integration/Packages-bug-723705-tagfile-truncates-fields @@ -0,0 +1,167 @@ +Package: cdebconf-gtk-udeb +Source: cdebconf +Version: 0.185 +Installed-Size: 92 +Maintainer: Debian Install System Team <debian-boot@lists.debian.org> +Architecture: amd64 +Description: Gtk+ frontend for Debian Configuration Management System +Description-md5: 75d036e0a245499123544e2254b92e9c +Section: debian-installer +Priority: optional +Filename: pool/main/c/cdebconf/cdebconf-gtk-udeb_0.185_amd64.udeb +Size: 27278 +MD5sum: a1bbbc1d4fb8e0615b5621abac021924 +SHA1: b1a7ab55a90f61e5337847d02ff1d12d73559def +SHA256: cd79f3205304a7932b3309c4df9898c9a53929bc651912659858e087ebe1c18a + +Package: cdebconf-newt-udeb +Source: cdebconf +Version: 0.185 +Installed-Size: 58 +Maintainer: Debian Install System Team <debian-boot@lists.debian.org> +Architecture: amd64 +Description: Newt frontend for Debian Configuration Management System +Description-md5: e080be5e38cb8c57bca2f3effe9ee030 +Section: debian-installer +Priority: optional +Filename: pool/main/c/cdebconf/cdebconf-newt-udeb_0.185_amd64.udeb +Size: 19192 +MD5sum: de27807f56dae2f2403b3322d5fe6bd2 +SHA1: 57883e223d46a9f25966f9b986e6a3bc2f67d8ef +SHA256: 5f8b9c3a5430f2ec879484a7736582b152d76cc8ba9bc19328268f3635759a1b + +Package: cdebconf-udeb +Source: cdebconf +Version: 0.185 +Installed-Size: 245 +Maintainer: Debian Install System Team <debian-boot@lists.debian.org> +Architecture: amd64 +Provides: debconf-2.0 +Description: Debian Configuration Management System (C-implementation) +Description-md5: 9f3579e9d9f86ac89e667a8707d3cbd3 +Section: debian-installer +Priority: standard +Filename: pool/main/c/cdebconf/cdebconf-udeb_0.185_amd64.udeb +Size: 77376 +MD5sum: e3883706fdbf54c2e5ea959c92b2d37f +SHA1: 0232f1bdf1531db628516ed3a46a27466b267fdc +SHA256: 96345575417a3e4df8a2cadaa55784ec8f6c042defb1e2fc002d941b6116ceab + +Package: cdebconf-gtk-terminal +Source: cdebconf-terminal +Version: 0.22 +Installed-Size: 64 +Maintainer: Debian Install System Team <debian-boot@lists.debian.org> +Architecture: amd64 +Provides: cdebconf-terminal +Depends: cdebconf-gtk-udeb, libc6-udeb (>= 2.17), libglib2.0-udeb (>= 2.36.4), libgtk2.0-0-udeb (>= 2.24.0), libvte9-udeb (>= 1:0.28.0), cdebconf-udeb, cdebconf-gtk-terminal, cdebconf-gtk-terminal, cdebconf-gtk-terminal, cdebconf-gtk-terminal, cdebconf-gtk-terminal, cdebconf-gtk-terminal, cdebconf-gtk-terminal +Description: cdebconf gtk plugin displaying a terminal +Description-md5: 18c4446758aec003eb8cd0a43419f1aa +Section: debian-installer +Priority: extra +Filename: pool/main/c/cdebconf-terminal/cdebconf-gtk-terminal_0.22_amd64.udeb +Size: 14734 +MD5sum: f9c3a7354560cb88e0396e2b7ba54363 +SHA1: 9c1c93328e758bfd9de2752466b271aaf38c8177 +SHA256: ca749853fc3b93db1d08ccdc6b46de27633de52bc5b880fa65275897ebcaaf69 + +Package: cdebconf-newt-terminal +Source: cdebconf-terminal +Version: 0.22 +Installed-Size: 43 +Maintainer: Debian Install System Team <debian-boot@lists.debian.org> +Architecture: amd64 +Provides: cdebconf-terminal +Depends: cdebconf-newt-udeb (>= 0.146), libc6-udeb (>= 2.17), libnewt0.52 +Description: cdebconf newt plugin to provide a clean terminal +Description-md5: 4109a053022081b573d864d84d6eb16d +Section: debian-installer +Priority: extra +Filename: pool/main/c/cdebconf-terminal/cdebconf-newt-terminal_0.22_amd64.udeb +Size: 4538 +MD5sum: 20db6152fce5081fcbf49c7c08f21246 +SHA1: fa2a40f777a2f48b9634866bc780fb059e60b2fe +SHA256: c4d99ef27285f0c9090005313165627e56e0972e687af7e68c2b1d1538e2ae09 + +Package: libc6-udeb +Source: eglibc (2.17-92) +Version: 2.17-92+b1 +Installed-Size: 3126 +Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org> +Architecture: amd64 +Provides: glibc-2.17-1, libc-udeb, libc6 +Description: Embedded GNU C Library: Shared libraries - udeb +Description-md5: 9552ce73b7b3fb466e3d89fe8db9a563 +Section: debian-installer +Priority: extra +Filename: pool/main/e/eglibc/libc6-udeb_2.17-92+b1_amd64.udeb +Size: 1056000 +MD5sum: 7fd7032eeeecf7f76eff79a0543fbd72 +SHA1: 724b6a81b8fbc9d4d2bb43d656c08de73f7ada25 +SHA256: 137d4c001bbfde8161315c36e6cb8653ae2c50a8d6b6d2d27396c492d91a1723 + +Package: libglib2.0-udeb +Source: glib2.0 +Version: 2.36.4-1 +Installed-Size: 10070 +Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org> +Architecture: amd64 +Description: GLib library of C routines - minimal runtime +Description-md5: 0244040042870a89aa49f037cce3f1e9 +Section: debian-installer +Priority: optional +Filename: pool/main/g/glib2.0/libglib2.0-udeb_2.36.4-1_amd64.udeb +Size: 1714604 +MD5sum: 72da029f1bbb36057d874f1f82a5d00a +SHA1: 32bce78a052ef19a620f43ecbe12404fa570c0f1 +SHA256: 8edbc7cb872c0a82705913563f93f9eec5750881e4378c5a48770cde840cd6eb + +Package: libgtk2.0-0-udeb +Source: gtk+2.0 +Version: 2.24.20-1 +Installed-Size: 5035 +Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org> +Architecture: amd64 +Provides: gtk2.0-binver-2.10.0 +Description: GTK+ graphical user interface library - minimal runtime +Description-md5: 32e5112b80c02578837cff4f65dfec84 +Section: debian-installer +Priority: extra +Filename: pool/main/g/gtk+2.0/libgtk2.0-0-udeb_2.24.20-1_amd64.udeb +Size: 1643046 +MD5sum: 25513478eb2e02e5766c0eea0b411ca9 +SHA1: 9274f05bfa930a3406403441ce061bade04e2064 +SHA256: d5f611f48928ae02f759105cf8cff467cde1cb44df56ad31067168b46a80f8bc + +Package: libvte9-udeb +Source: vte +Version: 1:0.28.2-5 +Installed-Size: 628 +Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org> +Architecture: amd64 +Description: Terminal emulator widget for GTK+ 2.0 - minimal runtime +Description-md5: e7993385c30bae6e96c8cb87795a513c +Section: debian-installer +Priority: extra +Filename: pool/main/v/vte/libvte9-udeb_0.28.2-5_amd64.udeb +Size: 216968 +MD5sum: 7da7201effaf5ced19abd9d0b45aa2c6 +SHA1: a424cf779e7614d79740c422b6342de04fed3646 +SHA256: 4963033cbda5a8ba7eb8ebf1debae34463b8e63b821259860cfb51c1ab99562d + +Package: zlib1g-udeb +Source: zlib +Version: 1:1.2.8.dfsg-1 +Installed-Size: 115 +Maintainer: Mark Brown <broonie@debian.org> +Architecture: amd64 +Description: compression library - runtime for Debian installer +Description-md5: 9cab974e3eab657c53bc17611b894c7a +Section: debian-installer +Priority: optional +Filename: pool/main/z/zlib/zlib1g-udeb_1.2.8.dfsg-1_amd64.udeb +Size: 45270 +MD5sum: c02884420f79a3ae4569cf67782f3e74 +SHA1: 7cd1a7c8be4e086de733a0ce76f87d42b8b2173b +SHA256: 61641ee2b5e185232108333438b72bec71ef549fe0e0df1b2b3afa37174e53a7 + diff --git a/test/integration/status-bug-723705-tagfile-truncates-fields b/test/integration/status-bug-723705-tagfile-truncates-fields new file mode 100644 index 000000000..fe18506c8 --- /dev/null +++ b/test/integration/status-bug-723705-tagfile-truncates-fields @@ -0,0 +1,62 @@ +Package: libc6 +Status: install ok installed +Priority: required +Section: libs +Installed-Size: 10164 +Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org> +Architecture: amd64 +Multi-Arch: same +Source: eglibc (2.17-92) +Version: 2.17-92+b1 +Replaces: libc6-amd64 +Provides: glibc-2.17-1 +Suggests: glibc-doc, debconf | debconf-2.0, locales +Breaks: locales (<< 2.17), locales-all (<< 2.17), lsb-core (<= 3.2-27), nscd (<< 2.17) +Conflicts: prelink (<= 0.0.20090311-1), tzdata (<< 2007k-1), tzdata-etch +Conffiles: + /etc/ld.so.conf.d/x86_64-linux-gnu.conf 593ad12389ab2b6f952e7ede67b8fbbf +Description: Embedded GNU C Library: Shared libraries + Contains the standard libraries that are used by nearly all programs on + the system. This package includes shared versions of the standard C library + and the standard math library, as well as many others. +Homepage: http://www.eglibc.org + +Package: libnewt0.52 +Status: install ok installed +Priority: important +Section: libs +Installed-Size: 820 +Maintainer: Alastair McKinstry <mckinstry@debian.org> +Architecture: amd64 +Multi-Arch: same +Source: newt +Version: 0.52.15-3 +Recommends: libfribidi0 +Conffiles: + /etc/newt/palette.original d41d8cd98f00b204e9800998ecf8427e +Description: Not Erik's Windowing Toolkit - text mode windowing with slang + Newt is a windowing toolkit for text mode built from the slang library. + It allows color text mode applications to easily use stackable windows, + push buttons, check boxes, radio buttons, lists, entry fields, labels, + and displayable text. Scrollbars are supported, and forms may be nested + to provide extra functionality. This package contains the shared library + for programs that have been built with newt. +Homepage: https://fedorahosted.org/newt/ + +Package: libgcc1 +Status: install ok installed +Priority: required +Section: libs +Installed-Size: 128 +Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org> +Architecture: amd64 +Multi-Arch: same +Source: gcc-4.8 (4.8.1-10) +Version: 1:4.8.1-10 +Breaks: gcc-4.1, gcc-4.3 (<< 4.3.6-1), gcc-4.4 (<< 4.4.6-4), gcc-4.5 (<< 4.5.3-2) +Description: GCC support library + Shared version of the support library, a library of internal subroutines + that GCC uses to overcome shortcomings of particular machines, or + special needs for some languages. +Homepage: http://gcc.gnu.org/ + diff --git a/test/integration/test-bug-596498-trusted-unsigned-repo b/test/integration/test-bug-596498-trusted-unsigned-repo index 5c643c40e..06c9c8285 100755 --- a/test/integration/test-bug-596498-trusted-unsigned-repo +++ b/test/integration/test-bug-596498-trusted-unsigned-repo @@ -21,6 +21,9 @@ DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-deb.list' testequal "$PKGTEXT Download complete and in download only mode" aptget install cool --assume-no -d +testequal "$PKGTEXT +Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated + sed -i -e 's#deb#deb [trusted=no]#' $DEBFILE aptgetupdate @@ -40,6 +43,12 @@ WARNING: The following packages cannot be authenticated! Install these packages without verification? [y/N] N E: Some packages could not be authenticated" aptget install cool --assume-no -d +testequal "$PKGTEXT +WARNING: The following packages cannot be authenticated! + cool +Authentication warning overridden. +Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated + sed -i -e 's#deb#deb [trusted=yes]#' $DEBFILE aptgetupdate diff --git a/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted b/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted new file mode 100755 index 000000000..1c2514938 --- /dev/null +++ b/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted @@ -0,0 +1,52 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +buildsimplenativepackage 'cool' 'i386' '1.0' 'unstable' + +setupaptarchive --no-update + +testfileexists() { + msgtest 'Test for existance of file' "$1" + test -e "$1" && msgpass || msgfail + rm -f "$1" +} + +testfilemissing() { + msgtest 'Test for non-existance of file' "$1" + test -e "$1" && msgfail || msgpass + rm -f "$1" +} + +testrun() { + rm -rf rootdir/var/lib/apt + testsuccess aptget update + + testsuccess aptget download cool + testfileexists 'cool_1.0_i386.deb' + + mv aptarchive/pool/cool_1.0_i386.deb aptarchive/pool/cool_1.0_i386.deb.bak + echo 'this is not a good package' > aptarchive/pool/cool_1.0_i386.deb + # FIXME: apt-get download should exit non-zero if download fails + aptget download cool + testfilemissing cool_1.0_i386.deb + + # FIXME: apt-get download should exit non-zero if download fails + aptget download cool --allow-unauthenticated # unauthenticated doesn't mean unchecked + testfilemissing cool_1.0_i386.deb + + rm -f aptarchive/pool/cool_1.0_i386.deb + mv aptarchive/pool/cool_1.0_i386.deb.bak aptarchive/pool/cool_1.0_i386.deb + testsuccess aptget download cool --allow-unauthenticated + testfileexists 'cool_1.0_i386.deb' +} + +testrun + +find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete +# FIXME: apt-get download should warn about untrusted downloads +testrun diff --git a/test/integration/test-bug-689582-100-char-long-path-names b/test/integration/test-bug-689582-100-char-long-path-names new file mode 100755 index 000000000..1b4b172b6 --- /dev/null +++ b/test/integration/test-bug-689582-100-char-long-path-names @@ -0,0 +1,35 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +mkdir aptarchive/testpkg +cd aptarchive/testpkg + +for i in $(seq 98 102); do + touch "$(printf "%0${i}d" "$i")" +done +tar zcf data.tar.gz 00* + +echo 'Package: testpkg +Version: 1-1 +Architecture: all +Maintainer: Joe Sixpack <joe@example.org> +Description: Package for test +Section: debug +Priority: extra' > control +tar zcf control.tar.gz control + +echo '2.0' > debian-binary +ar cr ../testpkg.deb debian-binary control.tar.gz data.tar.gz + +cd - > /dev/null + +testequal '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000102 testpkg +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101 testpkg +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100 testpkg +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000099 testpkg +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098 testpkg' aptftparchive contents aptarchive/ diff --git a/test/integration/test-bug-722207-print-uris-even-if-very-quiet b/test/integration/test-bug-722207-print-uris-even-if-very-quiet new file mode 100755 index 000000000..9524bab07 --- /dev/null +++ b/test/integration/test-bug-722207-print-uris-even-if-very-quiet @@ -0,0 +1,30 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'amd64' + +insertinstalledpackage 'apt' 'all' '1' +insertpackage 'unstable' 'apt' 'all' '2' +insertsource 'unstable' 'apt' 'all' '2' +insertsource 'unstable' 'apt2' 'all' '1' + +setupaptarchive + +APTARCHIVE=$(readlink -f ./aptarchive) + +testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 MD5Sum:" aptget upgrade -qq --print-uris +testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 MD5Sum:" aptget dist-upgrade -qq --print-uris +testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 MD5Sum:" aptget install apt -qq --print-uris +testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 :" aptget download apt -qq --print-uris +testequal "'file://${APTARCHIVE}/apt_2.dsc' apt_2.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/apt_2.tar.gz' apt_2.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source apt -qq --print-uris +testequal "'http://packages.debian.org/changelogs/pool/main/apt/apt_2/changelog'" aptget changelog apt -qq --print-uris + +testequal "'file://${APTARCHIVE}/apt_2.dsc' apt_2.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/apt_2.tar.gz' apt_2.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/apt2_1.dsc' apt2_1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/apt2_1.tar.gz' apt2_1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source apt apt2 -qq --print-uris diff --git a/test/integration/test-bug-723586-any-stripped-in-single-arch b/test/integration/test-bug-723586-any-stripped-in-single-arch new file mode 100755 index 000000000..392b88e9f --- /dev/null +++ b/test/integration/test-bug-723586-any-stripped-in-single-arch @@ -0,0 +1,54 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +insertinstalledpackage 'python3' 'all' '3.2.3-6' + +insertpackage 'unstable' 'python3' 'amd64' '3.3.2-16' 'Multi-Arch: allowed' +insertpackage 'stable' 'python3-gnupg' 'all' '0.3.5-2' 'Depends: python3:any (>= 3.2.3-3~)' + +insertpackage 'unstable' 'python-mips' 'amd64' '3' 'Depends: python3:mips' + +setupaptarchive + +INSTALLLOG='Reading package lists... +Building dependency tree... +The following extra packages will be installed: + python3 +The following NEW packages will be installed: + python3-gnupg +The following packages will be upgraded: + python3 +1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst python3 [3.2.3-6] (3.3.2-16 unstable [amd64]) +Inst python3-gnupg (0.3.5-2 stable [all]) +Conf python3 (3.3.2-16 unstable [amd64]) +Conf python3-gnupg (0.3.5-2 stable [all])' + +FAILLOG='Reading package lists... +Building dependency tree... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + python-mips : Depends: python3:mips but it is not installable +E: Unable to correct problems, you have held broken packages.' + +testequal "$INSTALLLOG" aptget install python3-gnupg -s +aptcache showpkg python3 > showpkg.log +testequal "$FAILLOG" aptget install python-mips -s + +# same test, but this time in a multi-arch environment +configarchitecture 'amd64' 'armhf' +rm rootdir/var/cache/apt/*.bin + +testequal "$INSTALLLOG" aptget install python3-gnupg -s +testequal "$(sed 's#3.3.2-16 - python3#3.3.2-16 - python3:any:armhf python3#' showpkg.log)" aptcache showpkg python3 +testequal "$FAILLOG" aptget install python-mips -s diff --git a/test/integration/test-bug-723705-tagfile-truncates-fields b/test/integration/test-bug-723705-tagfile-truncates-fields new file mode 100755 index 000000000..3180e7fc9 --- /dev/null +++ b/test/integration/test-bug-723705-tagfile-truncates-fields @@ -0,0 +1,33 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +setupaptarchive + +aptget install --print-uris -y cdebconf-newt-terminal cdebconf-gtk-terminal 2>&1 | sed 's#file:///tmp/tmp.[^/]\+#file:///tmp#g' > filename.log + +testfileequal filename.log "Reading package lists... +Building dependency tree... +The following extra packages will be installed: + cdebconf-gtk-udeb cdebconf-newt-udeb cdebconf-udeb libc6-udeb + libglib2.0-udeb libgtk2.0-0-udeb libvte9-udeb +The following NEW packages will be installed: + cdebconf-gtk-terminal cdebconf-gtk-udeb cdebconf-newt-terminal + cdebconf-newt-udeb cdebconf-udeb libc6-udeb libglib2.0-udeb libgtk2.0-0-udeb + libvte9-udeb +0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded. +Need to get 0 B/4774 kB of archives. +After this operation, 19.8 MB of additional disk space will be used. +'file:///tmp/aptarchive/pool/main/c/cdebconf/cdebconf-udeb_0.185_amd64.udeb' cdebconf-udeb_0.185_amd64.udeb 77376 MD5Sum:e3883706fdbf54c2e5ea959c92b2d37f +'file:///tmp/aptarchive/pool/main/c/cdebconf/cdebconf-gtk-udeb_0.185_amd64.udeb' cdebconf-gtk-udeb_0.185_amd64.udeb 27278 MD5Sum:a1bbbc1d4fb8e0615b5621abac021924 +'file:///tmp/aptarchive/pool/main/c/cdebconf/cdebconf-newt-udeb_0.185_amd64.udeb' cdebconf-newt-udeb_0.185_amd64.udeb 19192 MD5Sum:de27807f56dae2f2403b3322d5fe6bd2 +'file:///tmp/aptarchive/pool/main/g/glib2.0/libglib2.0-udeb_2.36.4-1_amd64.udeb' libglib2.0-udeb_2.36.4-1_amd64.udeb 1714604 MD5Sum:72da029f1bbb36057d874f1f82a5d00a +'file:///tmp/aptarchive/pool/main/e/eglibc/libc6-udeb_2.17-92+b1_amd64.udeb' libc6-udeb_2.17-92+b1_amd64.udeb 1056000 MD5Sum:7fd7032eeeecf7f76eff79a0543fbd72 +'file:///tmp/aptarchive/pool/main/g/gtk+2.0/libgtk2.0-0-udeb_2.24.20-1_amd64.udeb' libgtk2.0-0-udeb_2.24.20-1_amd64.udeb 1643046 MD5Sum:25513478eb2e02e5766c0eea0b411ca9 +'file:///tmp/aptarchive/pool/main/v/vte/libvte9-udeb_0.28.2-5_amd64.udeb' libvte9-udeb_1%3a0.28.2-5_amd64.udeb 216968 MD5Sum:7da7201effaf5ced19abd9d0b45aa2c6 +'file:///tmp/aptarchive/pool/main/c/cdebconf-terminal/cdebconf-gtk-terminal_0.22_amd64.udeb' cdebconf-gtk-terminal_0.22_amd64.udeb 14734 MD5Sum:f9c3a7354560cb88e0396e2b7ba54363 +'file:///tmp/aptarchive/pool/main/c/cdebconf-terminal/cdebconf-newt-terminal_0.22_amd64.udeb' cdebconf-newt-terminal_0.22_amd64.udeb 4538 MD5Sum:20db6152fce5081fcbf49c7c08f21246" diff --git a/test/libapt/hashsums_test.cc b/test/libapt/hashsums_test.cc index e2d0aec5b..3da89052b 100644 --- a/test/libapt/hashsums_test.cc +++ b/test/libapt/hashsums_test.cc @@ -3,6 +3,7 @@ #include <apt-pkg/sha2.h> #include <apt-pkg/strutl.h> #include <apt-pkg/hashes.h> +#include <apt-pkg/fileutl.h> #include <iostream> #include <stdio.h> @@ -108,55 +109,54 @@ int main(int argc, char** argv) Test<SHA512Summation>("The quick brown fox jumps over the lazy dog.", "91ea1245f20d46ae9a037a989f54f1f790f0a47607eeb8a14d12890cea77a1bb" "c6c7ed9cf205e67b7f2b8fd4c7dfd3a7a8617e45f3c463d481c7e586c39ac1ed"); - FILE* fd = fopen(argv[1], "r"); - if (fd == NULL) { + FileFd fd(argv[1], FileFd::ReadOnly); + if (fd.IsOpen() == false) { std::cerr << "Can't open file for 1. testing: " << argv[1] << std::endl; return 1; } { Hashes hashes; - hashes.AddFD(fileno(fd)); + hashes.AddFD(fd.Fd()); equals(argv[2], hashes.MD5.Result().Value()); equals(argv[3], hashes.SHA1.Result().Value()); equals(argv[4], hashes.SHA256.Result().Value()); equals(argv[5], hashes.SHA512.Result().Value()); } - fseek(fd, 0L, SEEK_END); - unsigned long sz = ftell(fd); - fseek(fd, 0L, SEEK_SET); + unsigned long sz = fd.FileSize(); + fd.Seek(0); { Hashes hashes; - hashes.AddFD(fileno(fd), sz); + hashes.AddFD(fd.Fd(), sz); equals(argv[2], hashes.MD5.Result().Value()); equals(argv[3], hashes.SHA1.Result().Value()); equals(argv[4], hashes.SHA256.Result().Value()); equals(argv[5], hashes.SHA512.Result().Value()); } - fseek(fd, 0L, SEEK_SET); + fd.Seek(0); { MD5Summation md5; - md5.AddFD(fileno(fd)); + md5.AddFD(fd.Fd()); equals(argv[2], md5.Result().Value()); } - fseek(fd, 0L, SEEK_SET); + fd.Seek(0); { SHA1Summation sha1; - sha1.AddFD(fileno(fd)); + sha1.AddFD(fd.Fd()); equals(argv[3], sha1.Result().Value()); } - fseek(fd, 0L, SEEK_SET); + fd.Seek(0); { SHA256Summation sha2; - sha2.AddFD(fileno(fd)); + sha2.AddFD(fd.Fd()); equals(argv[4], sha2.Result().Value()); } - fseek(fd, 0L, SEEK_SET); + fd.Seek(0); { SHA512Summation sha2; - sha2.AddFD(fileno(fd)); + sha2.AddFD(fd.Fd()); equals(argv[5], sha2.Result().Value()); } - fclose(fd); + fd.Close(); // test HashString code { |