git: 4c8d901b75f8 - main - security/openvas: fix build on armv7 (again)

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Mon, 04 Aug 2025 13:23:39 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4c8d901b75f85fb6a9cb8d2570274fef288d2e71

commit 4c8d901b75f85fb6a9cb8d2570274fef288d2e71
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2025-08-01 11:43:28 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-08-04 13:23:24 +0000

    security/openvas: fix build on armv7 (again)
    
    Some more printf type errors.  These are really not important,
    -Werror should be dropped as per policy so I don't have to revisit
    this port yet again.
    
    Approved by:    portmgr (build fix blanket)
    MFH:            2025Q3
---
 security/openvas/Makefile                     |  2 +-
 security/openvas/files/patch-misc_plugutils.c | 11 +++++++++++
 security/openvas/files/patch-src_attack.c     | 15 ++++++++++++---
 3 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/security/openvas/Makefile b/security/openvas/Makefile
index 5181bd1bc773..27e3a9a1a15a 100644
--- a/security/openvas/Makefile
+++ b/security/openvas/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	openvas
 DISTVERSION=	23.20.1
-PORTREVISION=	1
+PORTREVISION=	2
 DISTVERSIONPREFIX=	v
 CATEGORIES=	security
 
diff --git a/security/openvas/files/patch-misc_plugutils.c b/security/openvas/files/patch-misc_plugutils.c
new file mode 100644
index 000000000000..5c04ea7c4825
--- /dev/null
+++ b/security/openvas/files/patch-misc_plugutils.c
@@ -0,0 +1,11 @@
+--- misc/plugutils.c.orig	2025-08-01 11:38:10 UTC
++++ misc/plugutils.c
+@@ -74,7 +74,7 @@ add_kb_usage (struct script_infos *args, size_t size)
+   kb_usage += size;
+   if (kb_usage > max_kb_usage)
+     {
+-      g_warning ("KB usage exceeded %lu MB. Unable to store any further KB "
++      g_warning ("KB usage exceeded %zu MB. Unable to store any further KB "
+                  "Items for script %s",
+                  max_kb_usage / 1024 / 1024, args->name);
+       return -1;
diff --git a/security/openvas/files/patch-src_attack.c b/security/openvas/files/patch-src_attack.c
index af15212b9768..9a78559b0a30 100644
--- a/security/openvas/files/patch-src_attack.c
+++ b/security/openvas/files/patch-src_attack.c
@@ -1,5 +1,5 @@
---- src/attack.c	2025-03-03 04:49:55.000000000 -0800
-+++ src/attack.c	2025-04-14 20:09:40.968033000 -0700
+--- src/attack.c.orig	2025-05-27 12:10:19 UTC
++++ src/attack.c
 @@ -31,7 +31,6 @@
  #include "utils.h"
  
@@ -8,7 +8,7 @@
  #include <errno.h> /* for errno() */
  #include <fcntl.h>
  #include <glib.h>
-@@ -1555,14 +1554,14 @@
+@@ -1555,21 +1554,21 @@ stop:
    gettimeofday (&now, NULL);
    if (test_alive_hosts_only)
      {
@@ -27,3 +27,12 @@
                 gvm_hosts_count (hosts));
  
    if (prefs_get ("report_scripts"))
+     {
+       char *buff =
+-        g_strdup_printf ("},\"scan_time\":  {\"start\": %ld, \"stop\": %ld}}",
+-                         then.tv_sec, now.tv_sec);
++        g_strdup_printf ("},\"scan_time\":  {\"start\": %lld, \"stop\": %lld}}",
++                         (long long)then.tv_sec, (long long)now.tv_sec);
+       char *path = g_strdup_printf (
+         "%s/%s-stats.json", prefs_get ("report_scripts"), globals->scan_id);
+