From dd051b0e3c2fb2483f874384139e61b2ae11cf5c Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 24 Feb 2023 18:21:45 +0100 Subject: [PATCH] Port to C99 Related to: --- opendnssec-c99-1.patch | 18 ++++++++++++++ opendnssec-c99-2.patch | 20 +++++++++++++++ opendnssec-configure-c99.patch | 45 ++++++++++++++++++++++++++++++++++ opendnssec.spec | 13 +++++++++- 4 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 opendnssec-c99-1.patch create mode 100644 opendnssec-c99-2.patch create mode 100644 opendnssec-configure-c99.patch diff --git a/opendnssec-c99-1.patch b/opendnssec-c99-1.patch new file mode 100644 index 0000000..531a73f --- /dev/null +++ b/opendnssec-c99-1.patch @@ -0,0 +1,18 @@ +commit 27290c5fcd065a5a857d37236e7f79121e303d0a +Author: Mathieu Mirmont +Date: Sun Dec 1 18:43:53 2019 +0100 + + common: add missing util.h header + +diff --git a/common/scheduler/task.c b/common/scheduler/task.c +index cfdbd2d101aae795..9c09dc1893363abe 100644 +--- a/common/scheduler/task.c ++++ b/common/scheduler/task.c +@@ -39,6 +39,7 @@ + #include "status.h" + #include "duration.h" + #include "file.h" ++#include "util.h" + #include "log.h" + + static const char* task_str = "task"; diff --git a/opendnssec-c99-2.patch b/opendnssec-c99-2.patch new file mode 100644 index 0000000..db04f2b --- /dev/null +++ b/opendnssec-c99-2.patch @@ -0,0 +1,20 @@ +commit 5422819c17c02e6069328b2f5e4bef6fe5c179df +Author: Mathieu Mirmont +Date: Sun Dec 1 17:57:36 2019 +0100 + + enforcer: remove remove strptime build warning + +diff --git a/enforcer/src/daemon/time_leap_cmd.c b/enforcer/src/daemon/time_leap_cmd.c +index f1ee21b87529c136..5baef1b6ff7c4cc2 100644 +--- a/enforcer/src/daemon/time_leap_cmd.c ++++ b/enforcer/src/daemon/time_leap_cmd.c +@@ -26,8 +26,8 @@ + * + */ + +-#include + #include "config.h" ++#include + + #include "file.h" + #include "duration.h" diff --git a/opendnssec-configure-c99.patch b/opendnssec-configure-c99.patch new file mode 100644 index 0000000..509462f --- /dev/null +++ b/opendnssec-configure-c99.patch @@ -0,0 +1,45 @@ +Include for the setresuid and setresgid functions, +to avoid an implicit function declaration. + +Submitted upstream: + +diff --git a/configure b/configure +index bf515cde3d4fab71..52d2885d6a6ef546 100755 +--- a/configure ++++ b/configure +@@ -21101,6 +21101,7 @@ else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + ++#include + #include + #include + int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} +@@ -21143,6 +21144,7 @@ else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + ++#include + #include + #include + int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} +diff --git a/m4/acx_broken_setres.m4 b/m4/acx_broken_setres.m4 +index 374cee0b0b8ef196..467db9170a319170 100644 +--- a/m4/acx_broken_setres.m4 ++++ b/m4/acx_broken_setres.m4 +@@ -4,6 +4,7 @@ AC_DEFUN([ACX_BROKEN_SETRES],[ + AC_MSG_CHECKING(if setresuid seems to work) + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ ++#include + #include + #include + int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} +@@ -20,6 +21,7 @@ int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} + AC_MSG_CHECKING(if setresgid seems to work) + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ ++#include + #include + #include + int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} diff --git a/opendnssec.spec b/opendnssec.spec index c551111..1d320db 100644 --- a/opendnssec.spec +++ b/opendnssec.spec @@ -4,7 +4,7 @@ Summary: DNSSEC key and zone management software Name: opendnssec Version: 2.1.10 -Release: 5%{?dist} +Release: 6%{?dist} License: BSD Url: http://www.opendnssec.org/ Source0: http://www.opendnssec.org/files/source/%{?prever:testing/}%{name}-%{version}%{?prever}.tar.gz @@ -17,6 +17,9 @@ Source6: opendnssec.cron Source7: opendnssec-2.1.sqlite_convert.sql Source8: opendnssec-2.1.sqlite_rpmversion.sql Patch1: 0001-Pass-right-remaining-buffer-size-in-hsm_hex_unparse-.patch +Patch2: opendnssec-configure-c99.patch +Patch3: opendnssec-c99-1.patch +Patch4: opendnssec-c99-2.patch Requires: opencryptoki, softhsm >= 2.5.0 , systemd-units Requires: libxml2, libxslt sqlite @@ -47,6 +50,11 @@ name server. It requires a PKCS#11 crypto module library, such as softhsm %prep %setup -q -n %{name}-%{version}%{?prever} %patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +# Prevent re-running autoconf. +touch -r aclocal.m4 configure* m4/* # bump default policy ZSK keysize to 2048 sed -i "s/1024/2048/" conf/kasp.xml.in @@ -181,6 +189,9 @@ ods-enforcer update all >/dev/null 2>/dev/null ||: %systemd_postun_with_restart ods-signerd.service %changelog +* Fri Feb 24 2023 Florian Weimer - 2.1.10-6 +- Port to C99 + * Mon Jan 30 2023 Alexander Bokovoy - 2.1.10-5 - Fix fortification issues leading to crash in FreeIPA setup Upstream PR: https://github.com/opendnssec/opendnssec/pull/842