Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
Quiesce most of the inoquous warning messages.
Closes: #403211
|
|
Command line options should only be known by the statoverride_*
functions.
|
|
|
|
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.
|
|
|
|
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.
|
|
Spotted-by: Christian Perrier <bubulle@debian.org>
|
|
Thinko from commit 85b9b00518419b23c209bb6567566b99f004241f.
|
|
This will help front-ends like APT to keep better track of the actions
done during a dpkg run.
Closes: #537338
|
|
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.
|
|
The check is done already in fgets_checked.
|
|
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
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.
|
|
|
|
|
|
|
|
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
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>
|
|
|
|
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.
|
|
|
|
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>
|
|
|
|
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>
|
|
|
|
This was making the --force, --update and --quiet flags not do anything.
|
|
|
|
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
Place the size at the end, and rename buf to dst, and s to src.
|
|
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>
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
Match the validations done on input in dpkg-statoverride, so that we can
reuse this code when rewritting dpkg-statoverride in C.
|
|
Move them closer to their actual usage.
|
|
|
|
Variable renames:
checklist → prog_list
clp → prog
path → path_list
s → path
p → path_end
l → path_len
buf → filename
|