From b572d80d17edcd8d11cb10f23e73e91c7491dc25 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 27 May 2021 15:29:59 +0200 Subject: fix snmp extension build with net-snmp without DES --- php-net-snmp.patch | 38 ++++++++++++++++++++++++++++++++++++++ php.spec | 8 +++++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 php-net-snmp.patch diff --git a/php-net-snmp.patch b/php-net-snmp.patch new file mode 100644 index 0000000..e7ee193 --- /dev/null +++ b/php-net-snmp.patch @@ -0,0 +1,38 @@ +Backported from 8.0 for 7.4 by Remi + + +From f9fd3595ecb36c8dc6add0515782a18f15216d77 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 27 May 2021 14:20:07 +0200 +Subject: [PATCH] Fix snmp build without DES + +--- + ext/snmp/snmp.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c +index 35d19c8738828..d31995827880d 100644 +--- a/ext/snmp/snmp.c ++++ b/ext/snmp/snmp.c +@@ -1225,15 +1225,19 @@ static int netsnmp_session_set_auth_prot + Set the security protocol in the snmpv3 session */ + static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot) + { ++#ifndef NETSNMP_DISABLE_DES + if (!strcasecmp(prot, "DES")) { + s->securityPrivProto = usmDESPrivProtocol; + s->securityPrivProtoLen = USM_PRIV_PROTO_DES_LEN; ++ } else ++#endif + #ifdef HAVE_AES +- } else if (!strcasecmp(prot, "AES128") || !strcasecmp(prot, "AES")) { ++ if (!strcasecmp(prot, "AES128") || !strcasecmp(prot, "AES")) { + s->securityPrivProto = usmAESPrivProtocol; + s->securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN; ++ } else + #endif +- } else { ++ { + php_error_docref(NULL, E_WARNING, "Unknown security protocol '%s'", prot); + return (-1); + } diff --git a/php.spec b/php.spec index 5045f6d..69820a2 100644 --- a/php.spec +++ b/php.spec @@ -102,7 +102,7 @@ Summary: PHP scripting language for creating dynamic web sites Name: %{?scl_prefix}php Version: %{upver}%{?rcver:~%{rcver}}%{?gh_date:.%{gh_date}} -Release: 1%{?dist} +Release: 2%{?dist} # All files licensed under PHP version 3.01, except # Zend is licensed under Zend # TSRM is licensed under BSD @@ -144,6 +144,8 @@ Patch5: php-7.2.0-includedir.patch Patch6: php-7.4.0-embed.patch Patch8: php-7.2.0-libdb.patch Patch9: php-7.0.7-curl.patch +# backported from 8.0 +Patch10: php-net-snmp.patch # Functional changes Patch42: php-7.3.3-systzdata-v18.patch @@ -918,6 +920,7 @@ in pure PHP. %if 0%{?rhel} %patch9 -p1 -b .curltls %endif +%patch10 -p1 -b .nodes %if 0%{?fedora} >= 28 || 0%{?rhel} >= 6 %patch42 -p1 -b .systzdata @@ -1809,6 +1812,9 @@ fi %changelog +* Thu May 27 2021 Remi Collet - 7.4.20~RC1-2 +- fix snmp extension build with net-snmp without DES + * Tue May 18 2021 Remi Collet - 7.4.20~RC1-1 - update to 7.4.20RC1 -- cgit