From ef525e0c2bef17444799c8137fb5ed5fc51340ae Mon Sep 17 00:00:00 2001 From: Vitezslav Crhonek Date: Thu, 22 Jul 2021 10:59:27 +0200 Subject: [PATCH] Improve error message without DES support in SNMP, add rpminspect.yaml Resolves: rhbz#1972623 Signed-off-by: Vitezslav Crhonek --- pegasus-snmp-disable-des.patch | 30 +++++++++++++++++++++++------- rpminspect.yaml | 5 +++++ tog-pegasus.spec | 6 +++++- 3 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 rpminspect.yaml diff --git a/pegasus-snmp-disable-des.patch b/pegasus-snmp-disable-des.patch index 18ccd7b..275ca0f 100644 --- a/pegasus-snmp-disable-des.patch +++ b/pegasus-snmp-disable-des.patch @@ -1,10 +1,10 @@ This patch is required because net-smp is not build with DES support, so usmDESPrivProtocol is not available. -diff -ur pegasus.orig/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.cpp pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.cpp ---- pegasus.orig/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.cpp 2021-06-16 11:22:58.855254567 +0200 -+++ pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.cpp 2021-06-16 11:37:33.012733834 +0200 -@@ -247,6 +247,16 @@ +diff -up pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.cpp.orig pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.cpp +--- pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.cpp.orig 2021-06-23 09:57:12.052712533 +0200 ++++ pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.cpp 2021-06-23 10:06:19.893857294 +0200 +@@ -247,6 +247,16 @@ void snmpDeliverTrap_netsnmp::_createSes #ifdef PEGASUS_ENABLE_NET_SNMPV3 case _SNMPv3_TRAP: { @@ -14,14 +14,14 @@ diff -ur pegasus.orig/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_ + PEG_METHOD_EXIT(); + throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED, + MessageLoaderParms( -+ _MSG_VERSION_NOT_SUPPORTED_KEY, -+ _MSG_VERSION_NOT_SUPPORTED)); ++ _MSG_DES_NOT_SUPPORTED_KEY, ++ _MSG_DES_NOT_SUPPORTED)); + } + snmpSession.version = SNMP_VERSION_3; CString securityNameCStr = securityName.getCString(); size_t securityNameLen = strlen(securityNameCStr); -@@ -321,14 +331,7 @@ +@@ -321,14 +331,7 @@ void snmpDeliverTrap_netsnmp::_createSes SNMP_FREE(snmpSession.securityPrivProto); //Privacy @@ -37,3 +37,19 @@ diff -ur pegasus.orig/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_ { snmpSession.securityPrivProto = snmp_duplicate_objid( usmAESPrivProtocol, +diff -up pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.h.orig pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.h +--- pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.h.orig 2021-06-23 09:57:54.014119384 +0200 ++++ pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.h 2021-06-23 10:05:04.489320833 +0200 +@@ -64,6 +64,12 @@ static const char _MSG_VERSION_NOT_SUPPO + "Handler.snmpIndicationHandler.snmpDeliverTrap_netsnmp." + "_MSG_VERSION_NOT_SUPPORTED"; + ++static const char _MSG_DES_NOT_SUPPORTED[] = ++ "DES support is disabled in SNMP."; ++static const char _MSG_DES_NOT_SUPPORTED_KEY[] = ++ "Handler.snmpIndicationHandler.snmpDeliverTrap_netsnmp." ++ "_MSG_DES_NOT_SUPPORTED"; ++ + static const char _MSG_SESSION_SEND_FAILED[] = + "Snmp Indication Handler failed to send the trap: "; + static const char _MSG_SESSION_SEND_FAILED_KEY[] = diff --git a/rpminspect.yaml b/rpminspect.yaml new file mode 100644 index 0000000..e71b5f6 --- /dev/null +++ b/rpminspect.yaml @@ -0,0 +1,5 @@ +--- +inspections: + badfuncs: off +ownership: + bin_group: pegasus diff --git a/tog-pegasus.spec b/tog-pegasus.spec index d6b2709..9a28c03 100644 --- a/tog-pegasus.spec +++ b/tog-pegasus.spec @@ -8,7 +8,7 @@ Name: tog-pegasus Version: %{major_ver}.1 -Release: 61%{?dist} +Release: 62%{?dist} Epoch: 2 Summary: OpenPegasus WBEM Services for Linux @@ -561,6 +561,10 @@ fi %changelog +* Thu Jul 22 2021 Vitezslav Crhonek - 2.14.1-62 +- Improve error message without DES support in SNMP + Resolves: rhbz#1972623 + * Wed Jun 16 2021 Florian Weimer - 2:2.14.1-61 - Port to net-snmp without DES support (#1958073)