From fa05c5f9b19cad1e2c437c84a593036f7d8c2155 Mon Sep 17 00:00:00 2001
From: Diederik de Haas <didi.debian@cknow.org>
Date: Thu, 5 Jan 2023 16:11:25 +0100
Subject: [PATCH 1/7] ci: Add Salsa's default CI pipeline

---
 debian/changelog    | 3 +++
 debian/salsa-ci.yml | 3 +++
 2 files changed, 6 insertions(+)
 create mode 100644 debian/salsa-ci.yml

diff --git a/debian/changelog b/debian/changelog
index c8f3587..a0625d3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,9 @@ rrdtool (1.8.0-1) UNRELEASED; urgency=medium
   * Remove constraints unnecessary since buster:
     + Build-Depends: Drop versioned constraint on perl and tcl-dev.
 
+  [ Diederik de Haas ]
+  * Add Salsa's default CI pipeline
+
  -- Jean-Michel Vourgère <nirgal@debian.org>  Mon, 21 Mar 2022 10:55:32 +0100
 
 rrdtool (1.7.2-4) unstable; urgency=medium
diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml
new file mode 100644
index 0000000..8424db4
--- /dev/null
+++ b/debian/salsa-ci.yml
@@ -0,0 +1,3 @@
+---
+include:
+  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/recipes/debian.yml
-- 
GitLab


From 5e48ed9f7c6111f2941b036aa51a34dae1894b7e Mon Sep 17 00:00:00 2001
From: Diederik de Haas <didi.debian@cknow.org>
Date: Tue, 4 Apr 2023 20:15:13 +0200
Subject: [PATCH 2/7] ci: Disable test-crossbuild-arm64

There are several issues preventing a successful arm64 crossbuild as
also indicated in rrdtool's tracker page, so disable this job for now.
---
 debian/changelog    | 1 +
 debian/salsa-ci.yml | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index a0625d3..286985b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,7 @@ rrdtool (1.8.0-1) UNRELEASED; urgency=medium
 
   [ Diederik de Haas ]
   * Add Salsa's default CI pipeline
+    - Disable test-crossbuild-arm64
 
  -- Jean-Michel Vourgère <nirgal@debian.org>  Mon, 21 Mar 2022 10:55:32 +0100
 
diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml
index 8424db4..74d9e54 100644
--- a/debian/salsa-ci.yml
+++ b/debian/salsa-ci.yml
@@ -1,3 +1,11 @@
 ---
 include:
   - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/recipes/debian.yml
+
+variables:
+  # Disable 'test-crossbuild-arm64' until the following issues are resolved:
+  # The following packages have unmet dependencies:
+  # builddeps:.:arm64 : Depends: dh-lua:arm64 but it is not installable
+  #                     Depends: gem2deb:arm64 but it is not going to be installed
+  #                     Depends: perl:arm64 but it is not going to be installed
+  SALSA_CI_DISABLE_CROSSBUILD_ARM64: 1
-- 
GitLab


From c904ac11e9e534fb4a9379042549fb7129d333b0 Mon Sep 17 00:00:00 2001
From: Diederik de Haas <didi.debian@cknow.org>
Date: Tue, 4 Apr 2023 19:46:56 +0200
Subject: [PATCH 3/7] d/control: Replace lsb-base dependency with
 sysvinit-utils

The lsb-base package is now a transitional package to sysvinit-utils, so
update the dependency of rrdcached.
---
 debian/changelog | 1 +
 debian/control   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 286985b..0e03d97 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,7 @@ rrdtool (1.8.0-1) UNRELEASED; urgency=medium
   [ Diederik de Haas ]
   * Add Salsa's default CI pipeline
     - Disable test-crossbuild-arm64
+  * d/control: Replace lsb-base dependency with sysvinit-utils
 
  -- Jean-Michel Vourgère <nirgal@debian.org>  Mon, 21 Mar 2022 10:55:32 +0100
 
diff --git a/debian/control b/debian/control
index efa753a..95cadfe 100644
--- a/debian/control
+++ b/debian/control
@@ -47,7 +47,7 @@ Description: time-series data storage and display system (programs)
 Package: rrdcached
 Architecture: kfreebsd-any linux-any
 Pre-Depends: ${misc:Pre-Depends}
-Depends: lsb-base, ${misc:Depends}, ${shlibs:Depends}
+Depends: sysvinit-utils (>= 3.05-4), ${misc:Depends}, ${shlibs:Depends}
 Description: data caching daemon for RRDtool
  RRDCacheD is a daemon that receives updates to existing RRD files, accumulates
  them and, if enough have been received or a defined time has passed, writes
-- 
GitLab


From 03afa3c242b56a30d0d2b60608dc304ee587487e Mon Sep 17 00:00:00 2001
From: Diederik de Haas <didi.debian@cknow.org>
Date: Tue, 4 Apr 2023 19:11:37 +0200
Subject: [PATCH 4/7] d/patches: Add "acinclude.m4: Include <stdlib.h> when
 using exit" patch

