summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
Commit message (Collapse)AuthorAgeFilesLines
* allow options between command and -- on commandlineDavid Kalnischkies2014-11-101-8/+11
| | | | | | | This used to work before we implemented a stricter commandline parser and e.g. the dd-schroot-cmd command constructs commandlines like this. Reported-By: Helmut Grohne
* add a simple container for HashStringsDavid Kalnischkies2014-11-102-15/+187
| | | | | | | | | | | | | APT supports more than just one HashString and even allows to enforce the usage of a specific hash. This class is intended to help with storage and passing around of the HashStrings. The cherry-pick here the un-const-ification of HashType() compared to f4c3850ea335545e297504941dc8c7a8f1c83358. The point of this commit is adding infrastructure for the next one. All by itself, it just adds new symbols. Git-Dch: Ignore
* SECURITY UPDATE for CVE-2014-{0488,0487,0489}Michael Vogt2014-09-161-0/+2
| | | | | | 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)
* Allow override of Proxy-Auto-Detect by the users configurationMichael Vogt2014-09-121-0/+4
| | | | | | | Only run the Proxy-Auto-Detect code if there is not already a host specific configuration. Closes: 759264
* strip everything spacey in APT::String::StripDavid Kalnischkies2014-09-071-6/+18
| | | | Git-Dch: Ignore
* Make Proxy-Auto-Detect check for each hostMichael Vogt2014-09-022-0/+98
| | | | | | | | | When doing Acquire::http{,s}::Proxy-Auto-Detect, run the auto-detect command for each host instead of only once. This should make using "proxy" from libproxy-tools feasible which can then be used for PAC style or other proxy configurations. Closes: #759264
* StringToBool: only act if the entire string is consumed by strtol()Michael Vogt2014-07-161-3/+6
| | | | | | | | | StringToBool uses strtol() internally to check if the argument is a number. This function stops when it does not find any more numbers. So a string like "0ad" (which is a valid packagename) is interpreted as a "0". The code now checks that the entire string is consumed not just a part of it. Thanks to Johannes Schauer for raising this issue.
* fix SubstVar to be usable as a replace_all methodDavid Kalnischkies2014-06-181-7/+14
| | | | | | | The name suggests that it is supposed to substitute a variable with a value, but we tend to use it in a more liberal replace_all() fashion, but this breaks if either of the parameters is empty or more importantly if two "variable" occurrences follow each other directly.
* without a filename we can't stat pipesDavid Kalnischkies2014-05-301-1/+2
| | | | | | | | | EDSP code uses pipes opened via an FD as sources and later for those files modification times and filesize are read - but never really used again. The result we get from FileFd is probably wrong, but as we don't use it anyway, we just don't fallback if we have nothing to fallback to Git-Dch: Ignore
* use free() instead of delete() when realloc is usedMichael Vogt2014-05-271-1/+2
| | | | | | | ContentsExtract::~ContentsExtract() needs to use free() because Data got allocated via realloc() Reported-By: clang -fsanitize=address -fno-omit-frame-pointer
* Merge remote-tracking branch 'mvo/feature/apt-ftparchive-srccache2' into ↵Michael Vogt2014-05-072-1/+3
|\ | | | | | | debian/sid
| * Implement CacheDB for source packages in apt-ftparchiveMichael Vogt2014-04-042-1/+3
| |
* | fix FileFd::Size bitswap on big-endian architecturesAdam Conrad2014-04-261-13/+4
| | | | | | | | | | | | | | | | | | gzip only gives us 32bit of size, storing it in a 64bit container and doing a 32bit flip on it has therefore unintended results. So we just go with a exact size container and let the flipping be handled by eglibc provided le32toh removing our #ifdef machinery. Closes: 745866
* | clear HitEof flag in FileFd::SeekDavid Kalnischkies2014-04-161-1/+6
| | | | | | | | | | | | | | | | | | fseek and co do this to their eof-flags and it is more logic this way as we will usually seek away from the end (e.g. to re-read the file). The commit also improves the testcase further and adds a test for the binary compressor codepath (as gz, bzip2 and xz are handled by libraries) via the use of 'rev' as a 'compressor'.
* | deal with umask only if we really need to for mkstempDavid Kalnischkies2014-04-111-9/+9
| | | | | | | | | | | | | | | | | | As the comment actually says: open() does the umask dance by itself, so we don't need to do it for it. We have to do it after mkstemp in Atomic though, so move it into the if. Also removes the "micro-optimisation" "FilePermissions == 600" as it doesn't trigger at the moment anyway as 600 != 0600.
* | don't double-count seeks in FileFd::Skip for bzip/xzDavid Kalnischkies2014-04-111-1/+0
| | | | | | | | | | FileFd::Read already deals with the increase of the skipposition so that we as the caller in FileFd::Skip really shouldn't increase it, too.
* | improve umask/fchmod code readabilityMichael Vogt2014-04-101-5/+8
| |
* | Rename FileFd::Open() Perms to AccessModeMichael Vogt2014-04-102-14/+14
| | | | | | | | | | | | | | Bug lp:#1304657 was caused by confusion around the name Perms. The new name AccessMode should make it clear that its not the literal file permissions but instead the AccessMode passed to open() (i.e. the umask needs to be applied)
* | Fix insecure file permissions when using FileFd with OpenMode::AtomicMichael Vogt2014-04-101-2/+6
| | | | | | | | | | | | | | | | | | | | Commit 7335eebea6dd43581d4650a8818b06383ab89901 introduced a bug that caused FileFd to create insecure permissions when FileFd::Atomic is used. This commit fixes the permissions and adds a test. The bug is most likely caused by the confusing "Perm" parameter that is passed to Open() - its not the file permissions but intead the "mode" part of open/creat.
* | Add new Debug::RunScripts optionMichael Vogt2014-04-011-1/+5
|/ | | | | This debug option will display all scripts that are run by apts RunScripts and RunScriptsWithPkgs helpers.
* mark optional (private) symbols as hiddenDavid Kalnischkies2014-03-211-3/+3
| | | | | | | | This methods should not be used by anyone expect the library itself as they are helpers for the specific class and therefore perfect candidates for hidding. Git-Dch: Ignore
* enable fvisibility=hidden for our private libraryDavid Kalnischkies2014-03-211-0/+4
| | | | | | | | | | While it is a huge undertaking to enable it for our public libraries as basically everything we exported so far could be seen as public interface our private library is new and under our full control, so we can do whatever we like with it. The benefits are not that big in return of course, but it reduces the size a bit, so thats great nontheless. Git-Dch: ignore
* continue reading in xz even if it outputs nothingDavid Kalnischkies2014-03-211-0/+13
| | | | | | | | | | | | | | | | | It can happen that content in our buffer is not enough to produce a meaningful output in which case no output is created by liblzma, but still reports that everything is okay and we should go on. The code assumes it has reached the end through if it encounters a null read, so this commit makes it so that it looks like this read was interrupted just like the lowlevel read() on uncompressed files could. It subsequently fixes the issue with that as well as until now our loop would still break even if we wanted it to continue on. (This bug triggers our usual "Hash sum mismatch" error) Reported-By: Stefan Lippers-Hollmann <s.L-H@gmx.de>
* Fix handling of autoclosing for compressed files (Closes: #741685)Julian Andres Klode2014-03-151-1/+1
| | | | | | | AutoClose is both an argument in OpenDescriptor() and an enum. In commit 84baaae93badc2da7c1f4f356456762895cef278 code using the AutoClose parameter was moved to OpenDescriptorInternal(). In that function, AutoClose meant the enum value, so the check was always false.
* fix test/integration/test-apt-helperMichael Vogt2014-03-1430-362/+680
|\
| * refactor FileFd to hide some #ifdefsDavid Kalnischkies2014-03-131-168/+131
| | | | | | | | | | | | They tend to be ugly to look at, so hide them. Git-Dch: Ignore
| * use liblzma-dev to provide xz/lzma supportDavid Kalnischkies2014-03-131-35/+245
| | | | | | | | | | | | | | | | | | | | | | | | We have xz/lzma support for a while, but only via an external binary provided by xz-utils. Now that the Debian archive provides xz by default and dpkg pre-depends on the library provided by liblzma-dev we can switch now to use this library as well to avoid requiring an external binary. For now the binary is in a prio:required package, but this might change in the future. API wise it is quiet similar to bz2 code expect that it doesn't provide file I/O methods, so we piece this together on our own.
| * refactor setup of file opening via zlib/bz2 libDavid Kalnischkies2014-03-131-37/+36
| | | | | | | | Git-Dch: Ignore
| * move fd duplication closer to the gz/bz2 open callsDavid Kalnischkies2014-03-131-21/+20
| | | | | | | | Git-Dch: Ignore
| * support very long mtab entries in mountpoint discoveryDavid Kalnischkies2014-03-131-25/+23
| | | | | | | | | | | | Old code limited lines to 250 characters which is probably enough for everybody, but who knows… It also takes care of device nodes which start with the same prefix.
| * no error for non-existing mountpoints in MountCdromDavid Kalnischkies2014-03-131-8/+20
| | | | | | | | | | | | | | | | | | The mountpoint might be auto-generated by the mount command so pushing an error on the stack will confuse the following code and let it believe an unrecoverable error occured while potentially everything is okay. Same goes for umount as a non-existing mountpoint is by definition not mounted.
| * if mountpoint has a ".disk" directory it is mountedDavid Kalnischkies2014-03-131-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | Checking that parent-directory of mountpoint and mountpoint are on different devices is fine most of the time, but is too restrictive for our testcases and there shouldn't be anything wrong with 'normal' users copying disk-contents around either if they want to. We check for the existance of the ".disk/" directory now as this will not be present if the disk isn't 'mounted'. Disks doesn't need to have such a directory through, so for those we fall back to the old way of detecting mounted or not mounted.
| * follow method attribute suggestions by gccDavid Kalnischkies2014-03-138-30/+34
| | | | | | | | | | Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn}
| * cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-1327-91/+144
| | | | | | | | | | | | | | | | 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)
| * move defines for version to macros.hDavid Kalnischkies2014-03-131-17/+67
| | | | | | | | | | | | also adds namespaced attributes for good usage Git-Dch: Ignore
| * warning: cannot optimize loop, the loop counter may overflow ↵David Kalnischkies2014-03-131-1/+1
| | | | | | | | | | | | | | [-Wunsafe-loop-optimizations] Git-Dch: Ignore Reported-By: gcc -Wunsafe-loop-optimizations
| * warning: useless cast to type A [-Wuseless-cast]David Kalnischkies2014-03-134-5/+5
| | | | | | | | | | Git-Dch: Ignore Reported-By: gcc -Wuseless-cast
| * warning: cast from type A to type B casts away qualifiers [-Wcast-qual]David Kalnischkies2014-03-133-24/+24
| | | | | | | | | | Git-Dch: Ignore Reported-By: gcc -Wcast-qual
| * warning: extra ‘;’ [-Wpedantic]David Kalnischkies2014-03-136-30/+29
| | | | | | | | | | Git-Dch: Ignore Reported-By: gcc -Wpedantic
| * make doxygen more quiet, fix issues and disable latexDavid Kalnischkies2014-03-131-2/+2
| | | | | | | | Git-Dch: Ignore
| * add default and override handling for Cnf::FindVectorDavid Kalnischkies2014-03-133-4/+30
| | | | | | | | | | | | Automatically handle the override of list options via its parent value which can even be a comma-separated list of values. It also adds an easy way of providing a default for the list.
* | add hashsum support in apt-file download and add more testsMichael Vogt2014-03-122-0/+12
|/
* Fix typos in documentation (codespell)Michael Vogt2014-02-2212-20/+20
|
* simplify code some more to make reddit happyDavid Kalnischkies2014-02-141-38/+29
| | | | | | | | | | | | | Commit 6008b79adf1d7ea5607fab87a355d664c8725026 should have been guarded by "Git-Dch: Ignore", but it wasn't and I only noticed it with the Close message via deity thinking "hehe, I wonder if someone is gonna notice". Looks like someone did: hats off to reddit user itisOmegakai! Good to know that what I do isn't only monitored by goverments. :) As there is another instance of basically the same code we just factor out the code a bit and reuse, so its even cleaner and not only simpler. Reported-By: scan-build
* simplify code to make compilers happyDavid Kalnischkies2014-02-101-3/+9
| | | | | | | | Does the same as before, but is a bit simpler on the logic for humans as well as compilers. scan-build complained about it at least with: "Result of operation is garbage or undefined" Reported-By: scan-build
* Merge remote-tracking branch 'donkult/debian/sid' into debian/sidMichael Vogt2014-01-265-15/+18
|\ | | | | | | | | | | | | Conflicts: apt-private/private-list.cc doc/po/de.po test/integration/framework
| * correct some style/performance/warnings from cppcheckDavid Kalnischkies2014-01-164-11/+8
| | | | | | | | | | | | | | | | The most "visible" change is from utime to utimensat/futimens as the first one isn't part of POSIX anymore. Reported-By: cppcheck Git-Dch: Ignore
| * rework some code to fix some scan-build warningsDavid Kalnischkies2014-01-162-4/+10
| | | | | | | | | | | | | | | | No visible functional changes, just code moved around and additional checks to eliminate impossible branches Reported-By: scan-build Git-Dch: Ignore
* | Merge remote-tracking branch 'donkult/feature/clientmergepdiffs' into ↵Michael Vogt2014-01-051-1/+1
|\ \ | |/ |/| | | debian/experimental-no-abi-break
| * allow ':' in GetListOfFilesInDirDavid Kalnischkies2013-12-131-1/+1
| | | | | | | | | | | | | | run-parts doesn't allow this char in valid filenames, but we tend to have files with this character in e.g. /var/lib/apt/lists/ Git-Dch: Ignore