summaryrefslogtreecommitdiff
path: root/apt-pkg
Commit message (Collapse)AuthorAgeFilesLines
* 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
* don't strip :any from dependencies in single-archDavid Kalnischkies2013-09-261-4/+2
| | | | | | | | | | | The parser goes a bit to far by stripping :any from dependencies in a single architecture environment. the flag "Multi-Arch: allowed" doesn't care any architecture restrictions in that case (as in single arch everything is native), but it still limits the possible versions statisfying the dependency so stripping :any over-simplifies in upgrade situations from "Multi-Arch: none" to "Multi-Arch: allowed". Closes: 723586
* do not trust FileFd::Eof() in pkgTagFile::Fill()David Kalnischkies2013-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | The Eof check was added (by me of course) in 0aae6d14390193e25ab6d0fd49295bd7b131954f as part of a fix up ~a month ago (at DebConf). The idea was not that bad, but doesn't make that much sense either as this bit is set by the FileFd based on Actual as well, so this is basically doing the same check again – with the difference that the HitEof bit can still linger from a previous Read we did at the end of the file, but have seek'd away from it now. Combined with the length of entries, entry order and other not that easily controllable conditions you can be 'lucky' enough to hit this problem in a way which even visible (truncating of other fields might not be visible easily, like 'Tags' and others). Closes: 723705 Thanks: Cyril Brulebois
* fix typo (mkostemp->mkstemp)Michael Vogt2013-08-311-1/+1
|
* Merge remote-tracking branch 'mvo/feature/install-progress' into debian/sidMichael Vogt2013-08-282-1/+18
|\
| * Add DPkgPM::Progress for terminal install progressMichael Vogt2013-07-112-1/+18
| |
* | use mkstemp instead of mkostemp in FileFd::Open()David Kalnischkies2013-08-271-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | FileFd currently supports no fileflags which would make sense to provide via mkostemp, so we can just use mkstemp here which is a standard function compared to glib extension mkostemp. O_CREAT (Create) and O_TRUNC (Empty) are implied by O_EXCL, which is the mode mkstemp uses by default. The file description is opened ReadWrite, but that used to be the default for FileFd in the old times and not a problem as the difference is needed by FileFd to decide in which way the compressor pipeline needs to be created (if any). Git-Dch: Ignore
* | replace usage of potential dangerous mktemp with mkstempAngel Guzman Maeso2013-08-271-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | Avoid the warning "the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'". It is not strictly necessary to change the usage from a security point of view here, but mktemp is also removed from the standard since POSIX.1-2008. The mkostemp call returns a file descriptor the logic for TemporaryFileName has been changed accordingly to get the same results. The file permissions are corrected by using fchmod() as the default for FileFd is 666 while mkstemp creates files with 600 by default.
* | do chdir("/") after chroot()Michael Vogt2013-08-222-2/+2
| |
* | apt-pkg:contrib Avoid compiler warning about sign-compareÁngel Guzmán Maeso2013-08-221-1/+2
| | | | | | | | | | | | | | The fix avoid the warning "comparison between signed and unsigned integer expressions [-Wsign-compare]"· The index for the loop needs to be unsigned for compare with globbuf.gl_pathc structure member
* | Merge remote-tracking branch 'mvo/bugfix/coverity' into debian/sidMichael Vogt2013-08-225-1/+16
|\ \ | | | | | | | | | | | | Conflicts: apt-pkg/tagfile.h
| * | some more coverity fixesMichael Vogt2013-08-123-0/+5
| | |
| * | memset() pkgTagSections data to make coverity happyMichael Vogt2013-08-062-1/+11
| | |
* | | Merge remote-tracking branch 'mvo/feature/apt-binary2' into debian/sidMichael Vogt2013-08-1710-6/+291
|\ \ \ | | | | | | | | | | | | | | | | Conflicts: cmdline/apt-get.cc
| * | | add PACKAGE_MATCHER_ABI_COMPAT mode for now so that this branch can be ↵Michael Vogt2013-08-151-1/+62
| | | | | | | | | | | | | | | | merged without breaking ABI
| * | | make destructors virtualMichael Vogt2013-08-151-3/+3
| | | |
| * | | squash merge of the feature/apt-binary branch without the changes from ↵Michael Vogt2013-08-1210-12/+236
| | | | | | | | | | | | | | | | experimental
* | | | allow Pre-Install-Pkgs hooks to get info over an FD != stdinDavid Kalnischkies2013-08-161-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds ::InfoFD option alongside the ::Version one to request sending the information to the specified FD, by default it is STDIN as it was the case before. The environment variable APT_HOOK_INFO_FD contains the FD the data is on as a confirmation that the APT version used understood the request. Allowing the hook to choose the FD is needed/helpful e.g. for shellscripts which have a hard time accessing FDs above 9 (as >= 10 are usually used internally by them) Closes: #671728
* | | | use malloc instead of new[] in pkgTagFileDavid Kalnischkies2013-08-151-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't need initialized memory for pkgTagFile, but more to the point we can use realloc this way which hides the bloody details of increasing the size of the buffer used. Git-Dch: Ignore
* | | | ensure that pkgTagFile isn't writing past Buffer lengthDavid Kalnischkies2013-08-152-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 91c4cc14d3654636edf997d23852f05ad3de4853 I removed the +256 from the pkgTagFile call parsing Release files as I couldn't find a mentioning of a reason for why and it was marked as XXX which suggested that at least someone else was suspicious. It turns out that it is indeed "documented", it just didn't found it at first but the changelog of apt 0.6.6 (29. Dec 2003) mentions: * Restore the ugly hack I removed from indexRecords::Load which set the pkgTagFile buffer size to (file size)+256. This is concealing a bug, but I can't fix it right now. This should fix the segfaults that folks are seeing with 0.6.[45]. The bug it is "hiding" is that if pkgTagFile works with a file which doesn't end in a double newline it will be adding it without checking if the Buffer is big enough to store them. Its also not a good idea to let the End pointer be past the end of our space, even if we don't access the data. Closes: 719629
* | | | init the pkgTagFile with the size of the Release fileDavid Kalnischkies2013-08-152-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Release files are basically one big Section, so we might safe some Resize circles by starting with the filesize. Git-Dch: Ignore
* | | | * lp:~mvo/apt/add-glob-function:Michael Vogt2013-08-152-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - add Glob() to fileutl.{cc,h} Conflicts: apt-pkg/contrib/fileutl.h debian/changelog
* | | | * lp:~mvo/apt/config-clear:Michael Vogt2013-08-152-0/+13
|/ / / | | | | | | | | | | | | | | | | | | - support Configuration.Clear() for a clear of the entire configuration Conflicts: debian/changelog
* | | use our _error stack to generate openpty errorsDavid Kalnischkies2013-08-121-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | While we don't want these error messages on our usual stack, we can use our usual infrastructure to generate an error message with all the usual bells like errno and strerror attached. Git-Dch: Ignore
* | | do not try to chown if not run as rootDavid Kalnischkies2013-08-121-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If this code is run as non-root we are in a special situation (e.g. in our testcases) where it is obvious that we can't enforce user/group on any file, so skip this code altogether instead of bugging users with an error message – which we also switch to a warning as a failure to open the file is "just" a warning, so the 'wrong' owner shouldn't be that much of an issue. The file is still handled with chmod, so all the security we can enforce is still enforced of course, which also gets a warning if it fails. Git-Dch: Ignore
* | | fix: --print-uris removes authenticationDavid Kalnischkies2013-08-122-4/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | fix -Wall errorsMichael Vogt2013-08-083-4/+6
| | |
* | | use pkgTagFile to parse "header" of Release filesDavid Kalnischkies2013-08-081-85/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The handwritten parsing here was mostly done as we couldn't trust the Release file we got, but nowadays we are sure that the Release file is valid and contains just a single section we want it to include. Beside reducing code it also fixes a bug: Fieldnames in deb822 formatted files are case-insensitive and pkgTagFile does it correctly, but this selfbuilt stuff here didn't.
* | | stop skipping "-----" sections in Release filesDavid Kalnischkies2013-08-081-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The file we read will always be a Release file as the clearsign is stripped earlier in this method, so this check is just wasting CPU Its also removing the risk that this could ever be part of a valid section, even if I can't imagine how that should be valid. Git-Dch: Ignore
* | | specific pins below 1000 cause downgradesDavid Kalnischkies2013-08-081-7/+18
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We start your quest by using the version of a package applying to a specific pin, but that version could very well be below the current version, which causes APT to suggest a downgrade even if it is advertised that it never does this below 1000. Its of course questionable what use a specific pin on a package has which has a newer version already installed, but reacting with the suggestion of a downgrade is really not appropriated (even if its kinda likely that this is actually the intend the user has – it could just as well be an outdated pin) and as pinning is complicated enough we should atleast do what is described in the manpage. So we look out for the specific pin and if we haven't seen it at the moment we see the installed version, we ignore the specific pin. Closes: 543966
* | Merge remote-tracking branch 'upstream/debian/sid' into bugfix/coverityMichael Vogt2013-08-055-15/+41
|\ \
| * | prefer native arch over higher priority for providersColin Watson2013-08-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rational from the buglog: > The problem here is that the Priority field in one of the Packages files > is incorrect due to a mishap with reprepro configuration, […] the > amd64 version is Priority: standard but the arm64 version is Priority: > optional (and has a stray "optional: interpreters" field). > […] > However, Priority is a rather weak property of a package because it's > typically applied via overrides, and it's easy for maintainers of > third-party repositories to misconfigure them so that overrides aren't > applied correctly. It shouldn't be ranked ahead of choosing packages > from the native architecture. In this case, I have no user-mode > emulation for arm64 set up, so choosing m4:arm64 simply won't work. This effectly makes the priority the least interesting data point in chosing a provider, which is in line with the other checks we have already order above priority in the past and also has a certain appeal by the soft irony it provides. Closes: #718482
| * | Merge remote-tracking branch 'mvo/bugfix/coverity' into debian/sidMichael Vogt2013-07-289-18/+22
| |\ \
| * | | ensure that FileFd::Size returns 0 in error casesDavid Kalnischkies2013-07-261-5/+18
| | | |
| * | | proper cleanup varargs in _error (uncovered by Coverity)David Kalnischkies2013-07-261-4/+6
| | | | | | | | | | | | | | | | Git-Dch: Ignore
| * | | 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
| * | | fix if-clause to generate hook-info for 'rc' packagesDavid Kalnischkies2013-07-161-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | The code incorrectly skips printing of current version information, if the package has no current version (for APT, but for dpkg as it is the case for packages which are removed but not purged) by using an unintended "else if" rather than an "if". Closes: 717006
* | | fix some unitialized data membersMichael Vogt2013-08-053-3/+5
| |/ |/|
* | fix another missing va_end()Michael Vogt2013-07-261-3/+3
| |
* | fix some coverity chroot() releated warningsMichael Vogt2013-07-262-2/+3
| |
* | add missing "free(buffer) for allocated bufferMichael Vogt2013-07-251-1/+0
| |
* | delete targets dataMichael Vogt2013-07-251-0/+1
| |
* | fix resource leak when verification failsMichael Vogt2013-07-251-0/+1
| |
* | apt-pkg/indexcopy.cc: check for pending errors before calling fdopen()Michael Vogt2013-07-251-1/+1
| |
* | call fdopen() after FileFd was checkedMichael Vogt2013-07-251-1/+1
| |
* | fix resource leak (thanks coverity)Michael Vogt2013-07-251-4/+8
| |
* | rework the code in cdromutl.cc to make coverity (more) happyMichael Vogt2013-07-251-1/+2
| |
* | fix off-by-one error and do not use magic constant of 100 when checking ↵Michael Vogt2013-07-251-1/+1
| | | | | | | | StackPost
* | always "delete d" in FileFd::~FileFd to coverity happyMichael Vogt2013-07-251-4/+2
| |
* | Merge remote-tracking branch 'upstream/debian/sid'Michael Vogt2013-07-2423-351/+553
|\|