pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/security/zoneminder



Module Name:    pkgsrc
Committed By:   gdt
Date:           Wed Jan  7 01:03:59 UTC 2026

Modified Files:
        pkgsrc/security/zoneminder: distinfo
        pkgsrc/security/zoneminder/patches: patch-src_zm__event.cpp
            patch-src_zm__monitor.cpp
Added Files:
        pkgsrc/security/zoneminder/patches: patch-src_zm__image.cpp
            patch-src_zm__time.h

Log Message:
security/zoneminder: Patch mismatches between format specifier and types

Variously the issues are time_t, size_t, suseconds_t.

With this, there are no format warnings on amd64 or i386.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 pkgsrc/security/zoneminder/distinfo
cvs rdiff -u -r1.6 -r1.7 \
    pkgsrc/security/zoneminder/patches/patch-src_zm__event.cpp
cvs rdiff -u -r0 -r1.3 \
    pkgsrc/security/zoneminder/patches/patch-src_zm__image.cpp
cvs rdiff -u -r1.4 -r1.5 \
    pkgsrc/security/zoneminder/patches/patch-src_zm__monitor.cpp
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/security/zoneminder/patches/patch-src_zm__time.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/security/zoneminder/distinfo
diff -u pkgsrc/security/zoneminder/distinfo:1.27 pkgsrc/security/zoneminder/distinfo:1.28
--- pkgsrc/security/zoneminder/distinfo:1.27    Tue Jan  6 17:51:37 2026
+++ pkgsrc/security/zoneminder/distinfo Wed Jan  7 01:03:59 2026
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.27 2026/01/06 17:51:37 gdt Exp $
+$NetBSD: distinfo,v 1.28 2026/01/07 01:03:59 gdt Exp $
 
 BLAKE2s (FriendsOfCake-crud-14292374ccf1328f2d5db20897bd06f99ba4d938.tar.gz) = 8877bf6718ecfe3cba2515629418fe5addc60cf8ce4650526b39db6a234922ad
 SHA512 (FriendsOfCake-crud-14292374ccf1328f2d5db20897bd06f99ba4d938.tar.gz) = 
