Package: openvas-scanner
Followup-For: Bug #1067075
X-Debbugs-Cc: scho...@ubuntu.com
User: ubuntu-de...@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.cho...@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>
++#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 @@ attack_start (struct ipc_context *ipcc, struct 
attack_start_args *args)
+           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),
++        (uint32_t) ((now.tv_usec - then.tv_usec) / 10000));
+     }
+ }
+ 
+diff --git a/src/pluginlaunch.c b/src/pluginlaunch.c
+index d9d1dee..66ac683 100644
+--- a/src/pluginlaunch.c
++++ b/src/pluginlaunch.c
+@@ -24,8 +24,10 @@
+ #include "utils.h"
+ 
+ #include <errno.h>          /* for errno() */
++#include <inttypes.h>
+ #include <gvm/base/prefs.h> /* for prefs_get_bool() */
+ #include <gvm/util/nvticache.h>
++#include <stdint.h>
+ #include <stdio.h>  /* for perror() */
+ #include <stdlib.h> /* for atoi() */
+ #include <string.h>
+@@ -187,10 +189,10 @@ update_running_processes (kb_t main_kb, kb_t kb)
+                     {
+                       char *name = nvticache_get_filename (oid);
+                       g_message (
+-                        "%s (%s) [%d] finished its job in %ld.%.3ld seconds",
++                        "%s (%s) [%d] finished its job in 
%"PRIu64".%.3"PRIu32" seconds",
+                         name, oid, processes[i].pid,
+-                        (long) (now.tv_sec - processes[i].start.tv_sec),
+-                        (long) ((now.tv_usec - processes[i].start.tv_usec)
++                        (uint64_t) (now.tv_sec - processes[i].start.tv_sec),
++                        (uint32_t) ((now.tv_usec - processes[i].start.tv_usec)
+                                 / 1000));
+                       g_free (name);
+                     }
+
+base-commit: d6f2b322940b50ce5f2a6e121c6b41c57d9bbd26
+-- 
+2.43.0
+
diff -Nru openvas-scanner-22.7.9/debian/patches/series 
openvas-scanner-22.7.9/debian/patches/series
--- openvas-scanner-22.7.9/debian/patches/series        2023-12-19 
14:10:26.000000000 +0100
+++ openvas-scanner-22.7.9/debian/patches/series        2024-03-22 
17:51:47.000000000 +0100
@@ -1,3 +1,4 @@
 Fix-test-failure.patch
 Use-pkg_check_modules-when-required.patch
 Adapt-the-redis-config-file-for-Kali.patch
+Fix-printf-specifiers-for-time_t-related-types.patch

Reply via email to