summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2016-10-30dpkg: Switch from non-freeing malloc to m_malloc for invoke hooksGuillem Jover2-3/+18
These do not need to be part of the non-freeing memory pool, as that should be reserved for packaging metadata.
2016-10-30dpkg: Switch from non-freeing malloc to m_malloc on statdb slurpingGuillem Jover1-1/+3
The individual strings are now nfstrsave()ed so there is no need to allocate the whole file in the non-freeing memory pool.
2016-10-30dpkg: Fix md5sum parse error messages to include package name affectedGuillem Jover1-13/+14
2016-10-30dpkg: Remove obsolete --print-installation-architecture optionGuillem Jover3-10/+0
2016-07-08dpkg: Use the conffile name instead of the real pathname it might refer toGuillem Jover1-1/+1
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
2016-07-08dpkg: Fix a short-lived memory leak in archive argument parsingGuillem Jover1-1/+3
Warned-by: coverity
2016-07-03build: Uniformize library build optionsGuillem Jover2-8/+8
Make all of them consistently follow the pattern --with-lib<name>. Rename the m4 macros, preprocessor defines, and automake _LIBS flags.
2016-07-03dpkg-query: Fix strtol() errno check when parsing the COLUMNS envvarSven Joachim1-1/+1
Regression introduced in commit 3d258742dfe5cd18e4e06a5fbd855b99bb95046e. Closes: #827265 Signed-off-by: Guillem Jover <guillem@debian.org>
2016-07-03dpkg: Activate file triggers for conffiles on purgeGuillem Jover1-0/+7
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>
2016-07-03dpkg: Set primary group to 0 when running as rootGuillem Jover1-0/+6
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>
2016-07-03dpkg: Cleanup instdir handling in maintscript_pre_exec()Guillem Jover1-8/+13
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.
2016-07-03dpkg: On --force-chrootless only set changedir to instdir if definedNiall Walsh1-1/+1
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>
2016-07-03dpkg: Fix typo in debug outputGuillem Jover1-1/+1
Warned-by: lintian
2016-05-03dpkg: Fix off-by-one array allocationGuillem Jover1-1/+1
We need two entries more than the current nfiles, one for the next one and one for the final NULL.
2016-05-03dpkg: Use m_strdup() instead of strdup()Guillem Jover1-1/+1
2016-05-03dpkg: Fix file queue tail assignment in file queue popGuillem Jover1-1/+1
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
2016-05-02dpkg: Add new --force-script-chrootless optionHelmut Grohne3-4/+9
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>
2016-05-02dpkg: Export variable DPKG_ROOT in maintainer scriptsHelmut Grohne2-0/+4
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>
2016-05-02dpkg: Pass <new-version> to maintscript actions that cannot get it otherwiseGuillem Jover3-0/+5
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>
2016-04-01dpkg-query: Refactor pkg_array_match_pattenr()Guillem Jover1-82/+57
2016-04-01dpkg-query: Be more strict when parsing the COLUMNS environment variableGuillem Jover1-3/+8
Use strtol() instead of atoi() which does not make it possible to check for many error conditions.
2016-04-01dpkg: Do not error out when failing to open the SE label db on permissive modeGuillem Jover1-1/+1
If we are running in permissive mode (non-enforced) we should not consider SE Linux issues as errors. Closes: #811037
2016-04-01dpkg: Search for debsig-verify in PATH instead of using an absolute pathGuillem Jover1-3/+4
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.
2016-04-01dpkg: Factor find_command() out from checkpath()Guillem Jover2-27/+36
2016-02-27dpkg: Remove FIND usage, use treewalk insteadGuillem Jover2-45/+23
2016-02-27dpkg: Update unpack.c header commentGuillem Jover1-1/+1
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.
2016-02-27dpkg: Refactor pkg_check_depcon()Guillem Jover1-58/+68
2016-02-27dpkg: Refactor pkg_deconfigure_others()Guillem Jover1-46/+53
2016-02-27libdpkg, dpkg: Rename iterators from ‘it’ to ‘iter’Guillem Jover8-51/+51
2016-02-27dpkg: Refactor pkg_remove_old_files()Guillem Jover1-146/+159
2016-02-26dpkg: Refactor pkg_update_fields()Guillem Jover1-74/+85
2016-02-26dpkg: Refactor pkg_disappear_others()Guillem Jover1-78/+108
2016-02-26dpkg: Refactor pkg_remove_backup_files()Guillem Jover1-17/+26
2016-02-26dpkg: Refactor pkg_remove_files_from_others()Guillem Jover1-56/+69
2016-02-26dpkg: Switch addfiletolist() to tar_filenamenode_queue_push()Guillem Jover3-17/+3
2016-02-26dpkg: Switch remove_file_from_list() to tar_filenamenode_queue_pop()Guillem Jover1-11/+11
The new function uses a namespaced function name, and is not based on tarcontext, nor gets an unused tar_entry argument any more.
2016-02-26dpkg: Switch tarcontext newfilesp member into a filenamenode_queueGuillem Jover3-15/+16
2016-02-26dpkg: Rename filenamenode_queu_push() to tar_filenamenode_queue_push()Guillem Jover4-23/+22
Make the function less general, as we are using an extraction specific obstack.
2016-02-26dpkg: Fix memory leak when unpacking conffilesGuillem Jover1-1/+1
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.
2016-02-26dpkg: Encapsulate obstack usage inside new tar_pool functionsGuillem Jover1-18/+30
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.
2016-02-26dpkg: Add a new struct invoke_list to store invoke hooksGuillem Jover2-19/+20
This gets rid of the pointer to pointer to pointer handling, by simplifying and structuring things a bit.
2016-02-26dpkg: Use a node instead the head pointer to traverse the namenode listGuillem Jover1-4/+4
2016-01-26dpkg: Detect non-regular file archive arguments earlierGuillem Jover1-0/+4
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.
2016-01-26dpkg: Use ohshit() instead of internerr() for unhandled dpkg-split exit codesGuillem Jover1-1/+1
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
2016-01-26dpkg: Check that all passed archive filenames exist before queueing themGuillem Jover1-5/+14
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
2016-01-26dpkg: Print the archive filename when it cannot be accessedGuillem Jover1-1/+2
2015-12-25dpkg: Fix physical file offset comparisonYuri Gribov1-1/+3
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
2015-12-19dpkg: Add support for DPKG_MAINTSCRIPT_DEBUG environment variableGuillem Jover1-0/+5
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.
2015-12-12libdpkg: Rename pkg_summary to pkgbin_summaryGuillem Jover2-3/+3
This makes the function name consistent with the existing coding convention, and the other functions that require a pkgbin to operate.
2015-12-12dpkg-trigger: Move exit from command function to its call siteGuillem Jover1-5/+5
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.