da58528686baf05385ad08079f965bce10eba6d599133ab773e9ab1f9e4b7d82cf5431b4b773317b90effb16e0b026a029bdfabe08a9ef1a5e9b94e7a1c2ea9e
@@ -18,11 +18,16 @@ SHA1 (patch-scripts_ZoneMinder_lib_ZoneM
 SHA1 (patch-scripts_ZoneMinder_lib_ZoneMinder_Memory_Shared.pm) = b3de55618915fad3d9263954db71270c800ad6f1
 SHA1 (patch-scripts_zm_in) = a05727261bb8be6b707e9a14ae4ff52ea3770d51
 SHA1 (patch-scripts_zmpkg_pl_in) = eb3166ae3cd9bb0ce1b828b64722506aa4e82368
-SHA1 (patch-src_zm__event.cpp) = 2713e583bb0c5be1764cdbca77531d11725b0034
+SHA1 (patch-src_zm__event.cpp) = a965a93a8e531430f79432976f7f809a8e8296bf
 SHA1 (patch-src_zm__eventstream.cpp) = d2134edf09f142a6a545ca36d3263b13defcadd6
-SHA1 (patch-src_zm__monitor.cpp) = ac6eb821d5d72455b46165e74ea1d321faf9e431
+SHA1 (patch-src_zm__image.cpp) = ea74fcef9220293466835d0a4079f6aa5ae2aa75
+SHA1 (patch-src_zm__monitor.cpp) = 7ebc55e9b3b23590541505b7641beaed61b9c56a
 SHA1 (patch-src_zm__packet.h) = 96951004741f3d21434d3ca981f6214c07f77c88
+SHA1 (patch-src_zm__packetqueue.cpp) = b04e72880d428d3f22a9910c249854f31651240f
+SHA1 (patch-src_zm__regexp.cpp) = b8eede97a7b7d0a58556604fe8a38bd825c230ab
 SHA1 (patch-src_zm__rtp__source.cpp) = 9335686e0b353cc50eac51704546527bee5c180b
+SHA1 (patch-src_zm__rtsp__server__fifo__source.cpp) = ece9083fc4cb4ade8e97c2f46307db34fbdb1c2f
+SHA1 (patch-src_zm__time.h) = b52f3bf40eb4dca550bc880e5c41227999269590
 SHA1 (patch-src_zm__utils.cpp) = e16ffd3f41bd05a32c80142e7246307df12801a8
 SHA1 (patch-src_zm_comms_h) = 33577ab0eac62eadc415fe6fb970b82eb473c8e7
 SHA1 (patch-src_zm_logger_cpp) = 3428e80f3e442a3ada147d3d4145564f6e949760

Index: pkgsrc/security/zoneminder/patches/patch-src_zm__event.cpp
diff -u pkgsrc/security/zoneminder/patches/patch-src_zm__event.cpp:1.6 pkgsrc/security/zoneminder/patches/patch-src_zm__event.cpp:1.7
--- pkgsrc/security/zoneminder/patches/patch-src_zm__event.cpp:1.6      Tue Jan  6 17:51:37 2026
+++ pkgsrc/security/zoneminder/patches/patch-src_zm__event.cpp  Wed Jan  7 01:03:59 2026
@@ -1,4 +1,4 @@
-$NetBSD: patch-src_zm__event.cpp,v 1.6 2026/01/06 17:51:37 gdt Exp $
+$NetBSD: patch-src_zm__event.cpp,v 1.7 2026/01/07 01:03:59 gdt Exp $
 
 zoneminder uses %ld for time_t, which is troublesome on NetBSD arm and
 presumably i386.  (Note that there are multiple patch files for the
@@ -12,7 +12,19 @@ Avoid sendfile code when sendfile doesn'
 
 --- src/zm_event.cpp.orig      2026-01-06 13:05:00.000000000 +0000
 +++ src/zm_event.cpp
-@@ -116,10 +116,10 @@ Event::Event(
+@@ -93,8 +93,9 @@ Event::Event(
+     localtime_r(&now.tv_sec, &tm_info);
+     strftime(buffer_now, 26, "%Y:%m:%d %H:%M:%S", &tm_info);
+ 
+-    Error("StartDateTime in the future starttime %ld.%06ld >? now %ld.%06ld difference %" PRIi64 "\nstarttime: %s\nnow: %s",
+-          start_time.tv_sec, start_time.tv_usec, now.tv_sec, now.tv_usec,
++    Error("StartDateTime in the future starttime %jd.%06ld >? now %jd.%06ld difference %" PRIi64 "\nstarttime: %s\nnow: %s",
++          static_cast<intmax_t>(start_time.tv_sec), static_cast<long>(start_time.tv_usec),
++          static_cast<intmax_t>(now.tv_sec), static_cast<long>(now.tv_usec),
+           static_cast<int64>(now.tv_sec - start_time.tv_sec),
+           buffer, buffer_now);
+     start_time = now;
+@@ -116,10 +117,10 @@ Event::Event(
        "INSERT INTO `Events` "
        "( `MonitorId`, `StorageId`, `Name`, `StartDateTime`, `Width`, `Height`, `Cause`, `Notes`, `StateId`, `Orientation`, `Videoed`, `DefaultVideo`, `SaveJPEGs`, `Scheme` )"
        " VALUES "
@@ -25,7 +37,7 @@ Avoid sendfile code when sendfile doesn'
        monitor->Width(),
        monitor->Height(),
        cause.c_str(),
-@@ -374,12 +374,12 @@ void Event::WriteDbFrames() {
+@@ -374,12 +375,12 @@ void Event::WriteDbFrames() {
    while (frame_data.size()) {
      Frame *frame = frame_data.front();
      frame_data.pop();
@@ -40,7 +52,7 @@ Avoid sendfile code when sendfile doesn'
          frame->delta.fsec,
          frame->score);
      if (config.record_event_stats and frame->zone_stats.size()) {
-@@ -527,9 +527,9 @@ void Event::AddFrame(const std::shared_p
+@@ -527,9 +528,9 @@ void Event::AddFrame(const std::shared_p
  
        char sql[ZM_SQL_MED_BUFSIZ];
        snprintf(sql, sizeof(sql), 

Index: pkgsrc/security/zoneminder/patches/patch-src_zm__monitor.cpp
diff -u pkgsrc/security/zoneminder/patches/patch-src_zm__monitor.cpp:1.4 pkgsrc/security/zoneminder/patches/patch-src_zm__monitor.cpp:1.5
--- pkgsrc/security/zoneminder/patches/patch-src_zm__monitor.cpp:1.4    Sun Dec  1 13:49:48 2024
+++ pkgsrc/security/zoneminder/patches/patch-src_zm__monitor.cpp        Wed Jan  7 01:03:59 2026
@@ -1,4 +1,4 @@
-$NetBSD: patch-src_zm__monitor.cpp,v 1.4 2024/12/01 13:49:48 gdt Exp $
+$NetBSD: patch-src_zm__monitor.cpp,v 1.5 2026/01/07 01:03:59 gdt Exp $
 
 The shmat() error return is (apparently) -1 as a pointer.  Some compilers
 (E.g. clang on MacOS) refuse to consider testing if a pointer is less than
@@ -7,8 +7,17 @@ particular values that might make sense.
 
 Avoid type error (suseconds_t is not long).  To be addressed upstream once caught up.
 
---- src/zm_monitor.cpp.orig    2023-02-23 21:44:01.000000000 +0000
+--- src/zm_monitor.cpp.orig    2026-01-06 13:05:00.000000000 +0000
 +++ src/zm_monitor.cpp
+@@ -187,7 +187,7 @@ bool Monitor::MonitorLink::connect() {
+       disconnect();
+       return false;
+     } else if (map_stat.st_size < mem_size) {
+-      Error("Got unexpected memory map file size %ld, expected %jd", static_cast<intmax_t>(map_stat.st_size), static_cast<intmax_t>(mem_size));
++      Error("Got unexpected memory map file size %jd, expected %jd", static_cast<intmax_t>(map_stat.st_size), static_cast<intmax_t>(mem_size));
+       disconnect();
+       return false;
+     }
 @@ -200,7 +200,7 @@ bool Monitor::MonitorLink::connect() {
      }
  #else // ZM_MEM_MAPPED
@@ -27,7 +36,68 @@ Avoid type error (suseconds_t is not lon
        msync(mem_ptr, mem_size, MS_ASYNC);
        munmap(mem_ptr, mem_size);
      }
-@@ -2649,7 +2649,7 @@ void Monitor::TimestampImage(Image *ts_i
+@@ -943,41 +943,41 @@ bool Monitor::connect() {
+     if (purpose == CAPTURE) {
+       // Allocate the size
+       if (ftruncate(map_fd, mem_size) < 0) {
+-        Error("Can't extend memory map file %s to %jd bytes: %s", mem_file.c_str(), mem_size, strerror(errno));
++        Error("Can't extend memory map file %s to %jd bytes: %s", mem_file.c_str(), static_cast<intmax_t>(mem_size), strerror(errno));
+         close(map_fd);
+         map_fd = -1;
+         return false;
+       }
+     } else if (map_stat.st_size == 0) {
+-      Error("Got empty memory map file size %ld, is the zmc process for this monitor running?", map_stat.st_size);
++      Error("Got empty memory map file size %jd, is the zmc process for this monitor running?", static_cast<intmax_t>(map_stat.st_size));
+       close(map_fd);
+       map_fd = -1;
+       return false;
+     } else {
+-      Error("Got unexpected memory map file size %ld, expected %jd", map_stat.st_size, mem_size);
++      Error("Got unexpected memory map file size %jd, expected %jd", static_cast<intmax_t>(map_stat.st_size), static_cast<intmax_t>(mem_size));
+       close(map_fd);
+       map_fd = -1;
+       return false;
+     }
+   }  // end if map_stat.st_size != mem_size
+ 
+-  Debug(3, "MMap file size is %ld", map_stat.st_size);
++  Debug(3, "MMap file size is %jd", static_cast<intmax_t>(map_stat.st_size));
+ #ifdef MAP_LOCKED
+   mem_ptr = (unsigned char *)mmap(nullptr, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_LOCKED, map_fd, 0);
+   if (mem_ptr == MAP_FAILED) {
+     if (errno == EAGAIN) {
+-      Debug(1, "Unable to map file %s (%jd bytes) to locked memory, trying unlocked", mem_file.c_str(), mem_size);
++      Debug(1, "Unable to map file %s (%jd bytes) to locked memory, trying unlocked", mem_file.c_str(), static_cast<intmax_t>(mem_size));
+ #endif
+       mem_ptr = (unsigned char *)mmap(nullptr, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED, map_fd, 0);
+-      Debug(1, "Mapped file %s (%jd bytes) to unlocked memory", mem_file.c_str(), mem_size);
++      Debug(1, "Mapped file %s (%jd bytes) to unlocked memory", mem_file.c_str(), static_cast<intmax_t>(mem_size));
+ #ifdef MAP_LOCKED
+     } else {
+-      Error("Unable to map file %s (%jd bytes) to locked memory (%s)", mem_file.c_str(), mem_size, strerror(errno));
++      Error("Unable to map file %s (%jd bytes) to locked memory (%s)", mem_file.c_str(), static_cast<intmax_t>(mem_size), strerror(errno));
+     }
+   }
+ #endif
+   if ((mem_ptr == MAP_FAILED) or (mem_ptr == nullptr)) {
+-    Error("Can't map file %s (%jd bytes) to memory: %s(%d)", mem_file.c_str(), mem_size, strerror(errno), errno);
++    Error("Can't map file %s (%jd bytes) to memory: %s(%d)", mem_file.c_str(), static_cast<intmax_t>(mem_size), strerror(errno), errno);
+     close(map_fd);
+     map_fd = -1;
+     mem_ptr = nullptr;
+@@ -2625,8 +2625,8 @@ bool Monitor::Decode() {
+   gettimeofday(&now, nullptr);
+   shared_data->last_write_time = now.tv_sec;
+   if (now.tv_sec - packet->timestamp.tv_sec > ZM_WATCH_MAX_DELAY) {
+-    Warning("Decoding is not keeping up. We are %ld seconds behind capture.",
+-        now.tv_sec - packet->timestamp.tv_sec);
++    Warning("Decoding is not keeping up. We are %jd seconds behind capture.",
++    static_cast<intmax_t>(now.tv_sec - packet->timestamp.tv_sec));
+   }
+ 
+   packetqueue.unlock(packet_lock);
+@@ -2657,7 +2657,7 @@ void Monitor::TimestampImage(Image *ts_i
            found_macro = true;
            break;
          case 'f' :

Added files:

Index: pkgsrc/security/zoneminder/patches/patch-src_zm__image.cpp
diff -u /dev/null pkgsrc/security/zoneminder/patches/patch-src_zm__image.cpp:1.3
--- /dev/null   Wed Jan  7 01:03:59 2026
+++ pkgsrc/security/zoneminder/patches/patch-src_zm__image.cpp  Wed Jan  7 01:03:59 2026
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_zm__image.cpp,v 1.3 2026/01/07 01:03:59 gdt Exp $
+
+--- src/zm_image.cpp.orig      2026-01-07 00:13:06.515742101 +0000
++++ src/zm_image.cpp
+@@ -917,7 +917,7 @@ bool Image::ReadRaw(const char *filename
+ 
+   if ( (unsigned int)statbuf.st_size != size ) {
+     fclose(infile);
+-    Error("Raw file size mismatch, expected %d bytes, found %ld", size, statbuf.st_size);
++    Error("Raw file size mismatch, expected %d bytes, found %jd", size, static_cast<intmax_t>(statbuf.st_size));
+     return false;
+   }
+ 

Index: pkgsrc/security/zoneminder/patches/patch-src_zm__time.h
diff -u /dev/null pkgsrc/security/zoneminder/patches/patch-src_zm__time.h:1.1
--- /dev/null   Wed Jan  7 01:03:59 2026
+++ pkgsrc/security/zoneminder/patches/patch-src_zm__time.h     Wed Jan  7 01:03:59 2026
@@ -0,0 +1,20 @@
+$NetBSD: patch-src_zm__time.h,v 1.1 2026/01/07 01:03:59 gdt Exp $
+
+--- src/zm_time.h.orig 2026-01-06 23:42:08.960420562 +0000
++++ src/zm_time.h
+@@ -155,13 +155,13 @@ inline struct timeval tvCheck( struct ti
+ {
+   if ( t.tv_usec >= USEC_PER_SEC )
+   {
+-    Warning( "Timestamp too large %ld.%ld\n", t.tv_sec, (long int) t.tv_usec );
++    Warning( "Timestamp too large %jd.%ld\n", (intmax_t)t.tv_sec, (long int) t.tv_usec );
+     t.tv_sec += t.tv_usec / USEC_PER_SEC;
+     t.tv_usec %= USEC_PER_SEC;
+   }
+   else if ( t.tv_usec < 0 )
+   {
+-    Warning( "Got negative timestamp %ld.%ld\n", t.tv_sec, (long int)t.tv_usec );
++    Warning( "Got negative timestamp %jd.%ld\n", (intmax_t)t.tv_sec, (long int)t.tv_usec );
+     t.tv_usec = 0;
+   }
+   return( t );



Home | Main Index | Thread Index | Old Index