summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | add basic tests for GetTempDir()Michael Vogt2013-12-231-1/+1
| |
* | factor GetTempDir outMichael Vogt2013-12-223-13/+21
| |
* | apt-pkg/contrib/gpgv.cc: use /tmp as fallback dirThomas Bechtold2013-12-221-1/+6
|/ | | | if the directory given by $TMPDIR is not available, use /tmp as fallback.
* truncating /dev/null to zero is always successfulDavid Kalnischkies2013-11-301-0/+3
| | | | | | | | | | | Calling truncate on /dev/null can happen by the download methods if they are instructed to download a file to /dev/null (as testcases are only interested in the status code, but do not support HEAD requests yet) So just ignore truncate calls on the /dev/null file as it is always empty anyway, so truncating to zero isn't a problem. Git-Dch: Ignore
* Merge remote-tracking branch 'mvo/debian/sid' into debian/sidMichael Vogt2013-11-294-5/+38
|\ | | | | | | | | Conflicts: apt-private/private-cmndline.cc
| * add "APT::String::Endswith" and automatic adding of ".list" in apt edit-sourceMichael Vogt2013-11-292-0/+9
| |
| * add check when sources.list changedMichael Vogt2013-11-262-5/+29
| |
* | fix regression that APT::Keep-Fds is not honored (closes: #730490)Michael Vogt2013-11-282-8/+19
|/
* small documentation updatesMichael Vogt2013-11-011-1/+2
|
* add new pid_t ExecFork(std::set<int> KeepFDs) to get rid of the super ugly ↵Michael Vogt2013-10-312-14/+21
| | | | APT::Keep-Fds hack and also add a new PackageManagerProgressFd::StartDpkg() progress state
* re-add missing APT::String::StripMichael Vogt2013-10-182-1/+23
|
* fix libapt-inst for >2G debs (closes: #725483)Michael Vogt2013-10-071-8/+8
|
* change maxsplit default from "0" to maxintMichael Vogt2013-10-012-3/+3
|
* improve documentation for StringSplit()Michael Vogt2013-10-012-6/+19
|
* doc updateMichael Vogt2013-09-072-8/+17
|
* add maxsplit parameter to StringSplitMichael Vogt2013-09-072-6/+14
|
* implement StringSplit() as we need this to fix the dpkg status-fd output parsingMichael Vogt2013-09-072-0/+24
|