Bug 4556 - dpkg fails to re-install config files when unchanged
Summary: dpkg fails to re-install config files when unchanged
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.19.x
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-29 03:17 UTC by Damion
Modified: 2012-07-31 08:18 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
A patch to apply described change (410 bytes, patch)
2012-07-31 08:18 UTC, Bobi B.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Damion 2011-11-29 03:17:59 UTC
dpkg is supposed to check all files in a debian package that are listed in 'conffiles' against the currently installed versions to see if they have been locally modified.  This is done via md5sums.
The current code is broken, and attempts to check the calculated md5sum against the filename, which will never match. (busybox/archival/dpkg.c filter_rename_config(archive_handle_t *archive_handle)).
Thus, local config files are never upgraded.

I assume the correct checking should be done against the contents of the debian package control file named 'md5sums' rather than the current linked list of 'conffiles'
Comment 1 Bobi B. 2012-07-31 08:17:08 UTC
The problem is, that busybox searches for MD5 sum using file's full path, including leading slash

    6583a05c20dfb3784cd48fef2c59aa05  /etc/protocols

whereas in md5sums leading slash is omitted

    6583a05c20dfb3784cd48fef2c59aa05  etc/protocols

On my Debian box md5sums files has no leading slashes, so the quickest fix is to replace

    sprintf(bin2hex(md5line, buf, 16), "  %s", name_ptr);

with

    sprintf(bin2hex(md5line, buf, 16), "  %s", name_ptr + 1);

in archival/dpkg.c:1553. Another option is to look for both.
Comment 2 Bobi B. 2012-07-31 08:18:09 UTC
Created attachment 4472 [details]
A patch to apply described change