summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/fileutl.cc
AgeCommit message (Collapse)Author
2014-01-16correct some style/performance/warnings from cppcheckDavid Kalnischkies
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
2014-01-05Merge remote-tracking branch 'donkult/feature/clientmergepdiffs' into ↵Michael Vogt
debian/experimental-no-abi-break
2013-12-23add basic tests for GetTempDir()Michael Vogt
2013-12-22factor GetTempDir outMichael Vogt
2013-12-13allow ':' in GetListOfFilesInDirDavid Kalnischkies
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
2013-11-30truncating /dev/null to zero is always successfulDavid Kalnischkies
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
2013-11-28fix regression that APT::Keep-Fds is not honored (closes: #730490)Michael Vogt
2013-11-01small documentation updates0.9.13_exp1Michael Vogt
2013-10-31add new pid_t ExecFork(std::set<int> KeepFDs) to get rid of the super ugly ↵Michael Vogt
APT::Keep-Fds hack and also add a new PackageManagerProgressFd::StartDpkg() progress state
2013-10-07fix libapt-inst for >2G debs (closes: #725483)Michael Vogt
2013-08-31fix typo (mkostemp->mkstemp)Michael Vogt
2013-08-27use mkstemp instead of mkostemp in FileFd::Open()David Kalnischkies
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
2013-08-27replace usage of potential dangerous mktemp with mkstempAngel Guzman Maeso
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.
2013-08-22apt-pkg:contrib Avoid compiler warning about sign-compareÁngel Guzmán Maeso
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
2013-08-15* lp:~mvo/apt/add-glob-function:Michael Vogt
- add Glob() to fileutl.{cc,h} Conflicts: apt-pkg/contrib/fileutl.h debian/changelog
2013-08-15Merge branch 'debian/sid' into debian/experimentalMichael Vogt
Conflicts: apt-pkg/contrib/strutl.cc apt-pkg/deb/dpkgpm.cc configure.ac debian/changelog doc/po/apt-doc.pot po/apt-all.pot 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/uk.po po/vi.po po/zh_CN.po po/zh_TW.po test/integration/framework test/integration/test-bug-602412-dequote-redirect test/integration/test-ubuntu-bug-346386-apt-get-update-paywall test/interactive-helper/aptwebserver.cc test/interactive-helper/makefile
2013-07-28Merge remote-tracking branch 'mvo/bugfix/coverity' into debian/sidMichael Vogt
2013-07-26ensure that FileFd::Size returns 0 in error casesDavid Kalnischkies
2013-07-25add missing "free(buffer) for allocated bufferMichael Vogt
2013-07-25fix resource leak (thanks coverity)Michael Vogt
2013-07-25always "delete d" in FileFd::~FileFd to coverity happyMichael Vogt
2013-06-09fail in CopyFile if the FileFds have error flag setDavid Kalnischkies
Testing for global PendingErrors in users of CopyFile is incorrect in so far as unrelated errors will prevent us from copying perfectly fine files and checking for the validity of the files is just better in CopyFiles as it already checks if files are at least opened. Add also a higher-level error message to the error stack if it fails.
2013-06-09OpenDescriptor should autoclose fd always on errorDavid Kalnischkies
OpenInternDescriptor failures would cause additional errors to be generated by double-closing an fd. Other errors (although these are generated if the method is used incorrectly, so unlikely) didn't close the fd aswell. Closes: 704608
2013-06-09set Fail flag in FileFd on all errors consistentlyDavid Kalnischkies
Previously some errors would set the Fail flag while some didn't without a clear reason as all errors leave a bad FileFd behind, so we use a helper now to ensure that all errors set the flag.
2013-06-06fix double free (closes: #711045)Michael Vogt
2013-04-23merged debian-sid branch and resolved conflictsMichael Vogt
2013-03-10various simple changes to fix cppcheck warningsDavid Kalnischkies
2012-10-17* lp:~mvo/apt/add-glob-function:Michael Vogt
- add Glob() to fileutl.{cc,h}
2012-10-17merged from debian-sidMichael Vogt
2012-09-04add "Glob()" to fileutlMichael Vogt
2012-08-04* apt-pkg/contrib/fileutl.cc:David Kalnischkies
- remove _POSIX_SYNCHRONIZED_IO guard in FileFd::Sync() around fsync as this guard is only needed for fdatasync and not defined on hurd
2012-07-10 cherry pick -r1847 from bzr+ssh://bazaar.launchpad.net/~mvo/apt/lp346386/Michael Vogt
2012-07-10cherry pick -r1846 from bzr+ssh://bazaar.launchpad.net/~mvo/apt/lp346386/Michael Vogt
2012-07-10merged the relevant bits from lp:~mvo/apt/lp346386Michael Vogt
2012-06-21check when finished downloading the InRelease file if it has the expected ↵Michael Vogt
gpg clearsign signature and if not download Release/Release.gpg instead
2012-05-22* apt-pkg/contrib/fileutl.cc:David Kalnischkies
- dup() given compressed fd in OpenDescriptor if AutoClose is disabled as otherwise gzclose() and co will close it
2012-05-16* apt-pkg/contrib/fileutl.cc:David Kalnischkies
- ensure that we close compressed fds, wait for forks and such even if the FileFd itself is set to not autoclose the given Fd
2012-05-10ensure that d is set before accessing itDavid Kalnischkies
2012-05-10ensure that in error conditions the Fail flag is setDavid Kalnischkies
2012-05-10collect zombie (de)compressor processes on reopenDavid Kalnischkies
2012-05-09ensure that we do init d only once and especially not with its ownDavid Kalnischkies
content as this causes some "interesting" hickups resulting in segfaults as it seems (Closes: #554387, #670979)
2012-05-09* apt-pkg/contrib/fileutl.cc:David Kalnischkies
- check that the fd which are closed are valid
2012-04-19* apt-pkg/contrib/fileutl.cc:David Kalnischkies
- redirect stderr from compressors to /dev/null
2012-04-11use a static FileFd::Write overload to reduce duplication of write()-retry codeDavid Kalnischkies
2012-04-05 - add libbz2-dev as new build-dependencyDavid Kalnischkies
- remove the libz-dev alternative from zlib1g-dev build-dependency - do the same for bz2 builtin if available * apt-pkg/contrib/fileutl.cc: - use libz2 library for (de)compression instead of the bzip2 binary as the first is a dependency of dpkg and the later just priority:optional so we gain 'easier' access to bz2-compressed Translation files this way
2012-04-05if we have zlib builtin insert add a dummy gzip compressor for FileFDDavid Kalnischkies
2012-04-05detect zlib correctly. We still don't allow to build without it to remainDavid Kalnischkies
compatible with users accessing it directly, but this prepares for a drop of this strict requirement in the future
2012-03-06* apt-pkg/contrib/fileutl.cc:David Kalnischkies
- do not warn about the ignoring of directories (Closes: #662762)
2012-02-11* apt-pkg/cachefile.cc:David Kalnischkies
- clean up lost atomic cachefiles with 'clean' (Closes: #650513)
2012-02-03rework previous patch to avoid changing the inline codeMichael Vogt