Age | Commit message (Collapse) | Author | Files | Lines |
|
These do not need to be part of the non-freeing memory pool, as that
should be reserved for packaging metadata.
|
|
The individual strings are now nfstrsave()ed so there is no need to
allocate the whole file in the non-freeing memory pool.
|
|
|
|
|
|
When activating file triggers on conffile purge, use the conffile name
instead of the real pathname it might refer to. This fixes a segfault
when using --instdir, or when the conffile has been moved around and
replaced with a symlink to the target.
Regression introduced in 2f065fc151ac4635ae40bd769d1be810e1222e05.
Closes: #830267
Stable-Candidate: 1.17.x
|
|
Warned-by: coverity
|
|
Make all of them consistently follow the pattern --with-lib<name>.
Rename the m4 macros, preprocessor defines, and automake _LIBS flags.
|
|
Regression introduced in commit 3d258742dfe5cd18e4e06a5fbd855b99bb95046e.
Closes: #827265
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
The code has never activated triggers for conffiles on purge, the code
before commit 65ade6390b47fe3ec6a0e2ba341f3d553bf4 was activating them
on removal, which was obviously wrong.
Stable-Candidate: 1.17.x
Reported-by: Helmut Grohne <helmut@subdivi.de>
|
|
If the user was running with a primary group that is not root, actions
performed by maintainer scripts might inherit and use the wrong primary
group when creating files, or doing group based checks.
Reported-by: Stuart Prescott <stuart@debian.org>
|
|
Rename instdirl to instdirlen. Use that instead of checking if the first
character of instdir is non-NUL. Move the changedir assignment to a
proper if/else conditional.
|
|
This breaks --force-chrootless (or --force-all, which is a terrible
idea in general) without having set --instdir.
Closes: #824542
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
Warned-by: lintian
|
|
We need two entries more than the current nfiles, one for the next one
and one for the final NULL.
|
|
|
|
When we are popping a file from the files queue, we might end up messing
it up. To check for the side-effects on the file-system one should look
for files with .dpkg-new extension for packages that have been fully
configured and where those files are not listed as owned by them. These
packages will need to be reinstalled.
Closes: #823288
|
|
Currently, dpkg chroots to the instdir before invoking maintainer
scripts. The new force flag will inhibit the chroot call. The user
is supposed to know that the packages being operated on does support
this new mode of operation. Thus the force flag is marked as dangerous.
[guillem@debian.org:
- Rename force option to --force-script-chrootless.
- Reword force option description in man page.
- Reactor changedir variable. ]
Ref: #804624
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
This variable holds the value of instdir. It is supposed to be used
in maintainer scripts. It should be prepended to all paths that are
operated on. Currently, dpkg chroots to the instdir before invoking
maintainer scripts, so when it does that DPKG_ROOT is set to the empty
string. Thus currently, DPKG_ROOT is always empty.
[guillem@debian.org:
- Reword man page to clarify current status. ]
Closes: #804624
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
The upgrade actions and their rollback counterparts do not have access
to the new binary package which is somewhere on the filesystem depending
on how dpkg was invoked, nor to its metadata. If the maintainer script
wants to know the <new-version>, it needs to be turned into a template
and that version instantiated at build-time, which is cumbersome.
So we now pass <new-version> when these upgrade actions are already
getting <old-version>, but not on the cases where they do not get any
argument at all, as that's their differentiator.
Prompted-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
|
|
|
|
Use strtol() instead of atoi() which does not make it possible to check
for many error conditions.
|
|
If we are running in permissive mode (non-enforced) we should not
consider SE Linux issues as errors.
Closes: #811037
|
|
Check that the command exists in the PATH before using it. This makes it
future proof, and friendlier to other systems that might not be using
the same filesystem layout.
It also makes it possible to use a local debsig-verify in a path such as
/usr/local/bin.
|
|
|
|
|
|
The function is not huge any longer, just big, as it has been refactored
substantially over time. And although it can still be reduced further, it
is definitely not the defining trait of this file anymore.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The new function uses a namespaced function name, and is not based on
tarcontext, nor gets an unused tar_entry argument any more.
|
|
|
|
Make the function less general, as we are using an extraction specific
obstack.
|
|
We keep a queue of conffile filenodenames, and never free it. We should
be using instead the obstack allocator, so that when we are done with
this package the list entries get all released at the same time.
|
|
These functions hide tar obstack usage, and stop requiring an explicit
initialization, so that we can always safely call the allocator and it
will always start from a known good state.
|
|
This gets rid of the pointer to pointer to pointer handling, by
simplifying and structuring things a bit.
|
|
|
|
We cannot handle anything else that is not a regular file (excluding
symlinks to them), so detect this earlier and error out in such case.
|
|
If dpkg-split exits with an unhandled exit code we should not abort
dpkg, we should just handle the error in the same way we handle errors
from debsig-verify or dpkg-deb.
Closes: #812679
|
|
We can prevent many bad situations by performing earlier checks on
the archives. We'll start now by checking if the passed filenames do
actually exist. And we can move some other checks here piece by piece.
Closes: #809963
|
|
|
|
The comparison function pkg_sorter_by_listfile_phys_offs passed to qsort
does not satisfy qsort symmetry requirements, for some inputs
pkg_sorter_by_listfile_phys_offs(a, b) != -
pkg_sorter_by_listfile_phys_offs(b, a)
This may cause various qsort misbehaviors e.g. failing to properly sort
the input array (on some platforms qsort could even abort although that
seems to not be the case for glibc-based systems).
Closes: #808912
Signed-off-by: Guillem Jover <guillem@debian.org>
Stable-Candidate: 1.16.x 1.17.x
|
|
This variable will be set on the maintainer scripts environment to
either 0 or 1, depending on whether dpkg was called with --debug
requesting maintainer scripts debugging output.
|
|
This makes the function name consistent with the existing coding
convention, and the other functions that require a pkgbin to operate.
|
|
This makes it explicit that the code flow stops at the call site instead
of requiring the reader to know that this specific function never returns.
|