From 664916827dd9f20c4bfb9c65bf0be2dadc685f71 Mon Sep 17 00:00:00 2001 From: Arjun Shankar Date: Apr 12 2023 13:03:37 +0000 Subject: Port to C99 (#2186195) Related to: --- diff --git a/jabberd-c99.patch b/jabberd-c99.patch new file mode 100644 index 0000000..5515359 --- /dev/null +++ b/jabberd-c99.patch @@ -0,0 +1,132 @@ +diff --git a/configure b/configure +index 551a963ae06a3624..06ba2c4ebde3e9ab 100755 +--- a/configure ++++ b/configure +@@ -16341,8 +16341,9 @@ else + /* end confdefs.h. */ + #include + #include +- segv() { exit(1); } +- main() { char b[10]; signal(SIGSEGV,segv); snprintf(b,10,"%s",NULL); exit(0); } ++ #include ++ void segv() { exit(1); } ++ int main() { char b[10]; signal(SIGSEGV,segv); snprintf(b,10,"%s",NULL); exit(0); } + _ACEOF + if ac_fn_c_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +@@ -16373,9 +16374,10 @@ else + #include + #include + #include +- segv() { exit(1); } +- expand(char *f,...) { va_list ap; char b[10]; va_start(ap,f); vsnprintf(b,10,f,ap); va_end(ap); } +- main() { char b[10]; signal(SIGSEGV,segv); expand("%s", NULL); exit(0); } ++ #include ++ void segv() { exit(1); } ++ void expand(char *f,...) { va_list ap; char b[10]; va_start(ap,f); vsnprintf(b,10,f,ap); va_end(ap); } ++ int main() { char b[10]; signal(SIGSEGV,segv); expand("%s", NULL); exit(0); } + _ACEOF + if ac_fn_c_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +diff --git a/configure.ac b/configure.ac +index af173540785271fd..071933830f3676b2 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -323,8 +323,9 @@ if test "x-$ac_cv_func_snprintf" = "x-yes" ; then + AC_MSG_CHECKING([if snprintf can handle NULL arguments]) + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include + #include +- segv() { exit(1); } +- main() { char b[10]; signal(SIGSEGV,segv); snprintf(b,10,"%s",NULL); exit(0); }]])], ++ #include ++ void segv() { exit(1); } ++ int main() { char b[10]; signal(SIGSEGV,segv); snprintf(b,10,"%s",NULL); exit(0); }]])], + AC_MSG_RESULT(yes), + [AC_MSG_RESULT(no) + AC_DEFINE(HAVE_BROKEN_SNPRINTF,1,[Define to 1 if 'snprintf' cannot handle NULL arguments.])]) +@@ -334,9 +335,10 @@ if test "x-$ac_cv_func_vsnprintf" = "x-yes" ; then + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include + #include + #include +- segv() { exit(1); } +- expand(char *f,...) { va_list ap; char b[10]; va_start(ap,f); vsnprintf(b,10,f,ap); va_end(ap); } +- main() { char b[10]; signal(SIGSEGV,segv); expand("%s", NULL); exit(0); }]])], ++ #include ++ void segv() { exit(1); } ++ void expand(char *f,...) { va_list ap; char b[10]; va_start(ap,f); vsnprintf(b,10,f,ap); va_end(ap); } ++ int main() { char b[10]; signal(SIGSEGV,segv); expand("%s", NULL); exit(0); }]])], + AC_MSG_RESULT(yes), + [AC_MSG_RESULT(no) + AC_DEFINE(HAVE_BROKEN_VSNPRINTF,1,[Define to 1 if 'vsnprintf' cannot handle NULL arguments.])]) +diff --git a/storage/authreg_ldapfull.c b/storage/authreg_ldapfull.c +index 6dbf202bf8627925..a545ad1dcb6cccb9 100644 +--- a/storage/authreg_ldapfull.c ++++ b/storage/authreg_ldapfull.c +@@ -35,6 +35,7 @@ + #ifdef STORAGE_LDAP + #ifdef HAVE_CRYPT + #include ++#include + #endif + + #ifdef HAVE_SSL +diff --git a/storage/authreg_mysql.c b/storage/authreg_mysql.c +index 0b35d6ddfd40c3af..5e15143837e66c08 100644 +--- a/storage/authreg_mysql.c ++++ b/storage/authreg_mysql.c +@@ -34,6 +34,7 @@ + #else + #ifdef HAVE_CRYPT + #include ++#include + #endif + #endif + +diff --git a/storage/authreg_pgsql.c b/storage/authreg_pgsql.c +index 446fa1f8217b162a..1065c5d35b629737 100644 +--- a/storage/authreg_pgsql.c ++++ b/storage/authreg_pgsql.c +@@ -32,6 +32,7 @@ + #else + #ifdef HAVE_CRYPT + #include ++#include + #endif + #endif + +diff --git a/storage/authreg_sqlite.c b/storage/authreg_sqlite.c +index 25058ee639238a91..dcd4cadba3504fa5 100644 +--- a/storage/authreg_sqlite.c ++++ b/storage/authreg_sqlite.c +@@ -41,6 +41,7 @@ + #else + #ifdef HAVE_CRYPT + #include ++#include + #endif + #endif + +diff --git a/sx/websocket.c b/sx/websocket.c +index b08e135f4966c592..4df051559850dfe1 100644 +--- a/sx/websocket.c ++++ b/sx/websocket.c +@@ -22,6 +22,7 @@ + * http://tools.ietf.org/html/rfc7395 + */ + ++#define _GNU_SOURCE + #include "sx.h" + #include + #include +diff --git a/util/crypt_blowfish.h b/util/crypt_blowfish.h +index d81e8cbdea9473d0..8ba1a917a84e9276 100644 +--- a/util/crypt_blowfish.h ++++ b/util/crypt_blowfish.h +@@ -23,7 +23,6 @@ + #endif + + extern char *bcrypt(__const char *key, __const char *setting); +-extern char *crypt_r(__const char *key, __const char *setting, void *data); + + #ifndef __SKIP_OW + extern char *crypt_rn(__const char *key, __const char *setting, diff --git a/jabberd.spec b/jabberd.spec index f0ace1b..70bf2e2 100644 --- a/jabberd.spec +++ b/jabberd.spec @@ -14,7 +14,7 @@ Summary: OpenSource server implementation of the Jabber protocols Name: jabberd Version: 2.6.1 -Release: 23%{?dist} +Release: 24%{?dist} License: GPLv2+ Source0: https://github.com/jabberd2/jabberd2/releases/download/jabberd-%{version}/jabberd-%{version}.tar.xz Source1: README.fedora @@ -29,6 +29,7 @@ Patch5: 0003-sx-ssl.c-adapt-to-openssl-1.1.patch Patch6: 0001-Fix-build-errors-with-MariaDB-10.2.patch # rhbz1510642 Patch7: 181e736dcbb19c828266d88837f4343510b4d20e.patch +Patch8: jabberd-c99.patch URL: http://jabberd2.org/ BuildRequires: openssl-devel libidn-devel expat-devel BuildRequires: perl-generators @@ -111,6 +112,7 @@ This package defaults to use pam and sqlite. %patch4 -p1 %patch5 -p1 %patch7 -p1 +%patch8 -p1 autoreconf --verbose --force --install %endif %patch6 -p1 @@ -355,6 +357,9 @@ fi %attr(700, jabber, jabber) %{_var}/lib/%{name} %changelog +* Wed Apr 12 2023 Arjun Shankar - 2.6.1-24 +- Port to C99 (#2186195) + * Thu Jan 19 2023 Fedora Release Engineering - 2.6.1-23 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild