Improve error message without DES support in SNMP, add rpminspect.yaml

Resolves: rhbz#1972623

Signed-off-by: Vitezslav Crhonek <vcrhonek@redhat.com>
This commit is contained in:
Vitezslav Crhonek 2021-07-22 10:59:27 +02:00
parent e5b582b990
commit ef525e0c2b
3 changed files with 33 additions and 8 deletions

View File

@ -1,10 +1,10 @@
This patch is required because net-smp is not build with DES support, This patch is required because net-smp is not build with DES support,
so usmDESPrivProtocol is not available. so usmDESPrivProtocol is not available.
diff -ur pegasus.orig/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.cpp pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.cpp diff -up pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.cpp.orig 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.orig 2021-06-23 09:57:12.052712533 +0200
+++ pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.cpp 2021-06-16 11:37:33.012733834 +0200 +++ pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.cpp 2021-06-23 10:06:19.893857294 +0200
@@ -247,6 +247,16 @@ @@ -247,6 +247,16 @@ void snmpDeliverTrap_netsnmp::_createSes
#ifdef PEGASUS_ENABLE_NET_SNMPV3 #ifdef PEGASUS_ENABLE_NET_SNMPV3
case _SNMPv3_TRAP: case _SNMPv3_TRAP:
{ {
@ -14,14 +14,14 @@ diff -ur pegasus.orig/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_
+ PEG_METHOD_EXIT(); + PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED, + throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED,
+ MessageLoaderParms( + MessageLoaderParms(
+ _MSG_VERSION_NOT_SUPPORTED_KEY, + _MSG_DES_NOT_SUPPORTED_KEY,
+ _MSG_VERSION_NOT_SUPPORTED)); + _MSG_DES_NOT_SUPPORTED));
+ } + }
+ +
snmpSession.version = SNMP_VERSION_3; snmpSession.version = SNMP_VERSION_3;
CString securityNameCStr = securityName.getCString(); CString securityNameCStr = securityName.getCString();
size_t securityNameLen = strlen(securityNameCStr); size_t securityNameLen = strlen(securityNameCStr);
@@ -321,14 +331,7 @@ @@ -321,14 +331,7 @@ void snmpDeliverTrap_netsnmp::_createSes
SNMP_FREE(snmpSession.securityPrivProto); SNMP_FREE(snmpSession.securityPrivProto);
//Privacy //Privacy
@ -37,3 +37,19 @@ diff -ur pegasus.orig/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_
{ {
snmpSession.securityPrivProto = snmp_duplicate_objid( snmpSession.securityPrivProto = snmp_duplicate_objid(
usmAESPrivProtocol, 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[] =

5
rpminspect.yaml Normal file
View File

@ -0,0 +1,5 @@
---
inspections:
badfuncs: off
ownership:
bin_group: pegasus

View File

@ -8,7 +8,7 @@
Name: tog-pegasus Name: tog-pegasus
Version: %{major_ver}.1 Version: %{major_ver}.1
Release: 61%{?dist} Release: 62%{?dist}
Epoch: 2 Epoch: 2
Summary: OpenPegasus WBEM Services for Linux Summary: OpenPegasus WBEM Services for Linux
@ -561,6 +561,10 @@ fi
%changelog %changelog
* Thu Jul 22 2021 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.14.1-62
- Improve error message without DES support in SNMP
Resolves: rhbz#1972623
* Wed Jun 16 2021 Florian Weimer <fweimer@redhat.com> - 2:2.14.1-61 * Wed Jun 16 2021 Florian Weimer <fweimer@redhat.com> - 2:2.14.1-61
- Port to net-snmp without DES support (#1958073) - Port to net-snmp without DES support (#1958073)