summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
Commit message (Collapse)AuthorAgeFilesLines
* don't cleanup cdrom files in apt-get updateDavid Kalnischkies2014-10-151-8/+7
| | | | | | | | | | Regression from merging 801745284905e7962aa77a9f37a6b4e7fcdc19d0 and b0f4b486e6850c5f98520ccf19da71d0ed748ae4. While fine by itself, merged the part fixing the filename is skipped if a cdrom source is encountered, so that our list-cleanup removes what seems to be orphaned files. Closes: 765458
* Merge remote-tracking branch 'donkult/feature/generalize-gzipindex' into ↵Michael Vogt2014-09-261-15/+29
|\ | | | | | | debian/sid
| * generalize Acquire::GzipIndexMichael Vogt2014-09-211-15/+29
| |
* | Fix regression for cdrom: sources from latest security updateMichael Vogt2014-09-211-0/+6
|/ | | | | | | | | | Skip a reverify for cdrom: sources. The reverify step is actually harmful here because the apt-cdrom add code uses the indexcopy.cc which will "normalize" the Packages file from the cdrom when it writes it to the local disk. This leads to changing the "MD5sum" field (notice the lower case "s") on the cdrom Packages file to a "MD5Sum" field on the local file in /var/lib/apt/lists. Which of course alters the hash and makes apt fail to reverify the file.
* improve test for commit daff4aMichael Vogt2014-09-171-2/+3
|
* Fix regression for file:/// uris from CVE-2014-0487Michael Vogt2014-09-171-12/+6
| | | | | | | | Do not run ReverifyAfterIMS() for local file URIs as this will causes apt to mess around in the file:/// uri space. This is wrong in itself, but it will also cause a incorrect verification failure when the archive and the lists directory are on different partitions as rename().
* SECURITY UPDATE for CVE-2014-{0488,0487,0489}Michael Vogt2014-09-161-22/+75
| | | | | | incorrect invalidating of unauthenticated data (CVE-2014-0488) incorect verification of 304 reply (CVE-2014-0487) incorrect verification of Acquire::Gzip indexes (CVE-2014-0489)
* apt-pkg/acquire-item.cc: make pkgAcqDiffIndex more uniformMichael Vogt2014-07-171-2/+2
|
* Try not to parse invalid translation files (LP: #756317)Michael Vogt2014-07-031-25/+17
|
* initialize Verify in second pkgAcqIndex constructorDavid Kalnischkies2014-04-281-0/+2
| | | | | | | | | | | | | | gcc reports in testcase ./test-bug-596498-trusted-unsigned-repo: apt-pkg/acquire-item.cc:1059:7: runtime error: load of value 234, which is not a valid value for type 'bool' This happens as the bool Verify is initialized only in one of the two constructors of the pkgAcqIndex class. It isn't a problem through as the verification controlled by this flag is optional and used to fail early on garbage files (like network portal pages) instead of later on in the hashsum verification or while parsing (the then untrusted) file. Reported-By: gcc-4.9 -fsanitize=undefined
* use the pretty fullname of a pkg as download desciptionDavid Kalnischkies2014-03-131-6/+2
| | | | | | Otherwise the "WARNING: The following packages cannot be authenticated!" messages does not include the architecture of the package, so it would be slightly misinformative.
* follow method attribute suggestions by gccDavid Kalnischkies2014-03-131-1/+1
| | | | | Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn}
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-3/+12
| | | | | | | | Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use)
* warning: unused parameter ‘foo’ [-Wunused-parameter]David Kalnischkies2014-03-131-10/+10
| | | | | Reported-By: gcc -Wunused-parameter Git-Dch: Ignore
* warning: useless cast to type A [-Wuseless-cast]David Kalnischkies2014-03-131-6/+6
| | | | | Git-Dch: Ignore Reported-By: gcc -Wuseless-cast
* initial version of apt-helperMichael Vogt2014-02-271-1/+1
|
* Fix typos in documentation (codespell)Michael Vogt2014-02-221-10/+10
|
* always cleanup patchfiles at the end of rred callDavid Kalnischkies2014-02-101-0/+9
| | | | | | | | | With APT::Get::List-Cleanup disabled the ed-style patch files are lingering in the lists/ directory otherwise. That was kinda okay in the old none-client-merge as the filename was always the same so it was constantly overridden, but now with different names for client-merge quiet a few could pill up on the system and are used by the next call as it picks them up based on the filename.
* integrate Anthonys rred with POC for client-side mergeDavid Kalnischkies2014-01-151-8/+3
| | | | | | | | | | | | | Providing the benefits of both without the downsides :) (ABI breaks or external dependencies) For this Anthonys rred is equipped with: - magic-filename-pickup of patches rather than explicit messages - use of FileFd instead of FILE* to get on-the-fly uncompress of the gzip compressed pdiff patches The acquire code in turn stops checking for apt-file's helper as our own rred is now clever enough for our needs.
* reenable unlimited pdiff files downloadDavid Kalnischkies2014-01-151-1/+1
| | | | | | | | | | | | In 51fc6def77edfb1f429a48e5169519e9e05a759b we limited the amount of pdiff to be downloaded per index to 20. This was a compromise between not letting it go overboard (becoming even slower) and not using bandwidth needlessly. Now that with the POC the speed reason is gone it makes sense again to download as much files as we possible can via pdiff to save bandwidth (and possibly even time). It also avoids problems with the limit in cases we were we deal with a server merged archieve as this limit assumes a strict patch progression.
* correct IndexDiff vs DiffIndex in Debug outputAnthony Towns2014-01-151-6/+6
|
* implement POC client-side merging of pdiffs via apt-fileDavid Kalnischkies2013-12-131-3/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of pdiffs is to avoid downloading the hole file by patching the existing index. This works very well, but becomes slow if a lot of patches needs to be applied to reconstruct an up-to-date index and in recent years more and more dinstall (or similar) runs are executed creating more and more pdiffs in the same amount of time, so pdiffs became less useful. The solution is simple: Reduce the amount of patches (which are very small) which need to be applied on top of the index we have available (which is usually pretty big). This can be done in two ways: Either merge the patches on the server-side so that the client has to download only one patch or the patches are all downloaded and merged on the client-side. The first needs a client who is doing one step at a time who can also skip patches if it needs (APT supports this for a long time now). The later is implemented by this commit, but depends on the server NOT merging the patches and the patches being in a strict order in which no patch is skipped. This is traditionally the case for dak, but other repository creators support merging – e.g. reprepro (which helpfully adds a flag indicating that the patches are merged). To support both or even mixes a client needs more information which isn't available for now. This POC uses the external diffindex-rred included in apt-file to do the heavy lifting of merging & applying all patches in one pass, hence to test this feature apt-file needs to be installed.
* query an empty pkgAcqIndexDiffs if index is up-to-dateDavid Kalnischkies2013-12-131-7/+9
| | | | | | | The previous code already did this, this is just being a hell of a lot more obvious, so that it isn't that easy to break in the future. Git-Dch: Ignore
* Merge remote-tracking branch 'mvo/feature/limit-default-pdiffs' into debian/sidMichael Vogt2013-10-091-1/+1
|\
| * set Acquire::PDiffs::FileLimit to 20 to avoid needless huge fetchesMichael Vogt2013-08-261-1/+1
| |
* | use pkgAcqArchive in 'download' for proper errorsDavid Kalnischkies2013-10-031-3/+2
| | | | | | | | | | | | | | With a bit of trickery we can reuse the usual infrastructure we have in place to acquire deb files for the 'download' operation as well, which gains us authentification check & display, error messages, correct filenames and "downloads" from the root-owned archives.
* | refactor onError relabeling of DestFile as '.FAILED'David Kalnischkies2013-10-031-32/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This helps ensure three things: - each error is reported via ReportMirrorFailure - if DestFile doesn't exist, do not attempt rename - renames happen for every error The last one wasn't the case for Size mismatches, which isn't nice, but not a exploitable problem per-se as the file isn't picked up and remains in partial/ where the following download-try will at most take it for a partial request which fails the hashsum verification later on Git-Dch: Ignore
* | pkg from only trusted sources keeps being trustedDavid Kalnischkies2013-09-261-8/+15
|/ | | | | | | | | | | | | | | | | --allow-unauthenticated switches the download to a pre-0.6 system in which a package can come from any source, rather than that trusted packages can only come from trusted sources. To allow this the flag used to set all packages as untrusted, which is a bit much, so we check now if the package can be acquired via an untrusted source and only if this is the case set it as untrusted. As APT nowadays supports setting sources as trusted via a flag in the sources.list this mode shouldn't be used that much anymore though. [Note that this is not the patch from the BTS] Closes: 617690
* Merge remote-tracking branch 'mvo/bugfix/coverity' into debian/sidMichael Vogt2013-08-221-0/+2
|\ | | | | | | | | Conflicts: apt-pkg/tagfile.h
| * some more coverity fixesMichael Vogt2013-08-121-0/+2
| |
* | fix: --print-uris removes authenticationDavid Kalnischkies2013-08-121-4/+27
|/ | | | | | | | | | | | | | | | | The constructors of our (clear)sign-acquire-items move a pre-existent file for error-recovery away, which gets restored or discarded later as the acquire progresses, but --print-uris never really starts the acquire process, so the files aren't restored (as they should). To fix this both get a destructor which checks for signs of acquire doing anything and if it hasn't the file is restored. Note that these virtual destructors theoretically break the API, but only with classes extending the sign-acquire-items and nobody does this, as it would be insane for library users to fiddle with Acquire internals – and these classes are internals. Closes: 719263
* pick up Translation-* even if only compressed availableDavid Kalnischkies2013-07-251-2/+13
| | | | | | | | | | | | | | | | On CD-ROMs Translation-* files are only in compressed form included in the Release file. This used to work while we had no record of Translation-* files in the Release file at all as APT would have just guessed the (compressed) filename and accepted it (unchecked), but now that it checks for the presents of entries and if it finds records it expects the uncompressed to be verifiable. This commit relaxes this requirement again to fix the regression. We are still secure "enough" as we can validate the compressed file we have downloaded, so we don't loose anything by not requiring a hashsum for the uncompressed files to double-check them. Closes: 717665
* do not redownload unchanged InRelease filesDavid Kalnischkies2013-06-201-1/+12
| | | | | | | | | | | | Before we download the 'new' InRelease file the old file will be moved out of the way with the name 'foobar_InRelease.reverify', so if no partial file for the 'new' file exists take the modification time from this reverify file, so that if we get an IMS hit for the InRelease file we can move back the reverify file as new file rather than downloading the 'new' file even though we already have it. We do the same for Release files and this happened to work until the reverify renaming was corrected for InRelease files.
* Fix English spelling error in a message ('A error'). Unfuzzybubulle@debian.org2013-04-101-1/+1
| | | translations. Closes: #705087
* merged bundle from davidMichael Vogt2013-04-081-2/+2
|\
| * various simple changes to fix cppcheck warningsDavid Kalnischkies2013-03-101-2/+2
| |
* | merged lp:~mvo/apt/fix-inrelease5Michael Vogt2013-04-021-10/+16
|\ \ | |/ |/|
| * * apt-pkg/acquire-item.cc:David Kalnischkies2013-03-151-10/+16
| | | | | | | | - keep the last good InRelease file around just as we do it with Release.gpg in case the new one we download isn't good for us
* | ensure sha512 is really used when available (thanks to Tyler Hicks )Michael Vogt2013-01-141-1/+1
|/
* add Debug::pkgAcqArchive::NoQueue to disable package downloadingDavid Kalnischkies2012-03-061-1/+12
|
* * apt-pkg/acquire-item.cc:David Kalnischkies2012-03-041-0/+7
| | | | | | | | | | | | | | | | | | | | | - remove 'old' InRelease file if we can't get a new one before proceeding with Release.gpg to avoid the false impression of a still trusted repository by a (still present) old InRelease file. Thanks to Simon Ruderich for reporting this issue! (CVE-2012-0214) Effected are all versions >= 0.8.11 Possible attack summary: - Attacker needs to find a user which has run at least one successful 'apt-get update' against an archive providing InRelease files. - Create a Packages file with his preferred content. - Attacker then prevents the download of InRelease, Release and Release.gpg (alternatively he creates a valid Release file and sends this, the other two files need to be missing either way). - User updates against this, getting the modified Packages file without any indication of being unsigned (beside the "Ign InRelease" and "Ign Release.gpg" in the output of 'apt-get update'). => deb files from this source are considered 'trusted' (and therefore the user isn't asked for an additional confirmation before install)
* use pdiff for Translation-* files if available (Closes: #657902)David Kalnischkies2012-02-181-1/+6
| | | | Beware: pdiffs for Translation-* are only acquired if their availability is advertised in the Release file.
* * apt-pkg/acquire-item.cc:David Kalnischkies2012-02-181-47/+20
| | | | | | | | | | | | | | | - drop support for i18n/Index file (introduced in 0.8.11) and use the Release file instead to get the Translations (Closes: #649314) * ftparchive/writer.cc: - add 'Translation-*' to the default patterns i18n/Index was never used outside debian - and even here it isn't used consistently as only 'main' has such a file. As the Release file now includes the Translation-* files we therefore drop support for i18n/Index. A version supporting it was never part of a debian release and still supporting it would mean that we get 99% of the time a 404 as response to the request anyway and confuse archive maintainers who want to provide all files APT tries to acquire.
* try to avoid direct usage of .Fd() if possible and do read()s and coDavid Kalnischkies2011-12-171-2/+2
| | | | on the FileFd instead
* use forward declaration in headers if possible instead of includesDavid Kalnischkies2011-09-191-0/+2
|
* merge with debian/sidDavid Kalnischkies2011-09-131-25/+22
|\
| * * apt-pkg/acquire-item.cc:David Kalnischkies2011-08-221-25/+22
| | | | | | | | - if no Release.gpg file is found try to verify with hashes, but do not fail if a hash can't be found
* | merge with debian/experimentalDavid Kalnischkies2011-09-131-23/+23
|\ \
| * | merged from the debian-sid branchMichael Vogt2011-08-151-13/+15
| |\|
| | * merged fixes from lp:~mvo/apt/mvoMichael Vogt2011-08-151-0/+1
| | |\