• Bug#1067075: openvas-scanner: FTBFS on arm{el,hf}: /<>/src

    From Sebastian Ramacher@21:1/5 to All on Mon Mar 18 00:50:01 2024
    Source: openvas-scanner
    Version: 22.7.9-1
    Severity: serious
    Tags: ftbfs
    Justification: fails to build from source (but built successfully in the past) X-Debbugs-Cc: sramacher@debian.org

    https://buildd.debian.org/status/fetch.php?pkg=openvas-scanner&arch=armhf&ver=22.7.9-1%2Bb1&stamp=1710667919&raw=0

    [ 89%] Building C object src/CMakeFiles/openvas.dir/pluginload.c.o
    cd /<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/src && /usr/bin/cc -DNVT_TIMEOUT=320 -DOPENVAS_CONF=\"/etc/openvas/openvas.conf\" -DOPENVAS_DATA_DIR=\"/usr/share/openvas\" -DOPENVAS_FEED_LOCK_PATH=\"/var/lib/openvas/feed-update.lock\" -DOPENVAS_NVT_DIR=\"/
    var/lib/openvas/plugins\" -DOPENVAS_RUN_DIR=\"/run/ospd\" -DOPENVAS_STATE_DIR=\"/var/lib/openvas\" -DOPENVAS_SYSCONF_DIR=\"/etc/openvas\" -DOPENVAS_VERSION=\"22.7.9\" -DPREFIX=\"/usr\" -DSCANNER_NVT_TIMEOUT=36000 -DSYSCONFDIR=\"/etc\" -I/usr/include/glib-
    2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/gvm -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -D_LARGEFILE_
    SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -D_FILE_OFFSET_BITS=64 -DLARGEFILE_SOURCE=1 -std=c11 -Wall -Wextra
    -Werror -Wpedantic -Wmissing-prototypes -Wshadow -Wsequence-point -D_BSD_
    SOURCE -D_ISOC11_SOURCE -D_SVID_SOURCE -D_DEFAULT_SOURCE -O3 -DNDEBUG -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector -MD -MT src/CMakeFiles/
    openvas.dir/pluginload.c.o -MF CMakeFiles/openvas.dir/pluginload.c.o.d -o CMakeFiles/openvas.dir/pluginload.c.o -c /<<PKGBUILDDIR>>/src/pluginload.c
    In file included from /usr/include/glib-2.0/glib.h:64,
    from /<<PKGBUILDDIR>>/src/../misc/scanneraux.h:14,
    from /<<PKGBUILDDIR>>/src/attack.h:16,
    from /<<PKGBUILDDIR>>/src/attack.c:13: /<<PKGBUILDDIR>>/src/attack.c: In function ‘attack_network’: /<<PKGBUILDDIR>>/src/attack.c:1617:16: error: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘__time64_t’ {aka ‘long long int’} [-Werror=format=]
    1617 | g_message ("Vulnerability scan %s finished in %ld seconds: "
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1618 | "%d alive hosts of %d",
    1619 | globals->scan_id, now.tv_sec - then.tv_sec,
    | ~~~~~~~~~~~~~~~~~~~~~~~~
    | |
    | __time64_t {aka long long int}
    /usr/include/glib-2.0/glib/gmessages.h:350:32: note: in definition of macro ‘g_message’
    350 | __VA_ARGS__)
    | ^~~~~~~~~~~ /<<PKGBUILDDIR>>/src/attack.c:1617:53: note: format string is defined here
    1617 | g_message ("Vulnerability scan %s finished in %ld seconds: "
    | ~~^
    | |
    | long int
    | %lld /<<PKGBUILDDIR>>/src/attack.c:1622:16: error: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘__time64_t’ {aka ‘long long int’} [-Werror=format=]
    1622 | g_message ("Vulnerability scan %s finished in %ld seconds: %d hosts",
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1623 | globals->scan_id, now.tv_sec - then.tv_sec,
    | ~~~~~~~~~~~~~~~~~~~~~~~~
    | |
    | __time64_t {aka long long int}
    /usr/include/glib-2.0/glib/gmessages.h:350:32: note: in definition of macro ‘g_message’
    350 | __VA_ARGS__)
    | ^~~~~~~~~~~ /<<PKGBUILDDIR>>/src/attack.c:1622:53: note: format string is defined here
    1622 | g_message ("Vulnerability scan %s finished in %ld seconds: %d hosts",
    | ~~^
    | |
    | long int
    | %lld

    Cheers
    --
    Sebastian Ramacher

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Chopin@21:1/5 to All on Fri Mar 22 18:00:01 2024
    This is a multi-part MIME message sent by reportbug.


    Package: openvas-scanner
    Followup-For: Bug #1067075
    X-Debbugs-Cc: schopin@ubuntu.com
    User: ubuntu-devel@lists.ubuntu.com
    Usertags: origin-ubuntu noble ubuntu-patch
    Control: tags -1 patch ftbfs

    Hi,

    The attached patch should fix this (shipped in Ubuntu).

    -- System Information:
    Debian Release: trixie/sid
    APT prefers noble
    APT policy: (500, 'noble'), (100, 'noble-proposed')
    Architecture: amd64 (x86_64)
    Foreign Architectures: i386

    Kernel: Linux 6.8.0-11-generic (SMP w/8 CPU threads; PREEMPT)
    Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_USER, TAINT_OOT_MODULE Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
    Shell: /bin/sh linked to /usr/bin/dash
    Init: systemd (via /run/systemd/system)
    LSM: AppArmor: enabled

    diff -Nru openvas-scanner-22.7.9/debian/patches/Fix-printf-specifiers-for-time_t-related-types.patch openvas-scanner-22.7.9/debian/patches/Fix-printf-specifiers-for-time_t-related-types.patch
    --- openvas-scanner-22.7.9/debian/patches/Fix-printf-specifiers-for-time_t-related-types.patch 1970-01-01 01:00:00.000000000 +0100
    +++ openvas-scanner-22.7.9/debian/patches/Fix-printf-specifiers-for-time_t-related-types.patch 2024-03-22 17:51:47.000000000 +0100
    @@ -0,0 +1,75 @@
    +From b75d19ecd90498e6d005c62b8fd4d31f3909a5cb Mon Sep 17 00:00:00 2001
    +From: Simon Chopin <simon.chopin@canonical.com>
    +Date: Fri, 22 Mar 2024 17:43:22 +0100
    +Subject: [PATCH] Fix printf specifiers for time_t-related types
    +
    +Best to only use fixed-width types and explicit casting.
    +---
    + src/attack.c | 8 +++++---
    + src/pluginlaunch.c | 8 +++++---
    + 2 files changed, 10 insertions(+), 6 deletions(-)
    +
    +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1067075
    +diff --git a/src/attack.c b/src/attack.c
    +index 120a3cd..3c76b31 100644
    +--- a/src/attack.c
    ++++ b/src/attack.c
    +@@ -44,9 +44,11 @@
    + #include <gvm/util/nvticache.h> /* for nvticache_t */
    + #include <pthread.h>
    + #include <signal.h>
    ++#in
  • From Simon Chopin@21:1/5 to All on Sat Mar 23 12:10:01 2024
    This is a multi-part MIME message sent by reportbug.


    Source: openvas-scanner
    Followup-For: Bug #1067075
    X-Debbugs-Cc: schopin@ubuntu.com
    Control: tags -1 ftbfs

    It seems I missed a few (and messed something when test building?),
    new patch attached.


    -- System Information:
    Debian Release: trixie/sid
    APT prefers noble
    APT policy: (500, 'noble'), (100, 'noble-proposed')
    Architecture: amd64 (x86_64)
    Foreign Architectures: i386

    Kernel: Linux 6.8.0-11-generic (SMP w/8 CPU threads; PREEMPT)
    Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_USER, TAINT_OOT_MODULE Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
    Shell: /bin/sh linked to /usr/bin/dash
    Init: systemd (via /run/systemd/system)
    LSM: AppArmor: enabled

    From b75d19ecd90498e6d005c62b8fd4d31f3909a5cb Mon Sep 17 00:00:00 2001
    From: Simon Chopin <simon.chopin@canonical.com>
    Date: Fri, 22 Mar 2024 17:43:22 +0100
    Subject: [PATCH] Fix printf specifiers for time_t-related types

    Best to only use fixed-width types and explicit casting.
    ---
    src/attack.c | 8 +++++---
    src/pluginlaunch.c | 8 +++++---
    2 files changed, 10 insertions(+), 6 deletions(-)

    Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1067075
    --- a/src/attack.c
    +++ b/src/attack.c
    @@ -44,9 +44,11 @@
    #include <gvm/util/nvticache.h> /* for nvticache_t */
    #include <pthread.h>
    #include <signal.h>
    +#include <stdint.h>
    #include <string.h> /* for strlen() */
    #include <sys/wait.h> /* for waitpid() */
    #include <unistd.h> /* for close() */
    +#include <inttypes.h>

    #define ERR_HOST_DEAD -1

    @@ -987,9 +989,9 @@
    now.tv_usec += 1000000;
    }
    g_message (
    - "Vulnerability scan %s finished for host %s in %ld.%.2ld seconds",
    - globals->scan_id, ip_str, (long) (now.tv_sec - then.tv_sec),
    - (long) ((now.tv_usec - then.tv_usec) / 10000));
    + "Vulnerability scan %s finished for host %s in %"PRIu64".%.2"PRIu32" seconds",
    + globals->scan_id, ip_str, (uint64_t) (now.tv_sec - then.tv_sec),