summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/fileutl.cc
AgeCommit message (Collapse)Author
2014-03-13refactor setup of file opening via zlib/bz2 libDavid Kalnischkies
Git-Dch: Ignore
2014-03-13move fd duplication closer to the gz/bz2 open callsDavid Kalnischkies
Git-Dch: Ignore
2014-03-13cleanup headers and especially #includes everywhereDavid Kalnischkies
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)
2014-03-13warning: useless cast to type A [-Wuseless-cast]David Kalnischkies
Git-Dch: Ignore Reported-By: gcc -Wuseless-cast
2014-03-13warning: cast from type A to type B casts away qualifiers [-Wcast-qual]David Kalnischkies
Git-Dch: Ignore Reported-By: gcc -Wcast-qual
2014-03-12add hashsum support in apt-file download and add more testsMichael Vogt
2014-02-27Merge branch 'debian/sid' into debian/experimentalMichael Vogt
Conflicts: apt-private/private-list.cc configure.ac debian/apt.install.in debian/changelog
2014-02-22Fix typos in documentation (codespell)Michael Vogt
2014-02-14simplify code some more to make reddit happyDavid Kalnischkies
Commit 6008b79adf1d7ea5607fab87a355d664c8725026 should have been guarded by "Git-Dch: Ignore", but it wasn't and I only noticed it with the Close message via deity thinking "hehe, I wonder if someone is gonna notice". Looks like someone did: hats off to reddit user itisOmegakai! Good to know that what I do isn't only monitored by goverments. :) As there is another instance of basically the same code we just factor out the code a bit and reuse, so its even cleaner and not only simpler. Reported-By: scan-build
2014-02-10simplify code to make compilers happyDavid Kalnischkies
Does the same as before, but is a bit simpler on the logic for humans as well as compilers. scan-build complained about it at least with: "Result of operation is garbage or undefined" Reported-By: scan-build
2014-01-26Merge remote-tracking branch 'donkult/debian/sid' into debian/sidMichael Vogt
Conflicts: apt-private/private-list.cc doc/po/de.po test/integration/framework
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