David Kalnischkies [Mon, 13 Oct 2014 05:26:27 +0000 (07:26 +0200)]
display a warning for unsigned repos
The same message is used for InRelease if fails in gpgv, but the
Release/Release.gpg duo needs to handle the failing download case as
well (InRelease just defers to the duo if download fails) and print a
message accompaning the insecure error to provide a hint on what is
going on.
David Kalnischkies [Mon, 13 Oct 2014 05:22:53 +0000 (07:22 +0200)]
make --allow-insecure-repositories message an error
Not using this option, but using unsigned (and co) repositories will
cause these repositories to be ignored and data acquiring from them
fails, so this is very well in the realms of an error and helps in
making 'apt-get update' fail with a non-zero error code as well.
David Kalnischkies [Fri, 10 Oct 2014 20:03:08 +0000 (22:03 +0200)]
remove useless pdiff filename output
Looks like a leftover from debugging. Absolutely no need for it and
destroys progess reporting completely.
Closes: 764737
Michael Vogt [Wed, 8 Oct 2014 18:13:56 +0000 (20:13 +0200)]
Only rename StatError files in AbortTransaction()
This fixes a race that we see in travis when two copy operations
finish at about the same time but the bad one first. This lead to
a rename of the good one and triggers a error when apt tries to
verify the good version but can no longer find it.
Michael Vogt [Wed, 8 Oct 2014 07:48:54 +0000 (09:48 +0200)]
releasing package apt version 1.1~exp4
Michael Vogt [Wed, 8 Oct 2014 07:46:56 +0000 (09:46 +0200)]
prepare 1.1~exp4
Michael Vogt [Wed, 8 Oct 2014 07:45:11 +0000 (09:45 +0200)]
Fix ServerMethod::FindMaximumObjectSizeInQueue()
Git-Dch: ignore
Michael Vogt [Wed, 8 Oct 2014 07:16:59 +0000 (09:16 +0200)]
pkgAcqArchive::QueueNext(): change owner/permission of DestFile
The code was using FinalFile before but we only test the existance
of DestFile so we use that instead.
Michael Vogt [Wed, 8 Oct 2014 06:37:30 +0000 (08:37 +0200)]
Merge branch 'debian/sid' into debian/experimental
Conflicts:
debian/changelog
Michael Vogt [Wed, 8 Oct 2014 06:37:01 +0000 (08:37 +0200)]
Merge remote-tracking branch 'mvo/feature/expected-size' into debian/experimental
Michael Vogt [Wed, 8 Oct 2014 06:36:53 +0000 (08:36 +0200)]
Merge remote-tracking branch 'mvo/feature/acq-trans' into debian/experimental
Michael Vogt [Wed, 8 Oct 2014 06:32:42 +0000 (08:32 +0200)]
Fix http pipeline messup detection
The Maximum-Size protection breaks the http pipeline reorder code
because it relies on that the object got fetched entirely so that
it can compare the hash of the downloaded data. So instead of
stopping when the Maximum-Size of the expected item is reached we
only stop when the maximum size of the biggest item in the queue
is reached. This way the pipeline reoder code keeps working.
Michael Vogt [Wed, 8 Oct 2014 06:05:18 +0000 (08:05 +0200)]
Merge remote-tracking branch 'donkult/feature/acq-trans' into feature/expected-size
David Kalnischkies [Tue, 7 Oct 2014 22:37:32 +0000 (00:37 +0200)]
fix http-pipeline-messup testcase
The test generates failures if the created deb files have the same size,
so we try a little harder to avoid having the same size for them.
Git-Dch: Ignore
David Kalnischkies [Tue, 7 Oct 2014 21:52:12 +0000 (23:52 +0200)]
do not show IP in output of testcases
On travis-ci connect.cc detects a rotation, triggering it store the IP
which is later appended to the error message, which is all nice and
great if we deal with a real server, but in the testcases it just
triggers failures as strings do not match.
Git-Dch: Ignore
Michael Vogt [Tue, 7 Oct 2014 20:36:09 +0000 (22:36 +0200)]
Send "Fail-Reason: MaximumSizeExceeded" from the method
Communicate the fail reason from the methods to the parent
and Rename() failed files.
David Kalnischkies [Tue, 7 Oct 2014 19:17:04 +0000 (21:17 +0200)]
set PR_SET_NO_NEW_PRIVS also if run as non-root
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.
David Kalnischkies [Tue, 7 Oct 2014 19:03:48 +0000 (21:03 +0200)]
fix foldmarkers in fileutl.cc
Git-Dch: Ignore
David Kalnischkies [Tue, 7 Oct 2014 18:51:07 +0000 (20:51 +0200)]
don't show ErrorText for Ign by default
Some distributions (or repositories) do not have as much
"Ign-discipline" as I would like to, so that could be pretty distracting
for our users if enabled by default. It is handy for testcases though.
Git-Dch: Ignore
Michael Vogt [Tue, 7 Oct 2014 18:40:37 +0000 (20:40 +0200)]
Add new Acquire::MaxReleaseFileSize=10*1000*1000 option
This option controls the maximum size of Release/Release.gpg/InRelease
files. The rational is that we do not know the size of these files in
advance and we want to protect against a denial of service attack
where someone sends us endless amounts of data until the disk is full
(we do know the size all other files (Packages/Sources/debs)).
Michael Vogt [Tue, 7 Oct 2014 18:06:44 +0000 (20:06 +0200)]
Merge branch 'feature/acq-trans' into feature/expected-size
Michael Vogt [Tue, 7 Oct 2014 15:47:30 +0000 (17:47 +0200)]
make expected-size a maximum-size check as this is what we want at this point
Michael Vogt [Tue, 7 Oct 2014 14:38:03 +0000 (16:38 +0200)]
Merge remote-tracking branch 'upstream/debian/experimental' into feature/acq-trans
Conflicts:
apt-pkg/acquire-item.cc
Michael Vogt [Tue, 7 Oct 2014 12:01:35 +0000 (14:01 +0200)]
UpperCase some functions for consistency
changeOwnerAndPermissionOfFile->ChangeOwnerAndPermissionOfFile
preparePartialFile->GetPartialFileName
preparePartialFileFromURI->GetPartialFileNameFromURI
Git-Dch: ignore
Michael Vogt [Tue, 7 Oct 2014 11:34:28 +0000 (13:34 +0200)]
Ignore EINVAL from prctl(PR_SET_NO_NEW_PRIVS)
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
Michael Vogt [Tue, 7 Oct 2014 11:30:27 +0000 (13:30 +0200)]
Rename DropPrivs() to DropPrivileges()
Git-Dch: ignore
Michael Vogt [Tue, 7 Oct 2014 11:17:16 +0000 (13:17 +0200)]
fix test-cve-2013-1051-InRelease-parsing (fails now in the method)
Michael Vogt [Tue, 7 Oct 2014 06:43:46 +0000 (08:43 +0200)]
add ftp expected size check
Michael Vogt [Tue, 7 Oct 2014 06:16:51 +0000 (08:16 +0200)]
methods/https.cc: use File->Tell() here too
David Kalnischkies [Mon, 6 Oct 2014 23:46:30 +0000 (01:46 +0200)]
display errortext for all Err as well as Ign logs
consistently using Item::Failed in all specializec classes helps setting
up some information bits otherwise unset, so some errors had an empty
reason as an error. Ign is upgraded to display the error message we
ignored to further help in understanding what happens.
David Kalnischkies [Mon, 6 Oct 2014 12:29:53 +0000 (14:29 +0200)]
use _apt:root only for partial directories
Using a different user for calling methods is intended to protect us
from methods running amok (via remotely exploited bugs) by limiting what
can be done by them. By using root:root for the final directories and
just have the files in partial writeable by the methods we enhance this
in sofar as a method can't modify already verified data in its parent
directory anymore.
As a side effect, this also clears most of the problems you could have
if the final directories are shared without user-sharing or if these
directories disappear as they are now again root owned and only the
partial directories contain _apt owned files (usually none if apt isn't
running) and the directory itself is autocreated with the right
permissions.
David Kalnischkies [Mon, 6 Oct 2014 09:15:03 +0000 (11:15 +0200)]
ensure partial dirs are 0700 and owned by _apt:root
Reworks the API involved in creating and setting up the fetcher to be a
bit more pleasent to look at and work with as e.g. an empty string for
no lock isn't very nice. With the lock we can also stop creating all our
partial directories "just in case". This way we can also be a bit more
aggressive with the partial directory itself as with a lock, we know we
will gone need it.
David Kalnischkies [Mon, 6 Oct 2014 09:34:07 +0000 (11:34 +0200)]
fixup foldmarkers in acquire-item.cc
Git-Dch: Ignore
Michael Vogt [Mon, 6 Oct 2014 15:42:39 +0000 (17:42 +0200)]
make http size check work
Miroslav Kure [Mon, 6 Oct 2014 14:31:54 +0000 (16:31 +0200)]
[l10n] Updated Czech translation of apt
Closes: #764055
Michael Vogt [Mon, 6 Oct 2014 14:28:56 +0000 (16:28 +0200)]
fix warnings
Michael Vogt [Mon, 6 Oct 2014 12:54:53 +0000 (14:54 +0200)]
rename StopAuthentication -> CheckStopAuthentication and make it protected
Michael Vogt [Mon, 6 Oct 2014 12:43:05 +0000 (14:43 +0200)]
fix test
Michael Vogt [Mon, 6 Oct 2014 12:39:16 +0000 (14:39 +0200)]
rename AuthDone() -> CheckAuthDone()
Michael Vogt [Mon, 6 Oct 2014 12:34:38 +0000 (14:34 +0200)]
cleanup pkgAcq*::Failed()
Michael Vogt [Mon, 6 Oct 2014 11:18:45 +0000 (13:18 +0200)]
add missing TransactionStageCopy() in pkgAcqDiffIndex::Done()
Michael Vogt [Mon, 6 Oct 2014 09:45:42 +0000 (11:45 +0200)]
Rework pkgAcqMeta{Index,Sig,ClearSig}::Done() for readability
Move common code out but do not use subclassing for ::Done
to make it easier to understand what each class is doing when
its done
Michael Vogt [Mon, 6 Oct 2014 07:43:48 +0000 (09:43 +0200)]
fix incorrect docstrings for AcqMetaBase::TransactionStageRemoval/AcqMetaBase::TransactionStageCopy
Michael Vogt [Mon, 6 Oct 2014 07:42:12 +0000 (09:42 +0200)]
add new "SetActiveSubprocess()
Michael Vogt [Mon, 6 Oct 2014 07:34:06 +0000 (09:34 +0200)]
update test
Guillem Jover [Thu, 2 Oct 2014 15:48:13 +0000 (17:48 +0200)]
apt-get: Create the temporary downloaded changelog inside tmpdir
The code is creating a secure temporary directory, but then creates
the changelog alongside the tmpdir in the same base directory. This
defeats the secure tmpdir creation, making the filename predictable.
Inject a '/' between the tmpdir and the changelog filename.
Michael Vogt [Thu, 2 Oct 2014 21:17:47 +0000 (23:17 +0200)]
Bump library version to libapt-pkg4.14
Michael Vogt [Thu, 2 Oct 2014 22:39:20 +0000 (00:39 +0200)]
really do not download Release if InRelease does not verify
David Kalnischkies [Thu, 2 Oct 2014 22:20:57 +0000 (00:20 +0200)]
implement MarkAndSweep in cc instead of header
Having it in the header exposes some implementation details, namely
private methods and will cause problems for us if we ever want to change
the actions.
Git-Dch: Ignore
David Kalnischkies [Thu, 2 Oct 2014 22:18:53 +0000 (00:18 +0200)]
rename StringType VERSION to VERSIONNUMBER
aptitude has a define for VERSION, so to not generate a FTBFS we just
rename our enum element to a slightly less generic name.
Git-Dch: Ignore
Michael Vogt [Thu, 2 Oct 2014 20:07:25 +0000 (22:07 +0200)]
releasing package apt version 1.0.9.2
Guillem Jover [Thu, 2 Oct 2014 15:48:13 +0000 (17:48 +0200)]
apt-get: Create the temporary downloaded changelog inside tmpdir
The code is creating a secure temporary directory, but then creates
the changelog alongside the tmpdir in the same base directory. This
defeats the secure tmpdir creation, making the filename predictable.
Inject a '/' between the tmpdir and the changelog filename.
Michael Vogt [Thu, 2 Oct 2014 16:28:55 +0000 (18:28 +0200)]
cleanup around pkgAcqMetaSig and improved tests
Michael Vogt [Thu, 2 Oct 2014 15:28:20 +0000 (17:28 +0200)]
add a bunch of docstrings etc
David Kalnischkies [Wed, 1 Oct 2014 21:58:05 +0000 (23:58 +0200)]
ensure world-readability for trusted.gpg in postinst
apt-key creates trusted.gpg if it needs it with 644 nowadays, but before
it ensured this, it was gpg creating it, which gives it by default 600.
Not a problem as long as our gpgv is run as root, but now that we drop
privileges we have to ensure that we can also read trusted.gpg files
created by earlier apt-key versions.
Closes: 647001
Michael Vogt [Wed, 1 Oct 2014 22:47:33 +0000 (00:47 +0200)]
fix crash
Michael Vogt [Wed, 1 Oct 2014 22:38:35 +0000 (00:38 +0200)]
donkults fixes
Michael Vogt [Wed, 1 Oct 2014 22:05:44 +0000 (00:05 +0200)]
Cleanup pkgAcqIndex
Michael Vogt [Wed, 1 Oct 2014 20:41:52 +0000 (22:41 +0200)]
refactor and add pkgAcqIndex::ValidateFile()
Michael Vogt [Wed, 1 Oct 2014 16:01:14 +0000 (18:01 +0200)]
fix leftover files from Acquire::GzipIndex
Michael Vogt [Wed, 1 Oct 2014 15:13:33 +0000 (17:13 +0200)]
hack around test-apt-update-unauth failure
Michael Vogt [Wed, 1 Oct 2014 06:22:26 +0000 (08:22 +0200)]
debian/rules: add hardening=+all
Because of dpkg-buildflags we already get most of the hardening
features, +all adds -fPIE and ld -z now
Thanks: Simon Ruderich, Markus Waldeck
Michael Vogt [Wed, 1 Oct 2014 12:22:46 +0000 (14:22 +0200)]
fix test-apt-update-nofallback test
Michael Vogt [Wed, 1 Oct 2014 06:22:26 +0000 (08:22 +0200)]
debian/rules: add hardening=+all
Because of dpkg-buildflags we already get most of the hardening
features, +all adds -fPIE and ld -z now
Thanks: Simon Ruderich, Markus Waldeck
Michael Vogt [Wed, 1 Oct 2014 12:06:01 +0000 (14:06 +0200)]
update test/integration/test-releasefile-verification
Michael Vogt [Wed, 1 Oct 2014 10:21:55 +0000 (12:21 +0200)]
Use Acquire::Allow{InsecureRepositories,DowngradeToInsecureRepositories}
The configuration key Acquire::AllowInsecureRepositories controls if
apt allows loading of unsigned repositories at all.
The configuration Acquire::AllowDowngradeToInsecureRepositories
controls if a signed repository can ever become unsigned. This
should really never be needed but we provide it to avoid having
to mess around in /var/lib/apt/lists if there is a use-case for
this (which I can't think of right now).
Michael Vogt [Wed, 1 Oct 2014 09:20:08 +0000 (11:20 +0200)]
add verify for the .diff/Index download and add FIXME for pkgAcqIndexDiffs/pkgAcqMergeDiffs
Mert Dirik [Wed, 1 Oct 2014 06:18:32 +0000 (08:18 +0200)]
Turkish program translation update
Closes: 763379
Michael Vogt [Tue, 30 Sep 2014 13:21:52 +0000 (15:21 +0200)]
Merge remote-tracking branch 'donkult/debian/experimental' into debian/experimental
Michael Vogt [Tue, 30 Sep 2014 13:21:44 +0000 (15:21 +0200)]
adjust version numbers for the planed upload
David Kalnischkies [Tue, 30 Sep 2014 01:00:42 +0000 (03:00 +0200)]
fix another instance of warning: extra ‘;’ [-Wpedantic]
Git-Dch: Ignore
David Kalnischkies [Mon, 29 Sep 2014 20:45:52 +0000 (22:45 +0200)]
support parsing of all hashes for pdiff
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.
David Kalnischkies [Mon, 29 Sep 2014 13:41:12 +0000 (15:41 +0200)]
mark private methods as hidden
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
Michael Vogt [Mon, 29 Sep 2014 15:38:23 +0000 (17:38 +0200)]
cleanup
David Kalnischkies [Mon, 29 Sep 2014 12:00:33 +0000 (14:00 +0200)]
fix Configuration::FindVector API
Git-Dch: Ignore
David Kalnischkies [Mon, 29 Sep 2014 11:25:07 +0000 (13:25 +0200)]
update symbols file
Michael Vogt [Mon, 29 Sep 2014 09:47:20 +0000 (11:47 +0200)]
Merge remote-tracking branch 'debian/debian/experimental' into feature/acq-trans
Michael Vogt [Mon, 29 Sep 2014 09:47:03 +0000 (11:47 +0200)]
more test fixes
Michael Vogt [Mon, 29 Sep 2014 09:43:37 +0000 (11:43 +0200)]
Test if TMPDIR is a directory in apt-key and if not unset it
This prevents a failure in mktemp -d - it will blindly trust
TMPDIR and not use something else if the dir is not there.
Michael Vogt [Mon, 29 Sep 2014 09:26:30 +0000 (11:26 +0200)]
fix DestFile ext
Michael Vogt [Mon, 29 Sep 2014 09:03:02 +0000 (11:03 +0200)]
test fixes
Michael Vogt [Mon, 29 Sep 2014 08:43:00 +0000 (10:43 +0200)]
refactor
Michael Vogt [Mon, 29 Sep 2014 08:41:31 +0000 (10:41 +0200)]
Adjust DestFile in ReverifyAfterIMS() to not include compr Extension
Michael Vogt [Mon, 29 Sep 2014 07:58:38 +0000 (09:58 +0200)]
Merge remote-tracking branch 'upstream/debian/experimental' into feature/acq-trans
Conflicts:
apt-pkg/acquire-item.cc
apt-pkg/acquire-item.h
methods/gpgv.cc
Michael Vogt [Mon, 29 Sep 2014 06:37:48 +0000 (08:37 +0200)]
Add missing "adduser" dependency (for the new _apt user)
Closes: #763004
Thanks: Russ Allbery
Michael Vogt [Mon, 29 Sep 2014 06:33:33 +0000 (08:33 +0200)]
Merge branch 'debian/sid' into debian/experimental
Conflicts:
apt-pkg/acquire-item.cc
Trần Ngọc Quân [Sun, 28 Sep 2014 08:33:19 +0000 (15:33 +0700)]
Set STRIP_FROM_PATH for doxygen
Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
David Kalnischkies [Sat, 27 Sep 2014 23:57:49 +0000 (01:57 +0200)]
replace c-string Mode with c++-string ActiveSubprocess
A long-lasting FIXME in the acquire code points out the problem that we
e.g. for decompressors assign c-string representations of c++-strings to
the Mode variable, which e.g. cppcheck points out as very bad.
In practice, nothing major happens as the c++-strings do not run out of
scope until Mode would do, but that is bad style and fragile, so the
obvious proper fix is to use a c++ string for storage to begin with.
The slight complications stems from the fact that progress reporting
code in frontends potentially uses Mode and compares it with NULL, which
can't be done with std::string, so instead of just changing the type we
introduce a new variable and deprecate the old one.
Git-Dch: Ignore
David Kalnischkies [Sat, 27 Sep 2014 23:25:21 +0000 (01:25 +0200)]
allow options between command and -- on commandline
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
David Kalnischkies [Sat, 27 Sep 2014 18:09:44 +0000 (20:09 +0200)]
cleanup partial directory of lists in apt-get clean
Not really the intended usecase for apt-get clean, but users expect it
to help them in recovery and it can't really hurt as this directory
should be empty if everything was fine and proper anyway.
Closes: #762889
David Kalnischkies [Sat, 27 Sep 2014 17:45:30 +0000 (19:45 +0200)]
allow fetcher setup without directory creation
apt-get download and changelog as well as apt-helper reuse the acquire
system for their own proposes without requiring the directories the
fetcher wants to create, which is a problem if you run them as non-root
and the directories do not exist as it greets you with:
E: Archives directory /var/cache/apt/archives/partial is missing. -
Acquire (13: Permission denied)
Closes: 762898
Kenshi Muto [Sat, 27 Sep 2014 17:37:30 +0000 (19:37 +0200)]
Japanese program translation update
Closes: 763033
David Kalnischkies [Fri, 20 Jun 2014 17:34:40 +0000 (19:34 +0200)]
store source name and version in binary cache
Accessing the package records to acquire this information is pretty
costly, so that information wasn't used so far in many places. The most
noticeable user by far is EDSP at the moment, but there are ideas to
change that which this commit tries to enable.
David Kalnischkies [Fri, 26 Sep 2014 23:00:14 +0000 (01:00 +0200)]
fix: %i in format string (no. 1) requires 'int' but the argument type is
'unsigned int'
Git-Dch: Ignore
Reported-By: cppcheck
David Kalnischkies [Fri, 26 Sep 2014 22:51:03 +0000 (00:51 +0200)]
fix: The class 'pkgSourceList' defines member variable with name 'SrcList' also defined in its parent class 'pkgSource'
Git-Dch: Ignore
Reported-By: cppcheck
David Kalnischkies [Fri, 26 Sep 2014 22:49:25 +0000 (00:49 +0200)]
fix: Prefer prefix ++/-- operators for non-primitive types
Git-Dch: Ignore
Reported-By: cppcheck
David Kalnischkies [Fri, 26 Sep 2014 22:46:43 +0000 (00:46 +0200)]
fix: Consecutive return, break, continue, goto or throw statements are unnecessary.
Git-Dch: Ignore
Reported-By: cppcheck
David Kalnischkies [Fri, 26 Sep 2014 22:12:44 +0000 (00:12 +0200)]
Merge branch 'feature/gnupglimit' into debian/experimental
David Kalnischkies [Fri, 26 Sep 2014 21:09:01 +0000 (23:09 +0200)]
add gnupg and gnupg2 as test-dependency
apt can work with both, so it has an or-dependency on them,
but the tests want to play with both of them.
Git-Dch: Ignore
James McCoy [Mon, 18 Aug 2014 10:54:19 +0000 (12:54 +0200)]
ensure apt-key del handles 16-byte key ids
The original patch does not apply against the rewritten apt-key,
but an additional test doesn't hurt.
Closes: 754436