summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire.cc
Commit message (Collapse)AuthorAgeFilesLines
* chown finished partial files earlierDavid Kalnischkies2014-10-231-15/+25
| | | | | | | | | | | | | | | | | partial files are chowned by the Item baseclass to let the methods work with them. Now, this baseclass is also responsible for chowning the files back to root instead of having various deeper levels do this. The consequence is that all overloaded Failed() methods now call the Item::Failed base as their first step. The same is done for Done(). The effect is that even in partial files usually don't belong to _apt anymore, helping sneakernets and reducing possibilities of a bad method modifying files not belonging to them. The change is supported by the framework not only supporting being run as root, but with proper permission management, too, so that privilege dropping can be tested with them.
* check that auth.conf exists before chowning itDavid Kalnischkies2014-10-221-3/+4
| | | | Git-Dch: Ignore
* Ensure /etc/apt/auth.conf has _apt:root ownerMichael Vogt2014-10-211-2/+10
| | | | | Ensure in SetupAPTPartialDirectory() that the /etc/apt/auth.conf file can be read by the priv sep apt methods.
* fix compile and tests errorDavid Kalnischkies2014-10-131-3/+3
| | | | | | I am pretty sure I did that before committing broken stuff… Git-Dch: Ignore
* Fix backward compatiblity of the new pkgAcquireMethod::DropPrivsOrDie()Michael Vogt2014-10-131-2/+3
| | | | | | | | 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.
* do not inline virtual destructors with d-pointersDavid Kalnischkies2014-10-131-0/+4
| | | | | | | | | | | | | | Reimplementing an inline method is opening a can of worms we don't want to open if we ever want to us a d-pointer in those classes, so we do the only thing which can save us from hell: move the destructors into the cc sources and we are good. Technically not an ABI break as the methods inline or not do the same (nothing), so a program compiled against the old version still works with the new version (beside that this version is still in experimental, so nothing really has been build against this library anyway). Git-Dch: Ignore
* ensure partial dirs are 0700 and owned by _apt:rootDavid Kalnischkies2014-10-071-23/+55
| | | | | | | | | 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.
* Merge remote-tracking branch 'upstream/debian/experimental' into ↵Michael Vogt2014-09-291-28/+23
|\ | | | | | | | | | | | | | | | | feature/acq-trans Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h methods/gpgv.cc
| * allow fetcher setup without directory creationDavid Kalnischkies2014-09-271-13/+17
| | | | | | | | | | | | | | | | | | | | | | 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
| * fix: Member variable 'X' is not initialized in the constructor.David Kalnischkies2014-09-271-15/+6
| | | | | | | | | | Reported-By: cppcheck Git-Dch: Ignore
* | use pkgAcqMetaBase as the transactionManagerMichael Vogt2014-09-171-69/+0
| |
* | make errors more consistentMichael Vogt2014-08-011-2/+3
| |
* | fail early (again) on gpg sig failuresMichael Vogt2014-07-311-2/+2
| |
* | Rework TransactionID stuffMichael Vogt2014-07-311-0/+3
| |
* | WIP cleanup pkgAcqMetaSigMichael Vogt2014-07-221-1/+0
| |
* | add pkgAcquire::TransactionHasError()Michael Vogt2014-07-211-3/+20
| |
* | WIP transaction based updateMichael Vogt2014-07-181-0/+50
|/
* Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-07-081-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/deb/deblistparser.cc 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/pl.po doc/po/pt.po doc/po/pt_BR.po po/da.po po/mr.po po/vi.po
| * Do not clean "/" in pkgAcquire::Clean/pkgArchiveCleanerMichael Vogt2014-07-081-0/+3
| | | | | | | | | | | | | | Having "/" here is most likely a user configuration error and may cause removal of import symlinks like /vmlinuz Closes: #753531
* | check for UnfetchedReleaseFiles when calculating the update percent valueMichael Vogt2014-05-081-4/+9
| |
* | calculate Percent as part of pkgAcquireStatus to provide a weighted percent ↵Michael Vogt2014-04-161-17/+17
| | | | | | | | for both items and bytes
* | add Debug::acquire::progress debug option and fixme for index file loading ↵Michael Vogt2014-04-161-0/+8
| | | | | | | | with the correct extension
* | load the size from the metaindex into the fetcher to have even more accurate ↵Michael Vogt2014-04-161-1/+4
| | | | | | | | progress information
* | make the TotalFiles more reliable in apt-get updateMichael Vogt2014-04-161-4/+12
|/
* follow method attribute suggestions by gccDavid Kalnischkies2014-03-131-3/+3
| | | | | Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn}
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-0/+6
| | | | | | | | 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)
* warning: extra ‘;’ [-Wpedantic]David Kalnischkies2014-03-131-1/+1
| | | | | Git-Dch: Ignore Reported-By: gcc -Wpedantic
* Fix typos in documentation (codespell)Michael Vogt2014-02-221-3/+3
|
* * apt-pkg/acquire*.cc:Raphael Geissert2012-05-141-5/+34
| | | | | | | - handle redirections in the worker with the right method instead of in the method the redirection occured in (Closes: #668111) * methods/http.cc: - forbid redirects to change protocol
* use a static FileFd::Write overload to reduce duplication of write()-retry codeDavid Kalnischkies2012-04-111-15/+1
|
* * apt-pkg/acquire-worker.cc:David Kalnischkies2012-03-201-1/+17
| | | | | | | | | | | - check return of write() as gcc recommends * apt-pkg/acquire.cc: - check return of write() as gcc recommends * apt-pkg/cdrom.cc: - check return of chdir() and link() as gcc recommends * apt-pkg/clean.cc: - check return of chdir() as gcc recommends * apt-pkg/contrib/netrc.cc: - check return of asprintf() as gcc recommends
* fix a bunch of cppcheck "(warning) Member variable '<#>' is notDavid Kalnischkies2012-03-041-1/+1
| | | | initialized in the constructor." messages (no functional change)
* merge with debian/sidDavid Kalnischkies2011-09-131-0/+4
|\
| * * apt-pkg/acquire.cc:David Kalnischkies2011-08-221-0/+4
| | | | | | - non-existing directories are by definition clean
* | merge with debian/experimentalDavid Kalnischkies2011-09-131-11/+13
|\ \
| * \ merged from lp:~mvo/apt/mvoMichael Vogt2011-08-151-1/+3
| |\ \
| | * | * apt-pkg/acquire.cc:Michael Vogt2011-08-091-1/+3
| | | | | | | | | | | | - fix potential divide-by-zero
| * | | merged from the debian-sid branchMichael Vogt2011-08-151-10/+10
| |\ \ \ | | |/ / | |/| / | | |/
| | * cppcheck complains about some possible speed improvements which could beDavid Kalnischkies2011-08-111-10/+10
| | | | | | | | | | | | | | | | | | done on the mirco-optimazation level, so lets fix them: (performance) Possible inefficient checking for emptiness. (performance) Prefer prefix ++/-- operators for non-primitive types.
* | | reorder includes: add <config.h> if needed and include it at firstDavid Kalnischkies2011-09-131-2/+4
|/ /
* | replace the last standing double's with long longDavid Kalnischkies2011-07-141-5/+4
| |
* | * apt-pkg/acquire*.{cc,h}:David Kalnischkies2011-07-051-1/+1
| | | | | | | | - try even harder to support really big files in the fetcher by converting (hopefully) everything to 'long long' (Closes: #632271)
* | fix compiler warning by reordering init-listDavid Kalnischkies2011-06-291-4/+4
|/ | | | | | apt-pkg/acquire.h: In constructor ‘pkgAcquire::pkgAcquire()’: apt-pkg/acquire.h:175:9: warning: ‘pkgAcquire::Running’ will be initialized after [-Wreorder] apt-pkg/acquire.h:96:8: warning: ‘int pkgAcquire::LockFD’ [-Wreorder]
* rename the newly public CheckDirectory method to CreateAPTDirectoryIfNeededDavid Kalnischkies2010-09-061-4/+4
| | | | to give a better indication what this method will do if called.
* * apt-pkg/deb/dpkgpm.cc:David Kalnischkies2010-09-021-21/+0
| | | | | | | - create Dir::Log if needed to support /var/log as tmpfs or similar, inspired by Thomas Bechtold, thanks! (Closes: #523919, LP: #220239) Easily done by moving a private method from pkgAcquire into the public area of fileutl.cc to be able to use it also in here
* * apt-pkg/depcache.cc:David Kalnischkies2010-06-031-6/+6
| | | | | | | | | | | | - switch i{Download,Usr}Size from double to (un)signed long long The biggest reason is that this saves a lot of float point operations we do in AddSizes() on integers. The only reason i see that this was a double is that it was 64bit long and can therefore store bigger values than int/long, but with the availablity of (un)signed long long we are now also at 64bit and can store sizes more than 8 Exabytes big - by the time this will be a limit the C/C++ Standard will have bigger types, hopefully.
* create the partial dirs also automatic if only Dir::Cache::archives orDavid Kalnischkies2010-04-131-5/+14
| | | | Dir::Cache::lists was set
* * apt-pkg/contrib/fileutl.cc:David Kalnischkies2010-04-071-23/+66
| | | | | | | | | | - add a parent-guarded "mkdir -p" as CreateDirectory() * apt-pkg/acquire.{cc,h}: - add a delayed constructor with Setup() for success reporting - check for and create directories in Setup if needed instead of error out unfriendly in the Constructor (Closes: #523920, #525783) - optional handle a lock file in Setup() * cmdline/apt-get.cc: - remove the lock file handling and let Acquire take care of it instead
* The 'not dead yet' releaseMichael Vogt2009-07-211-4/+1
|\ | | | | | | | | | | | | | | | | | | | | * add hook for MarkInstall and MarkDelete (closes: #470035) * add the various foldmarkers in apt-pkg & cmdline (no code change) * versions with a pin of -1 shouldn't be a candidate (Closes: #355237) * prefer mmap as memory allocator in MMap instead of a static char array which can (at least in theory) grow dynamic * eliminate (hopefully all) segfaults in pkgcachegen.cc and mmap.cc which can arise if cache doesn't fit into the mmap (Closes: #535218) * display warnings instead of errors if the parts dirs doesn't exist * honor the dpkg hold state in new Marker hooks (closes: #64141)
| * add the various foldmarkers in apt-pkg & cmdline (no code change)David Kalnischkies2009-06-301-4/+1
| |