summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2009-11-25dpkg-statoverride: Fail on chown or chmod errors when using --updateGuillem Jover1-2/+2
Fail if it cannot update the mode and owner of the file. This would fail later on when dpkg itself applies the overrides, so better to signal this as earlier as possible.
2009-11-25dpkg-statoverride: Make --quiet actually do somethingGuillem Jover1-4/+5
Quiesce most of the inoquous warning messages. Closes: #403211
2009-11-25dpkg-statoverride: Move access check outside of statdb_node_applyGuillem Jover1-12/+11
Command line options should only be known by the statoverride_* functions.
2009-11-24Use named initializers in structuresGuillem Jover1-13/+25
2009-11-24Use designated initializers for namevalue array elementsGuillem Jover1-8/+8
This way we ensure the order in the array by the value itself, and make the code resilient to possible changes in the sequence of the enums.
2009-11-24dpkg: Rename ‘struct badstatinfo’ member val to valueGuillem Jover1-2/+2
2009-11-22Refer to “half configured” instead of “failed config”Guillem Jover1-1/+1
Use it in «dpkg-query -l» header and dselect package status printing for consistency with the rest of the ouput. This seems to have been a source of confusion in the past, so we'll try to use this nomenclature to refer to this package status.
2009-11-14dpkg-statoverride: Add missing angle bracket in stringGuillem Jover1-1/+1
Spotted-by: Christian Perrier <bubulle@debian.org>
2009-11-13dpkg: Pass struct pkginfo instead of the package name to log_actionGuillem Jover1-1/+1
Thinko from commit 85b9b00518419b23c209bb6567566b99f004241f.
2009-11-12Add new status-fd action when disappearing a packageGuillem Jover1-0/+1
This will help front-ends like APT to keep better track of the actions done during a dpkg run. Closes: #537338
2009-11-12dpkg: Fix checkpath() to use varbuf instead of m_mallocGuillem Jover1-8/+11
This solves a potential problem in case any of the programs in prog_list is longer than "start-stop-daemon", which is the size being choosed as the longest one. By using a varbuf we let the code resize it dynamically if needed.
2009-11-12dpkg: Remove redundant ferror check in ensure_diversions()Guillem Jover1-2/+0
The check is done already in fgets_checked.
2009-11-12dpkg: Remove unused variable in ensure_diversions()Guillem Jover1-2/+1
2009-11-09dpkg: Refactor filename summarizing into a new functionGuillem Jover1-12/+25
2009-11-08Unify text in license headersGuillem Jover24-120/+120
Add a missing “of the License” after “version 2”. Move “but” and “GNU” at the end of line to the next line. This matches more closely the paragraph found in the license text for the GPL version 2.
2009-11-08Replace FSF address by pointing to the gnu.org URLGuillem Jover24-72/+48
Use the <http://www.gnu.org/licenses/> URL, instead of in most cases the outdated FSF address, which is way more stable, as the latter has changed several times in the past.
2009-11-07dpkg: Call standard_shutdown after invoking the post hooksGuillem Jover1-2/+2
The error unwinding is part of the shutdown, and the invoke hooks machinery might call ohshit, so it should be done at the end when there's no more error handling in place.
2009-11-07Use find with -L instead of deprecated -followGuillem Jover1-2/+2
2009-11-07dpkg: Do not bogusly ignore find exit code 1Guillem Jover1-1/+1
Commit 68b56dc4edaaf90f5311f07b38871ddd61b84a48 introduced the PROCNOERR to try to handle and be able to ignore find exit code 1, which supposedly happened (not any longer) when using the -follow option and a dangling symlink was found. But it only prevented the ohshit() inside checksubprocerr(), and the return value was still -1, so it was not ignoring the exit code 1, and still ohshit()ing in the caller. As find does currently exit with a 0 code even when finding broken symlinks, let's remove this piece of broken logic.
2009-11-07Use subproc_wait instead of directly calling waitpidGuillem Jover2-22/+6
2009-11-07Rename process description function arguments to descGuillem Jover2-13/+13
2009-11-07libdpkg: Rename and namespace subproc related functionsGuillem Jover3-7/+7
2009-10-26dpkg: Add JavaDoc comments for promptconfaction()Sean Finney1-2/+23
Signed-off-by: Guillem Jover <guillem@debian.org>
2009-10-26dpkg: Pass a pkginfo structure to promptconfaction()Sean Finney1-3/+4
In order to provide an interface into the conffiles DB API, it's required to know the package name that owns the conffile. Since this is a static function and the package structure is available in all places that the function is used, this is a fairly easy fix. Signed-off-by: Guillem Jover <guillem@debian.org>
2009-10-26Document some of the code with JavaDocGuillem Jover1-7/+30
2009-10-26Sort order of header includesGuillem Jover21-165/+162
Place first <config.h> and <compat.h>, then all <sys/*.h> sorted by complexity, followed by the rest of the system headers, then <dpkg/*.h> and finally the local "*.h" ones. Move <dpkg/i18n.h> inclusion into libdpkg inclusion block, as the <gettext.h> compatibility header already takes care of including <locale.h> before <libintl.h> on environments were its probamatic. Removed duplicated inclusions.
2009-10-26Remove unused <fnmatch.h> includeGuillem Jover3-3/+0
2009-10-16dpkg: Remove unused variable current in pkg_files_add_file()Guillem Jover1-1/+1
Introduced on commit 4985c686c30b2d0682aab0885d32c36007a7998d by me while manually merging the patch that didn't apply cleanly on master. Reported-by: Sean Finney <seanius@debian.org>
2009-10-14dpkg: Remove unused head variable in getselections()Guillem Jover1-3/+1
2009-10-14dpkg-statoverride: Fallback to printing #<id> if db lookup failsGuillem Jover1-6/+10
This allows it to gracefully handle uid and gid not present on the password databases, when storing on the overrides db, in a similar way as the perl implementation was behaving. Spotted-by: Raphaël Hertzog <hertzog@debian.org>
2009-10-14dpkg-statoverride: Fix typo inverting the override exists checkGuillem Jover1-1/+1
2009-10-14dpkg-statoverride: Add missing values for option flagsGuillem Jover1-3/+3
This was making the --force, --update and --quiet flags not do anything.
2009-10-14dpkg-statoverride: Add missing newline in --version outputGuillem Jover1-1/+1
2009-10-14Use named intializers in structuresGuillem Jover3-10/+14
2009-10-14Do not use C++ style comments in C codeGuillem Jover1-1/+1
2009-10-14dpkg: Refactor file addition into package files to a new functionDavid Benjamin1-27/+50
Added private function pkg_files_add_file for inserting a file to a package's entries. The function takes a file_tail to avoid an O(n^2) loop when adding to the end of the list. (This is what the original code does, so I have mirrored its behavior.) Signed-off-by: David Benjamin <davidben@mit.edu> Signed-off-by: Guillem Jover <guillem@debian.org>
2009-10-14dpkg: Split off emptying a package's file infoDavid Benjamin1-13/+34
Put it into a separate function for reuse by other routines and to simplify ensure_packagefiles_available. Signed-off-by: David Benjamin <davidben@mit.edu> Signed-off-by: Guillem Jover <guillem@debian.org>
2009-10-05libdpkg: Move copyfileperms to non-static file_copy_permsSean Finney1-26/+2
This functionality is also needed by the conffile handling code to ensure that the merge output is stored in a file with the same permissions as the original conffile, preventing the accidental opportunity for unintended information disclosure. Therefore the function is moved into a new library module (file.{c,h}), and given an appropriate prefix. Note that some of the translatable error messages have been modified as they would otherwise be misleading. Signed-off-by: Guillem Jover <guillem@debian.org>
2009-10-05libdpkg: Change order and rename path_quote_filename argumentsGuillem Jover1-2/+2
Place the size at the end, and rename buf to dst, and s to src.
2009-10-05libdpkg: Move quote_filename to the path module as path_quote_filenameSean Finney1-60/+5
This function will be useful for other parts of dpkg, so the function has been moved to a more sensible location, the static qualifier removed, and its name appropriately prefixed. Signed-off-by: Guillem Jover <guillem@debian.org>
2009-10-04libdpkg: Move pkg_sorter code to a new pkg moduleGuillem Jover1-5/+0
2009-10-04libdpkg: Rename pkglistqsortcmp to pkg_sorter_by_nameGuillem Jover3-4/+4
2009-10-04dpkg-statoverride: Add missing angle brackets in stringGuillem Jover1-1/+1
2009-09-30dpkg: Use stat size to varbuf_grow the buffer for readlinkGuillem Jover2-34/+27
Do not expand the buffer indefinitely by trying several times until the buffer is big enough. Pre-allocate just once using varbuf_grow with the known size from stat.
2009-09-30libdpkg: Use varbuf_grow instead of increasing member usedGuillem Jover1-1/+2
The code assumes that the various varbuf functions will grow the buffer if used > size, which is not going to be true once varbuf gets internally switched to varbuf_grow from varbufextend.
2009-09-30dpkg-statoverride: Rewrite in CGuillem Jover3-1/+453
2009-09-30statdb: Do stricter parsing validationGuillem Jover1-7/+13
Match the validations done on input in dpkg-statoverride, so that we can reuse this code when rewritting dpkg-statoverride in C.
2009-09-30dpkg: Reduce variable scope in checkpathGuillem Jover1-3/+5
Move them closer to their actual usage.
2009-09-30dpkg: Use size_t instead of long for path_len in checkpath()Guillem Jover1-2/+2
2009-09-30dpkg: Use more meaningful and clearer variable names in checkpath()Guillem Jover1-21/+26
Variable renames: checklist → prog_list clp → prog path → path_list s → path p → path_end l → path_len buf → filename