summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
Commit message (Collapse)AuthorAgeFilesLines
* (error) va_list 'args' was opened but not closed by va_end()David Kalnischkies2014-11-081-4/+8
| | | | | | | | | | | | | The manpage of va_start and co additionally says: On some systems, va_end contains a closing '}' matching a '{' in va_start, so that both macros must occur in the same function, and in a way that allows this. So instead of return/breaking instantly, we save the return, make a proper turndown with va_end in all cases and only end after that. Reported-By: cppcheck Git-Dch: Ignore
* Bump ABI to 4.15Michael Vogt2014-11-051-1/+1
|
* rewrite ReadMessages()David Kalnischkies2014-10-261-58/+66
| | | | | | | | | | | | | Central methods of our infrastructure like this one responsible for communication with our methods shouldn't be more complicated then they have to and not claim to have (albeit unlikely) bugs. While I am not sure about having improved the first part, the bug is now gone and a few explicit tests check that it stays that way, so nobody will notice the difference (hopefully) – expect that this should a very tiny bit faster as well as we don't manually proceed through the string. Git-Dch: Ignore
* promote filesize to a hashstringDavid Kalnischkies2014-10-242-7/+29
| | | | | | | | | It is a very simple hashstring, which is why it isn't contributing to the usability of a list of them, but it is also trivial to check and calculate, so it doesn't hurt checking it either as it can combined even with the simplest other hashes greatly complicate attacks on them as you suddenly need a same-size hash collision, which is usually a lot harder to achieve.
* test if TMPDIR is accessible before usingDavid Kalnischkies2014-10-201-2/+4
| | | | | | | | | | Private temporary directories as created by e.g. libpam-tmpdir are nice, but they are also very effective in preventing our priviledge dropping to work as TMPDIR will be set to a directory only root has access to, so working with it as _apt will fail. We circumvent this by extending our check for a usable TMPDIR setting by checking access rights. Closes: 765951
* set PR_SET_NO_NEW_PRIVS even if sandbox is disabledDavid Kalnischkies2014-10-151-6/+6
| | | | | | | Similar to 8f45798d532223adc378a4ad9ecfc64b3be26e4f, there is no harm to set this, even if we don't drop privileges. Git-Dch: Ignore
* Fix backward compatiblity of the new pkgAcquireMethod::DropPrivsOrDie()Michael Vogt2014-10-131-1/+6
| | | | | | | | Do not drop privileges in the methods when using a older version of libapt that does not support the chown magic in partial/ yet. To do this DropPrivileges() now will ignore a empty Apt::Sandbox::User. Cleanup all hardcoded _apt along the way.
* Merge remote-tracking branch 'mvo/feature/acq-trans' into debian/experimentalMichael Vogt2014-10-081-1/+1
|\
| * Merge remote-tracking branch 'upstream/debian/experimental' into ↵Michael Vogt2014-10-075-18/+11
| |\ | | | | | | | | | | | | | | | | | | feature/acq-trans Conflicts: apt-pkg/acquire-item.cc
| * | Adjust DestFile in ReverifyAfterIMS() to not include compr ExtensionMichael Vogt2014-09-291-1/+1
| | |
* | | set PR_SET_NO_NEW_PRIVS also if run as non-rootDavid Kalnischkies2014-10-071-11/+16
| | | | | | | | | | | | | | | | | | | | | Changing user and co works only as root, but can do some things for methods run as normal user as well to protect them from being able to call setuid binaries like sudo to elevate their privileges. Also uses a cheap trick now to build with old unsupporting kernels.
* | | fix foldmarkers in fileutl.ccDavid Kalnischkies2014-10-071-21/+14
| | | | | | | | | | | | Git-Dch: Ignore
* | | Ignore EINVAL from prctl(PR_SET_NO_NEW_PRIVS)Michael Vogt2014-10-071-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Ignore a EINVAL error here as it means that the kernel is too old to understand this option. We should not fail hard in this case but just ignore the error. closes: 764066
* | | Rename DropPrivs() to DropPrivileges()Michael Vogt2014-10-072-2/+2
| |/ |/| | | | | Git-Dch: ignore
* | Bump library version to libapt-pkg4.14Michael Vogt2014-10-031-1/+1
| |
* | support parsing of all hashes for pdiffDavid Kalnischkies2014-09-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | The fileformat of a pdiff index stores currently only SHA1 hashes. With this change, we look for all other hashes we support as well and take what we get, so that we can work after the release of jessie to get right of SHA1 if we want to. Note that the completely patched file is and was checked against the hashes collected from the Release file, so this transition isn't mission critical.
* | mark private methods as hiddenDavid Kalnischkies2014-09-302-4/+6
| | | | | | | | | | | | | | | | | | | | We are the only possible users of private methods, so we are also the only users who can potentially export them via using them in inline methods. The point is: We don't need these symbols exported if we don't do this, so marking them as hidden removes some methods from the API without breaking anything as nobody could have used them. Git-Dch: Ignore
* | fix Configuration::FindVector APIDavid Kalnischkies2014-09-292-11/+2
|/ | | | Git-Dch: Ignore
* allow options between command and -- on commandlineDavid Kalnischkies2014-09-281-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
* fix: Consecutive return, break, continue, goto or throw statements are ↵David Kalnischkies2014-09-271-3/+1
| | | | | | | unnecessary. Git-Dch: Ignore Reported-By: cppcheck
* add and use 'apt-key verify' which prefers gpgv over gpgDavid Kalnischkies2014-09-271-2/+1
| | | | | | | | | | | | | gnupg/gnupg2 can do verify just fine of course, so we don't need to use gpgv here, but it is what we always used in the past, so there might be scripts expecting a certain output and more importantly the output of apt-cdrom contains messages from gpg and even with all the settings we activate to prevent it, it still shows (in some versions) a quiet scary: "gpg: WARNING: Using untrusted key!" message. Keeping the use of gpgv is the simplest way to prevent it. We are increasing also the "Breaks: apt" version from libapt as it requires a newer apt-key than might be installed in partial upgrades.
* add --readonly option for apt-key advDavid Kalnischkies2014-09-271-0/+1
| | | | | | | | Some advanced commands can be executed without the keyring being modified like --verify, so this adds an option to disable the mergeback and uses it for our gpg calling code. Git-Dch: Ignore
* use apt-key adv (+ gnupg) instead of gpgv for verifyDavid Kalnischkies2014-09-271-45/+18
| | | | | | | | apt-key does the keyring merge as we need it, so we just call it instead of reimplementing it to do the merging before gpgv. This means we don't use gpgv anymore (we never depended on it explicitly - bad style), but it also means that the message in apt-cdrom add is a bit less friendly as it says loudly "untrusted key", but for a one-time command its okay.
* fix: Member variable 'X' is not initialized in the constructor.David Kalnischkies2014-09-271-1/+1
| | | | | Reported-By: cppcheck Git-Dch: Ignore
* DropPrivs: Document what it doesJulian Andres Klode2014-09-241-1/+11
| | | | Git-Dch: ignore
* DropPrivs: Use APT::Sandbox::User instead of Apt::User::NobodyJulian Andres Klode2014-09-241-3/+3
| | | | Git-Dch: ignore
* DropPrivs: Hard-fail if the user does not existJulian Andres Klode2014-09-241-1/+1
| | | | Git-Dch: ignore
* DropPrivs: Add some comments for the more obscure setuid/setgid functionsJulian Andres Klode2014-09-241-0/+2
| | | | Git-Dch: ignore
* DropPrivs: Move the re-set uid/gid thing to the end of the functionJulian Andres Klode2014-09-241-7/+7
| | | | Git-Dch: ignore
* DropPrivs: Improve commentsJulian Andres Klode2014-09-241-8/+7
| | | | Git-Dch: ignore
* DropPrivs: Also check for saved set-user-ID and set-group-IDJulian Andres Klode2014-09-241-0/+20
|
* DropPrivs: Do not use an invalid return check for setgroups()Julian Andres Klode2014-09-241-1/+1
| | | | | | setgroups() returns 0 on success Git-Dch: ignore
* Use _apt as our unprivileged user nameJulian Andres Klode2014-09-241-1/+1
| | | | | | | Some people want to standardize on it, and BSDs do it too, so let's do the same. Reported-by: Paul Wise <pabs@debian.org>
* DropPriv: Really call seteuid and not setuid, and add more checksJulian Andres Klode2014-09-241-11/+35
| | | | The only thing we are missing is non-portable saved ids support.
* Drop Privileges to "Debian-apt" in most acquire methodsMichael Vogt2014-09-241-1/+33
| | | | | | | | | Add a new "Debian-apt" user that owns the /var/lib/apt/lists and /var/cache/apt/archive directories. The methods http, https, ftp, gpgv, gzip switch to this user when they start. Thanks to Julian and "ioerror" and tors "switch_id()" code.
* Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-09-233-6/+24
|\ | | | | | | | | | | | | | | | | Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h apt-pkg/cachefilter.h configure.ac debian/changelog
| * 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
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-09-053-3/+104
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/acquire-item.cc configure.ac debian/changelog doc/apt-verbatim.ent doc/po/apt-doc.pot doc/po/de.po doc/po/es.po doc/po/fr.po doc/po/it.po doc/po/ja.po doc/po/pt.po po/ar.po po/ast.po po/bg.po po/bs.po po/ca.po po/cs.po po/cy.po po/da.po po/de.po po/dz.po po/el.po po/es.po po/eu.po po/fi.po po/fr.po po/gl.po po/hu.po po/it.po po/ja.po po/km.po po/ko.po po/ku.po po/lt.po po/mr.po po/nb.po po/ne.po po/nl.po po/nn.po po/pl.po po/pt.po po/pt_BR.po po/ro.po po/ru.po po/sk.po po/sl.po po/sv.po po/th.po po/tl.po po/tr.po po/uk.po po/vi.po po/zh_CN.po po/zh_TW.po test/integration/test-ubuntu-bug-346386-apt-get-update-paywall
| * 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.
* | Only allow "apt-get build-dep path" when path starts with ./ or /Michael Vogt2014-07-082-0/+8
| | | | | | | | | | | | This avoid the subtle problem that someone might have a directory with the same package name as the build-depends he/she is trying to fetch. Also print a note that the specific file/dir is used.
* | Add new Base256ToNum long long overload functionGuillem Jover2014-07-082-1/+19
| |
* | Merge remote-tracking branch 'donkult/debian/sid' into debian/experimentalMichael Vogt2014-06-181-7/+14
|\| | | | | | | | | Conflicts: apt-private/private-install.cc
| * 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.
* | Merge remote-tracking branch 'mvo/feature/drop-rights' into debian/experimentalMichael Vogt2014-06-182-0/+22
|\ \ | | | | | | | | | | | | | | | Conflicts: apt-pkg/contrib/fileutl.cc apt-pkg/contrib/fileutl.h
| * | DropPrivs in the solvers (just to be on the safe side)Michael Vogt2014-06-112-0/+20
| |/
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-06-181-2/+4
|\| | | | | | | | | Conflicts: debian/changelog
| * 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