---
 debian/changelog                              |  2 +
 ....m4-Include-stdlib.h-when-using-exit.patch | 40 +++++++++++++++++++
 debian/patches/series                         |  1 +
 3 files changed, 43 insertions(+)
 create mode 100644 debian/patches/acinclude.m4-Include-stdlib.h-when-using-exit.patch

diff --git a/debian/changelog b/debian/changelog
index 0e03d97..9c24257 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,8 @@ rrdtool (1.8.0-1) UNRELEASED; urgency=medium
   * Add Salsa's default CI pipeline
     - Disable test-crossbuild-arm64
   * d/control: Replace lsb-base dependency with sysvinit-utils
+  * Import upstream patches:
+    - "acinclude.m4: Include <stdlib.h> when using exit"
 
  -- Jean-Michel Vourgère <nirgal@debian.org>  Mon, 21 Mar 2022 10:55:32 +0100
 
diff --git a/debian/patches/acinclude.m4-Include-stdlib.h-when-using-exit.patch b/debian/patches/acinclude.m4-Include-stdlib.h-when-using-exit.patch
new file mode 100644
index 0000000..d099981
--- /dev/null
+++ b/debian/patches/acinclude.m4-Include-stdlib.h-when-using-exit.patch
@@ -0,0 +1,40 @@
+From: Ryan Schmidt <git@ryandesign.com>
+Date: Sun, 20 Mar 2022 16:29:10 -0500
+Subject: acinclude.m4: Include <stdlib.h> when using exit
+Origin: https://github.com/oetiker/rrdtool-1.x/commit/f3334fcbde0a77aa48938ba38602bff91c09cf85
+
+Fixes:
+
+conftest.c:124:33: error: implicitly declaring library function 'exit'
+with type 'void (int) __attribute__((noreturn))'
+---
+ m4/acinclude.m4 | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
+index d9d9eb25..0d6fbf5d 100644
+--- a/m4/acinclude.m4
++++ b/m4/acinclude.m4
+@@ -582,7 +582,8 @@ AC_DEFUN([GC_TIMEZONE], [
+         AC_REQUIRE([AC_STRUCT_TM])
+         AC_CACHE_CHECK([tm_gmtoff in struct tm], gq_cv_have_tm_gmtoff,
+                 gq_cv_have_tm_gmtoff=no
+-                AC_TRY_COMPILE([#include <time.h>
++                AC_TRY_COMPILE([#include <stdlib.h>
++                                #include <time.h>
+                                 #include <$ac_cv_struct_tm>
+                                 ],
+                                [struct tm t;
+@@ -595,7 +596,8 @@ AC_DEFUN([GC_TIMEZONE], [
+ 
+         AC_CACHE_CHECK([__tm_gmtoff in struct tm], gq_cv_have___tm_gmtoff,
+                 gq_cv_have___tm_gmtoff=no
+-                AC_TRY_COMPILE([#include <time.h>
++                AC_TRY_COMPILE([#include <stdlib.h>
++                                #include <time.h>
+                                 #include <$ac_cv_struct_tm>
+                                 ],
+                                [struct tm t;
+-- 
+2.40.0
+
diff --git a/debian/patches/series b/debian/patches/series
index 7b90e1d..e3a6fe1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 no-rpath-for-ruby
 breaks-long-man-lines
 translations
+acinclude.m4-Include-stdlib.h-when-using-exit.patch
-- 
GitLab


From 4dbd97ebbfb25de30e289b883544ca31737404c5 Mon Sep 17 00:00:00 2001
From: Diederik de Haas <didi.debian@cknow.org>
Date: Tue, 4 Apr 2023 19:17:59 +0200
Subject: [PATCH 5/7] d/patches: Add "Update Version and Copyright year in git
 files" patch

---
 debian/changelog                              |   1 +
 ...sion-and-Copyright-year-in-git-files.patch | 629 ++++++++++++++++++
 debian/patches/series                         |   1 +
 3 files changed, 631 insertions(+)
 create mode 100644 debian/patches/Update-Version-and-Copyright-year-in-git-files.patch

diff --git a/debian/changelog b/debian/changelog
index 9c24257..01ea13b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,7 @@ rrdtool (1.8.0-1) UNRELEASED; urgency=medium
   * d/control: Replace lsb-base dependency with sysvinit-utils
   * Import upstream patches:
     - "acinclude.m4: Include <stdlib.h> when using exit"
+    - "Update Version and Copyright year in git files"
 
  -- Jean-Michel Vourgère <nirgal@debian.org>  Mon, 21 Mar 2022 10:55:32 +0100
 
diff --git a/debian/patches/Update-Version-and-Copyright-year-in-git-files.patch b/debian/patches/Update-Version-and-Copyright-year-in-git-files.patch
new file mode 100644
index 0000000..55bd962
--- /dev/null
+++ b/debian/patches/Update-Version-and-Copyright-year-in-git-files.patch
@@ -0,0 +1,629 @@
+From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= <c72578@yahoo.de>
+Date: Tue, 22 Mar 2022 05:41:40 +0100
+Subject: Update Version and Copyright year in git files
+Origin: https://github.com/oetiker/rrdtool-1.x/commit/e839e17c9d61f6fdc40f2f0d5a828e2f19614b0f
+
+This commit is based on running the first part of the rrdtool-release
+script (before ./bootstrap).
+
+- Part of #1163
+---
+ bindings/perl-piped/RRDp.pm  |  2 +-
+ bindings/perl-shared/RRDs.pm |  2 +-
+ doc/rrdbuild.pod             | 10 +++++-----
+ rrdtool.spec                 |  2 +-
+ src/pngsize.c                |  2 +-
+ src/rrd.h                    |  6 +++---
+ src/rrd_cgi.c                |  2 +-
+ src/rrd_create.c             |  2 +-
+ src/rrd_create.h             |  2 +-
+ src/rrd_datalang.c           |  2 +-
+ src/rrd_diff.c               |  2 +-
+ src/rrd_dump.c               |  2 +-
+ src/rrd_error.c              |  2 +-
+ src/rrd_fetch.c              |  2 +-
+ src/rrd_first.c              |  2 +-
+ src/rrd_format.c             |  2 +-
+ src/rrd_format.h             |  2 +-
+ src/rrd_gfx.c                |  2 +-
+ src/rrd_graph.c              |  2 +-
+ src/rrd_graph_helper.c       |  2 +-
+ src/rrd_hw.c                 |  2 +-
+ src/rrd_hw.h                 |  2 +-
+ src/rrd_i18n.h               |  2 +-
+ src/rrd_info.c               |  2 +-
+ src/rrd_is_thread_safe.h     |  2 +-
+ src/rrd_last.c               |  2 +-
+ src/rrd_lastupdate.c         |  2 +-
+ src/rrd_modify.c             |  2 +-
+ src/rrd_modify.h             |  2 +-
+ src/rrd_open.c               |  2 +-
+ src/rrd_resize.c             |  2 +-
+ src/rrd_restore.c            |  2 +-
+ src/rrd_restore.h            |  2 +-
+ src/rrd_rpncalc.c            |  2 +-
+ src/rrd_rpncalc.h            |  2 +-
+ src/rrd_snprintf.c           |  2 +-
+ src/rrd_thread_safe.c        |  2 +-
+ src/rrd_thread_safe_nt.c     |  2 +-
+ src/rrd_tool.c               |  2 +-
+ src/rrd_tool.h               |  2 +-
+ src/rrd_tune.c               |  2 +-
+ src/rrd_update.c             |  2 +-
+ src/rrd_update.h             |  2 +-
+ src/rrd_version.c            |  2 +-
+ src/rrd_xport.c              |  2 +-
+ src/rrd_xport.h              |  2 +-
+ src/rrdupdate.c              |  2 +-
+ 47 files changed, 53 insertions(+), 53 deletions(-)
+
+diff --git a/bindings/perl-piped/RRDp.pm b/bindings/perl-piped/RRDp.pm
+index 6ad15cc6..edf87396 100644
+--- a/bindings/perl-piped/RRDp.pm
++++ b/bindings/perl-piped/RRDp.pm
+@@ -124,7 +124,7 @@ sub cmd (@);
+ sub end ();
+ sub read ();
+ 
+-$VERSION=1.7002;
++$VERSION=1.8000;
+ 
+ sub start ($){
+   croak "rrdtool is already running"
+diff --git a/bindings/perl-shared/RRDs.pm b/bindings/perl-shared/RRDs.pm
+index 25e95ce8..4a8df44a 100644
+--- a/bindings/perl-shared/RRDs.pm
++++ b/bindings/perl-shared/RRDs.pm
+@@ -7,7 +7,7 @@ use vars qw(@ISA $VERSION);
+ 
+ require DynaLoader;
+ 
+-$VERSION=1.7002;
++$VERSION=1.8000;
+ 
+ bootstrap RRDs $VERSION;
+ 
+diff --git a/doc/rrdbuild.pod b/doc/rrdbuild.pod
+index fdbb535d..ad3a60d7 100644
+--- a/doc/rrdbuild.pod
++++ b/doc/rrdbuild.pod
+@@ -41,7 +41,7 @@ Where you want to install the software.
+ Once you have decided. Save the two locations into environment variables.
+ 
+  BUILD_DIR=/tmp/rrdbuild
+- INSTALL_DIR=/opt/rrdtool-1.7.2
++ INSTALL_DIR=/opt/rrdtool-1.8.0
+ 
+ 
+ If your F</tmp> is mounted with the option noexec (RHEL seems to do that) you have to choose
+@@ -55,9 +55,9 @@ Now make sure the BUILD_DIR exists and go there:
+ Lets first assume you already have all the necessary libraries
+ pre-installed.
+ 
+- wget https://oss.oetiker.ch/rrdtool/pub/rrdtool-1.7.2.tar.gz
+- gunzip -c rrdtool-1.7.2.tar.gz | tar xf -
+- cd rrdtool-1.7.2
++ wget https://oss.oetiker.ch/rrdtool/pub/rrdtool-1.8.0.tar.gz
++ gunzip -c rrdtool-1.8.0.tar.gz | tar xf -
++ cd rrdtool-1.8.0
+  ./configure --prefix=$INSTALL_DIR && make && make install
+ 
+ Ok, this was very optimistic. This try will probably have ended with
+@@ -345,7 +345,7 @@ because it seems that a fair number of people have ill configured python and
+ tcl setups that would prevent RRDtool from building if they are included in
+ their current state.
+ 
+- cd $BUILD_DIR/rrdtool-1.7.2
++ cd $BUILD_DIR/rrdtool-1.8.0
+  ./configure --prefix=$INSTALL_DIR --disable-tcl --disable-python
+  $MAKE clean
+  $MAKE
+diff --git a/rrdtool.spec b/rrdtool.spec
+index 7625d8a6..641260fd 100644
+--- a/rrdtool.spec
++++ b/rrdtool.spec
+@@ -11,7 +11,7 @@
+ 
+ Summary: Round Robin Database Tool to store and display time-series data
+ Name: rrdtool
+-Version: 1.7.2
++Version: 1.8.0
+ Release: 1%{?dist}
+ License: GPLv2+ with exceptions
+ Group: Applications/Databases
+diff --git a/src/pngsize.c b/src/pngsize.c
+index 2781c5e7..b4d8aa24 100644
+--- a/src/pngsize.c
++++ b/src/pngsize.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * pngsize.c  determine the size of a PNG image
+  *****************************************************************************/
+diff --git a/src/rrd.h b/src/rrd.h
+index 8439413c..30ac89c6 100644
+--- a/src/rrd.h
++++ b/src/rrd.h
+@@ -2,7 +2,7 @@
+ #define RRDLIB_H_4FD7D37D56A448C392AF46508C56D3CC
+ 
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrdlib.h   Public header file for librrd
+  *****************************************************************************
+@@ -445,9 +445,9 @@ extern    "C" {
+ /*
+  * The following functions are _internal_ functions needed to read the raw RRD
+  * files. Since they are _internal_ they may change with the file format and
+- * will be replaced with a more general interface in RRDtool 1.7.2 Don't use
++ * will be replaced with a more general interface in RRDtool 1.8.0 Don't use
+  * these functions unless you have good reasons to do so. If you do use these
+- * functions you will have to adapt your code for RRDtool 1.7.2
++ * functions you will have to adapt your code for RRDtool 1.8.0
+  *
+  * To enable the deprecated functions define `RRD_EXPORT_DEPRECATED' before
+  * including <rrd_test.h>. You have been warned! If you come back to the
+diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c
+index e7eb5be5..db293e3c 100644
+--- a/src/rrd_cgi.c
++++ b/src/rrd_cgi.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_cgi.c  RRD Web Page Generator
+  *****************************************************************************/
+diff --git a/src/rrd_create.c b/src/rrd_create.c
+index 0cb5b78c..d0db8bbe 100644
+--- a/src/rrd_create.c
++++ b/src/rrd_create.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_create.c  creates new rrds
+  *****************************************************************************/
+diff --git a/src/rrd_create.h b/src/rrd_create.h
+index 8bd642e6..b70e0a39 100644
+--- a/src/rrd_create.h
++++ b/src/rrd_create.h
+@@ -1,5 +1,5 @@
+ /****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  ****************************************************************************
+  * rrd_create.h
+  ****************************************************************************/
+diff --git a/src/rrd_datalang.c b/src/rrd_datalang.c
+index 09e2d1dd..3a36a186 100644
+--- a/src/rrd_datalang.c
++++ b/src/rrd_datalang.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_datalang  A system for passing named and typed parameters between
+  *               the different parts of rrdtool
+diff --git a/src/rrd_diff.c b/src/rrd_diff.c
+index 2b229316..1c31755d 100644
+--- a/src/rrd_diff.c
++++ b/src/rrd_diff.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  * This code is stolen from rateup (mrtg-2.x) by Dave Rand
+  *****************************************************************************
+  * diff calculate the difference between two very long integers available as
+diff --git a/src/rrd_dump.c b/src/rrd_dump.c
+index 4f616fc1..c61d6457 100644
+--- a/src/rrd_dump.c
++++ b/src/rrd_dump.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_dump  Display a RRD
+  *****************************************************************************
+diff --git a/src/rrd_error.c b/src/rrd_error.c
+index c3a644e2..6013a7f8 100644
+--- a/src/rrd_error.c
++++ b/src/rrd_error.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_error.c   Common Header File
+  *****************************************************************************
+diff --git a/src/rrd_fetch.c b/src/rrd_fetch.c
+index aa05cd0d..c739bfc4 100644
+--- a/src/rrd_fetch.c
++++ b/src/rrd_fetch.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_fetch.c  read date from an rrd to use for further processing
+  *****************************************************************************
+diff --git a/src/rrd_first.c b/src/rrd_first.c
+index 62795245..0e93397c 100644
+--- a/src/rrd_first.c
++++ b/src/rrd_first.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_first Return
+  *****************************************************************************
+diff --git a/src/rrd_format.c b/src/rrd_format.c
+index 025ca190..38a4000f 100644
+--- a/src/rrd_format.c
++++ b/src/rrd_format.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_format.c  RRD Database Format helper functions
+  *****************************************************************************/
+diff --git a/src/rrd_format.h b/src/rrd_format.h
+index dac7d38c..d2057844 100644
+--- a/src/rrd_format.h
++++ b/src/rrd_format.h
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_format.h  RRD Database Format header
+  *****************************************************************************/
+diff --git a/src/rrd_gfx.c b/src/rrd_gfx.c
+index 7fed02f4..5482688b 100644
+--- a/src/rrd_gfx.c
++++ b/src/rrd_gfx.c
+@@ -1,5 +1,5 @@
+ /****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  ****************************************************************************
+  * rrd_gfx.c  graphics wrapper for rrdtool
+   **************************************************************************/
+diff --git a/src/rrd_graph.c b/src/rrd_graph.c
+index c0ce6d46..b9aa3e2a 100644
+--- a/src/rrd_graph.c
++++ b/src/rrd_graph.c
+@@ -1,5 +1,5 @@
+ /****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  ****************************************************************************
+  * rrd__graph.c  produce graphs from data in rrdfiles
+  ****************************************************************************/
+diff --git a/src/rrd_graph_helper.c b/src/rrd_graph_helper.c
+index f88893b4..99cdefa6 100644
+--- a/src/rrd_graph_helper.c
++++ b/src/rrd_graph_helper.c
+@@ -1,5 +1,5 @@
+ /****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  ****************************************************************************
+  * rrd_graph_helper.c  commandline parser functions
+  *                     this code initially written by Alex van den Bogaerdt
+diff --git a/src/rrd_hw.c b/src/rrd_hw.c
+index df3e7218..63c7c416 100644
+--- a/src/rrd_hw.c
++++ b/src/rrd_hw.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_hw.c : Support for Holt-Winters Smoothing/ Aberrant Behavior Detection
+  *****************************************************************************
+diff --git a/src/rrd_hw.h b/src/rrd_hw.h
+index 3c01d894..dba30480 100644
+--- a/src/rrd_hw.h
++++ b/src/rrd_hw.h
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_hw.h : Support for Holt-Winters Smoothing/ Aberrant Behavior Detection
+  *****************************************************************************/
+diff --git a/src/rrd_i18n.h b/src/rrd_i18n.h
+index d2e17628..a5dd1cec 100644
+--- a/src/rrd_i18n.h
++++ b/src/rrd_i18n.h
+@@ -2,7 +2,7 @@
+ #define RRD_I18N_H_E9D8F44A32654DF9B92B1862D5371142
+ 
+ /*****************************************************************************
+- * RRDtool 1.7.2  Copyright by Takao Fujiwara, 2008
++ * RRDtool 1.8.0  Copyright by Takao Fujiwara, 2008
+  *****************************************************************************
+  * rrd_i18n.h   Common Header File
+  *****************************************************************************/
+diff --git a/src/rrd_info.c b/src/rrd_info.c
+index 76277e84..c0c6f68c 100644
+--- a/src/rrd_info.c
++++ b/src/rrd_info.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_info  Get Information about the configuration of an RRD
+  *****************************************************************************/
+diff --git a/src/rrd_is_thread_safe.h b/src/rrd_is_thread_safe.h
+index 74b8daa9..5fa8eb30 100644
+--- a/src/rrd_is_thread_safe.h
++++ b/src/rrd_is_thread_safe.h
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  * This file:     Copyright 2003 Peter Stamfest <peter@stamfest.at> 
+  *                             & Tobias Oetiker
+  * Distributed under the GPL
+diff --git a/src/rrd_last.c b/src/rrd_last.c
+index 2e058864..026a1e82 100644
+--- a/src/rrd_last.c
++++ b/src/rrd_last.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_last.c
+  *****************************************************************************
+diff --git a/src/rrd_lastupdate.c b/src/rrd_lastupdate.c
+index 31ab3f7f..ab30dcf6 100644
+--- a/src/rrd_lastupdate.c
++++ b/src/rrd_lastupdate.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *                Copyright by Florian Forster, 2008
+  *****************************************************************************
+  * rrd_lastupdate  Get the last datum entered for each DS
+diff --git a/src/rrd_modify.c b/src/rrd_modify.c
+index 6de79262..a2b07f64 100644
+--- a/src/rrd_modify.c
++++ b/src/rrd_modify.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_modify  Structurally modify an RRD file
+  *      (c) 2014 by Peter Stamfest and Tobi Oetiker
+diff --git a/src/rrd_modify.h b/src/rrd_modify.h
+index d78d9616..52d8789b 100644
+--- a/src/rrd_modify.h
++++ b/src/rrd_modify.h
+@@ -1,5 +1,5 @@
+ /****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  ****************************************************************************
+  * rrd_create.h
+  ****************************************************************************/
+diff --git a/src/rrd_open.c b/src/rrd_open.c
+index 00dfb8ca..ed4939a6 100644
+--- a/src/rrd_open.c
++++ b/src/rrd_open.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_open.c  Open an RRD File
+  *****************************************************************************
+diff --git a/src/rrd_resize.c b/src/rrd_resize.c
+index 44c1ee57..fb75d81f 100644
+--- a/src/rrd_resize.c
++++ b/src/rrd_resize.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_resize.c Alters size of an RRA
+  *****************************************************************************
+diff --git a/src/rrd_restore.c b/src/rrd_restore.c
+index 14b9446b..85d481e0 100644
+--- a/src/rrd_restore.c
++++ b/src/rrd_restore.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_restore.c  Contains logic to parse XML input and create an RRD file
+  * This file:
+diff --git a/src/rrd_restore.h b/src/rrd_restore.h
+index eac96da1..f52367d8 100644
+--- a/src/rrd_restore.h
++++ b/src/rrd_restore.h
+@@ -1,5 +1,5 @@
+ /****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  ****************************************************************************
+  * rrd_restore.h
+  ****************************************************************************/
+diff --git a/src/rrd_rpncalc.c b/src/rrd_rpncalc.c
+index 2b0653a2..6eef36bb 100644
+--- a/src/rrd_rpncalc.c
++++ b/src/rrd_rpncalc.c
+@@ -1,5 +1,5 @@
+ /****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  ****************************************************************************
+  * rrd_rpncalc.c  RPN calculator functions
+  ****************************************************************************/
+diff --git a/src/rrd_rpncalc.h b/src/rrd_rpncalc.h
+index 20c78b54..1503422b 100644
+--- a/src/rrd_rpncalc.h
++++ b/src/rrd_rpncalc.h
+@@ -1,5 +1,5 @@
+ /****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  ****************************************************************************
+  * rrd_rpncalc.h  RPN calculator functions
+  ****************************************************************************/
+diff --git a/src/rrd_snprintf.c b/src/rrd_snprintf.c
+index 590f3cfc..72f7d8ff 100644
+--- a/src/rrd_snprintf.c
++++ b/src/rrd_snprintf.c
+@@ -1,5 +1,5 @@
+ /****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  ****************************************************************************
+  * rrd_snprintf  
+  ****************************************************************************/
+diff --git a/src/rrd_thread_safe.c b/src/rrd_thread_safe.c
+index 2216e613..ca9483bc 100644
+--- a/src/rrd_thread_safe.c
++++ b/src/rrd_thread_safe.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  * This file:     Copyright 2003 Peter Stamfest <peter@stamfest.at> 
+  *                             & Tobias Oetiker
+  * Distributed under the GPL
+diff --git a/src/rrd_thread_safe_nt.c b/src/rrd_thread_safe_nt.c
+index 35c3923b..003fbca8 100644
+--- a/src/rrd_thread_safe_nt.c
++++ b/src/rrd_thread_safe_nt.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  * This file:     Copyright 2003 Peter Stamfest <peter@stamfest.at> 
+  *                             & Tobias Oetiker
+  * Distributed under the GPL
+diff --git a/src/rrd_tool.c b/src/rrd_tool.c
+index d598cb1d..930d0827 100644
+--- a/src/rrd_tool.c
++++ b/src/rrd_tool.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_tool.c  Startup wrapper
+  *****************************************************************************/
+diff --git a/src/rrd_tool.h b/src/rrd_tool.h
+index 44ae4e38..9fb4e4c5 100644
+--- a/src/rrd_tool.h
++++ b/src/rrd_tool.h
+@@ -2,7 +2,7 @@
+ #define RRD_TOOL_H_3853987DDF7E4709A5B5849E5A6204F4
+ 
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_tool.h   Common Header File
+  *****************************************************************************/
+diff --git a/src/rrd_tune.c b/src/rrd_tune.c
+index 3374dd1d..198817f3 100644
+--- a/src/rrd_tune.c
++++ b/src/rrd_tune.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * change header parameters of an rrd
+  *****************************************************************************
+diff --git a/src/rrd_update.c b/src/rrd_update.c
+index 831b8eed..83dd0d99 100644
+--- a/src/rrd_update.c
++++ b/src/rrd_update.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *                Copyright by Florian Forster, 2008
+  *****************************************************************************
+  * rrd_update.c  RRD Update Function
+diff --git a/src/rrd_update.h b/src/rrd_update.h
+index 67935fca..a925682d 100644
+--- a/src/rrd_update.h
++++ b/src/rrd_update.h
+@@ -1,5 +1,5 @@
+ /****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  ****************************************************************************
+  * rrd_restore.h
+  ****************************************************************************/
+diff --git a/src/rrd_version.c b/src/rrd_version.c
+index 73e731b1..84dd2e1e 100644
+--- a/src/rrd_version.c
++++ b/src/rrd_version.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrd_version Return
+  *****************************************************************************
+diff --git a/src/rrd_xport.c b/src/rrd_xport.c
+index eb814fbc..b8ca5b62 100644
+--- a/src/rrd_xport.c
++++ b/src/rrd_xport.c
+@@ -1,5 +1,5 @@
+ /****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  ****************************************************************************
+  * rrd_xport.c  export RRD data
+  ****************************************************************************/
+diff --git a/src/rrd_xport.h b/src/rrd_xport.h
+index 394b9401..52fa23fd 100644
+--- a/src/rrd_xport.h
++++ b/src/rrd_xport.h
+@@ -2,7 +2,7 @@
+ #define RRD_XPORT_H_C5A7EBAF331140D38C241326B81F357D
+ 
+ /****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  ****************************************************************************
+  * rrd_xport.h  contains XML related constants
+  ****************************************************************************/
+diff --git a/src/rrdupdate.c b/src/rrdupdate.c
+index 340ef5be..733e34f4 100644
+--- a/src/rrdupdate.c
++++ b/src/rrdupdate.c
+@@ -1,5 +1,5 @@
+ /*****************************************************************************
+- * RRDtool 1.7.2 Copyright by Tobi Oetiker, 1997-2019
++ * RRDtool 1.8.0 Copyright by Tobi Oetiker, 1997-2022
+  *****************************************************************************
+  * rrdupdate.c  Main program for the (standalone) rrdupdate utility
+  *****************************************************************************
+-- 
+2.40.0
+
diff --git a/debian/patches/series b/debian/patches/series
index e3a6fe1..ce0816a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ no-rpath-for-ruby
 breaks-long-man-lines
 translations
 acinclude.m4-Include-stdlib.h-when-using-exit.patch
+Update-Version-and-Copyright-year-in-git-files.patch
-- 
GitLab


From 3f5828e60276fdfb505ab7e4b5bd07e82b967a6a Mon Sep 17 00:00:00 2001
From: Diederik de Haas <didi.debian@cknow.org>
Date: Tue, 4 Apr 2023 19:20:48 +0200
Subject: [PATCH 6/7] d/patches: Add "Fix BUILD_DATE in rrdtool help output"
 patch

---
 debian/changelog                              |  1 +
 ...ix-BUILD_DATE-in-rrdtool-help-output.patch | 56 +++++++++++++++++++
 debian/patches/series                         |  1 +
 3 files changed, 58 insertions(+)
 create mode 100644 debian/patches/Fix-BUILD_DATE-in-rrdtool-help-output.patch

diff --git a/debian/changelog b/debian/changelog
index 01ea13b..cd1e4a6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,7 @@ rrdtool (1.8.0-1) UNRELEASED; urgency=medium
   * Import upstream patches:
     - "acinclude.m4: Include <stdlib.h> when using exit"
     - "Update Version and Copyright year in git files"
+    - "Fix BUILD_DATE in rrdtool help output" 
 
  -- Jean-Michel Vourgère <nirgal@debian.org>  Mon, 21 Mar 2022 10:55:32 +0100
 
diff --git a/debian/patches/Fix-BUILD_DATE-in-rrdtool-help-output.patch b/debian/patches/Fix-BUILD_DATE-in-rrdtool-help-output.patch
new file mode 100644
index 0000000..f486c42
--- /dev/null
+++ b/debian/patches/Fix-BUILD_DATE-in-rrdtool-help-output.patch
@@ -0,0 +1,56 @@
+From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= <c72578@yahoo.de>
+Date: Wed, 23 Mar 2022 17:58:45 +0100
+Subject: Fix BUILD_DATE in rrdtool help output
+Origin: https://github.com/oetiker/rrdtool-1.x/commit/e59f703bbcc0af949ee365206426b6394c340c6f
+
+- This is a followup to #1102
+- Fixes segfault when running "rrdtool --help"
+- Change DATE_FMT to the same date format as the __DATE__ macro [1]:
+  mmm dd yyyy
+
+[1] https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html
+---
+ configure.ac   | 2 +-
+ src/rrd_tool.c | 8 ++++++++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4d234585..5169b0d4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -695,7 +695,7 @@ AC_MSG_RESULT(${COMP_PERL:-No Perl Modules will be built})
+ 
+ # Use reproducible build date and time
+ if test "$SOURCE_DATE_EPOCH"; then
+-	DATE_FMT="%d %b %Y %H:%M:%S"
++	DATE_FMT="%b %d %Y %H:%M:%S"
+ 	BUILD_DATE=$(LC_ALL=C date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT")
+ 	AC_DEFINE_UNQUOTED([BUILD_DATE], ["$BUILD_DATE"], [Use reproducible build date])
+ fi
+diff --git a/src/rrd_tool.c b/src/rrd_tool.c
+index 930d0827..cc6119d9 100644
+--- a/src/rrd_tool.c
++++ b/src/rrd_tool.c
+@@ -45,11 +45,19 @@ static void PrintUsage(
+     char *cmd)
+ {
+ 
++#ifdef BUILD_DATE
++    const char *help_main =
++        N_("RRDtool %s"
++           "  Copyright by Tobias Oetiker <tobi@oetiker.ch>\n"
++           "               Compiled %s\n\n"
++           "Usage: rrdtool [options] command command_options\n");
++#else
+     const char *help_main =
+         N_("RRDtool %s"
+            "  Copyright by Tobias Oetiker <tobi@oetiker.ch>\n"
+            "               Compiled %s %s\n\n"
+            "Usage: rrdtool [options] command command_options\n");
++#endif
+ 
+     const char *help_list =
+         N_
+-- 
+2.40.0
+
diff --git a/debian/patches/series b/debian/patches/series
index ce0816a..274d6fc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ breaks-long-man-lines
 translations
 acinclude.m4-Include-stdlib.h-when-using-exit.patch
 Update-Version-and-Copyright-year-in-git-files.patch
+Fix-BUILD_DATE-in-rrdtool-help-output.patch
-- 
GitLab


From d3f646359a2df42ff682671c66ffef92eafa04e0 Mon Sep 17 00:00:00 2001
From: Diederik de Haas <didi.debian@cknow.org>
Date: Tue, 4 Apr 2023 19:24:01 +0200
Subject: [PATCH 7/7] d/patches: Add "Fix unsigned integer overflow in rrdtool
 first" patch

---
 debian/changelog                              |  1 +
 ...ed-integer-overflow-in-rrdtool-first.patch | 35 +++++++++++++++++++
 debian/patches/series                         |  1 +
 3 files changed, 37 insertions(+)
 create mode 100644 debian/patches/Fix-unsigned-integer-overflow-in-rrdtool-first.patch

diff --git a/debian/changelog b/debian/changelog
index cd1e4a6..6c63414 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -22,6 +22,7 @@ rrdtool (1.8.0-1) UNRELEASED; urgency=medium
     - "acinclude.m4: Include <stdlib.h> when using exit"
     - "Update Version and Copyright year in git files"
     - "Fix BUILD_DATE in rrdtool help output" 
+    - "Fix unsigned integer overflow in rrdtool first"
 
  -- Jean-Michel Vourgère <nirgal@debian.org>  Mon, 21 Mar 2022 10:55:32 +0100
 
diff --git a/debian/patches/Fix-unsigned-integer-overflow-in-rrdtool-first.patch b/debian/patches/Fix-unsigned-integer-overflow-in-rrdtool-first.patch
new file mode 100644
index 0000000..139ca79
--- /dev/null
+++ b/debian/patches/Fix-unsigned-integer-overflow-in-rrdtool-first.patch
@@ -0,0 +1,35 @@
+From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= <c72578@yahoo.de>
+Date: Fri, 1 Apr 2022 19:14:49 +0200
+Subject: Fix unsigned integer overflow in rrdtool first
+Origin: https://github.com/oetiker/rrdtool-1.x/commit/b74a0d64e00770384d025e40becdb2ed83c04c0c
+
+This fixes a signed/unsigned conversion bug in the calculation of
+"then". Background info:
+pdp_cnt and pdp_step are both unsigned long, whereas timer is signed.
+When multiplying signed and unsigned integers (same size), a signed is
+implicitly typecast to unsigned.
+
+- A similar fix has already been applied to rrd_dump.c
+  in commit e193975
+- Resolves #1140
+---
+ src/rrd_first.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/rrd_first.c b/src/rrd_first.c
+index 0e93397c..a696c5c3 100644
+--- a/src/rrd_first.c
++++ b/src/rrd_first.c
+@@ -113,7 +113,8 @@ time_t rrd_first_r(
+     then = (rrd.live_head->last_up -
+             rrd.live_head->last_up %
+             (rrd.rra_def[rraindex].pdp_cnt * rrd.stat_head->pdp_step)) +
+-        (timer * rrd.rra_def[rraindex].pdp_cnt * rrd.stat_head->pdp_step);
++        (timer * (long) rrd.rra_def[rraindex].pdp_cnt *
++         (long) rrd.stat_head->pdp_step);
+   err_close:
+     rrd_close(rrd_file);
+   err_free:
+-- 
+2.40.0
+
diff --git a/debian/patches/series b/debian/patches/series
index 274d6fc..9b6b273 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ translations
 acinclude.m4-Include-stdlib.h-when-using-exit.patch
 Update-Version-and-Copyright-year-in-git-files.patch
 Fix-BUILD_DATE-in-rrdtool-help-output.patch
+Fix-unsigned-integer-overflow-in-rrdtool-first.patch
-- 
GitLab