• [PATCH] Warn for unknown info files in packages

    From Simon Richter@21:1/5 to All on Fri May 5 21:20:01 2023
    Debian Policy forbids info files not mentioned in Policy, except if their
    names start with an underscore to flag them as non-critical.
    ---
    src/main/unpack.c | 29 +++++++++++++++++++++++++++++
    tests/t-multiarch/Makefile | 24 ++++++++++++------------
    2 files changed, 41 insertions(+), 12 deletions(-)

    diff --git a/src/main/unpack.c b/src/main/unpack.c
    index 9048f6fb0..446f8d4c5 100644
    --- a/src/main/unpack.c
    +++ b/src/main/unpack.c
    @@ -496,9 +496,23 @@ pkg_infodb_update_file(const char *filename, const char *filetype)
    static void
    pkg_infodb_update(struct pkginfo *pkg, char *cidir, char *cidirrest)
    {
    + char const *const known_info_names[] =
    + {
    + "conffiles",
    + "control",
    + "preinst",
    + "prerm",
    + "postinst",
    + "postrm",
    + "triggers"
    + };
    + size_t const num_known_info_names =
    + sizeof known_info_names / sizeof known_info_names[0];
    +
    struct match_node *match_node;
    DIR *dsd;
    struct dirent *de;
    + bool known;

    /* Deallocate the match list in case we aborted previously. */
    while ((match_node = match_head)) {
    @@ -567,6 +581,21 @@ pkg_infodb_update(struct pkg
  • From Guillem Jover@21:1/5 to Simon Richter on Fri May 5 23:00:01 2023
    Hi!

    Thanks for the patches.

    On Sat, 2023-05-06 at 04:11:05 +0900, Simon Richter wrote:
    Debian Policy forbids info files not mentioned in Policy, except if their names start with an underscore to flag them as non-critical.

    I think you might be mixing up .deb ar members with entries in the
    control member in the .deb?

    diff --git a/src/main/unpack.c b/src/main/unpack.c
    index 9048f6fb0..446f8d4c5 100644
    --- a/src/main/unpack.c
    +++ b/src/main/unpack.c
    @@ -496,9 +496,23 @@ pkg_infodb_update_file(const char *filename, const char *filetype)
    static void
    pkg_infodb_update(struct pkginfo *pkg, char *cidir, char *cidirrest)
    {
    + char const *const known_info_names[] =
    + {
    + "conffiles",
    + "control",
    + "preinst",
    + "prerm",
    + "postinst",
    + "postrm",
    + "triggers"
    + };

    And in any case even if the Debian policy said something to that
    effect (which I don't think it does), this could not be applied at
    the dpkg level, as it is both non-exhaustive (missing control files
    handled by the dpkg suite like shlibs, symbols, md5sums, which is
    easily fixable) but in any case it cannot ever be, as we need to
    support external parties shipping unknown control files (such as
    config, templates for debconf, clilibs for mono (AFAIR), or starlibs
    (no clue about that one)), or make allowances for future control
    file additions.

    If there's ever a need for something like this, I think that would
    belong in a linter.

    So, I'm not planning on merging this one.

    Thanks,
    Guillem

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexandre Detiste@21:1/5 to All on Sat May 6 00:00:01 2023
    Le ven. 5 mai 2023 à 22:58, Guillem Jover <guillem@debian.org> a écrit :
    If there's ever a need for something like this, I think that would
    belong in a linter.

    const std::array<string, 16> suffixes {
    ".clilibs",
    ".conffiles",
    ".config",
    ".fortran_mod",
    ".list",
    ".md5sums",
    ".postinst",
    ".postrm",
    ".preinst",
    ".prerm",
    ".runit",
    ".shlibs",
    ".starlibs",
    ".symbols",
    ".templates",
    ".triggers",
    };


    So, I'm not planning on merging this one.

    I've got a few more here in "cruft-ng" linter: fortran_mod at least,
    yeah I think too it's right not to have this in dpkg :-)

    You can use https://binarycontrol.debian.net/cache/unstable.tar.xz
    to do a survey by yourself.

    Greeting

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Richter@21:1/5 to All on Sat May 6 07:20:01 2023
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------pk06DZL8ZyW2cVOMtie0zwQ0
    Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64

    SGksDQoNCk9uIDA2LjA1LjIzIDA1OjU4LCBHdWlsbGVtIEpvdmVyIHdyb3RlOg0KDQo+PiBE ZWJpYW4gUG9saWN5IGZvcmJpZHMgaW5mbyBmaWxlcyBub3QgbWVudGlvbmVkIGluIFBvbGlj eSwgZXhjZXB0IGlmIHRoZWlyDQo+PiBuYW1lcyBzdGFydCB3aXRoIGFuIHVuZGVyc2NvcmUg dG8gZmxhZyB0aGVtIGFzIG5vbi1jcml0aWNhbC4NCg0KPiBJIHRoaW5rIHlvdSBtaWdodCBi ZSBtaXhpbmcgdXAgLmRlYiBhciBtZW1iZXJzIHdpdGggZW50cmllcyBpbiB0aGUNCj4gY29u dHJvbCBtZW1iZXIgaW4gdGhlIC5kZWI/DQoNCk9vZiwgeWVzLiAtXy0NCg0KUmVtb3Zpbmcg dGhpcyBvbmUgZnJvbSBteSBzdGFjaywgdGhhdCBpcyBwcm9iYWJseSBiZXR0ZXIgaGFuZGxl ZCBieSBhIA0KUHJlLURlcGVuZHMgYW55d2F5Lg0KDQogICAgU2ltb24NCg==

    --------------pk06DZL8ZyW2cVOMtie0zwQ0--

    -----BEGIN PGP SIGNATURE-----

    iQEzBAEBCgAdFiEEtjuqOJSXmNjSiX3Tfr04e7CZCBEFAmRV4RwACgkQfr04e7CZ CBFhIwf9EuxRV5er1CLPhw2AGVF6fv7WxJF+cNz897Vr5RWJrUaUdJK0j/Lqcomt //5ZBbec1ewPBjxt3GL0/15M3PJ2DZ+CUZrGJTdzTqQS2D/iq+LfUQ8E2QwOEhzH IMuZfWDq6UXq5a2zGDxl+H8iHJW0jlFGBpGbVhkIARwRQt1HsMTJ09sqEdprkgsU SMPswuDRGlwBq6oZYam0QfN1ufRXOiPquR47vUF+NmPd7VvOS36rzRAsq572pdFL JrdNF/tTgFj5otXhgvAerbIpj45T5JejUrKMdm5T79493pJpoqmtTQQ8Ne/s2Gex HwtMH2gW+g6eWK/gcUFWEl6ayLge1g==
    =27Jm
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)