2022-08-04 13:03:38 +00:00
|
|
|
diff --git a/agent/mibgroup/host/data_access/swinst_rpm.c b/agent/mibgroup/host/data_access/swinst_rpm.c
|
|
|
|
index 695c469..dd0e487 100644
|
|
|
|
--- a/agent/mibgroup/host/data_access/swinst_rpm.c
|
|
|
|
+++ b/agent/mibgroup/host/data_access/swinst_rpm.c
|
2020-07-07 11:14:38 +00:00
|
|
|
@@ -75,6 +75,9 @@ netsnmp_swinst_arch_init(void)
|
|
|
|
snprintf( pkg_directory, SNMP_MAXPATH, "%s/Packages", dbpath );
|
|
|
|
SNMP_FREE(rpmdbpath);
|
|
|
|
dbpath = NULL;
|
|
|
|
+#ifdef HAVE_RPMGETPATH
|
|
|
|
+ rpmFreeRpmrc();
|
|
|
|
+#endif
|
|
|
|
if (-1 == stat( pkg_directory, &stat_buf )) {
|
2022-08-04 13:03:38 +00:00
|
|
|
snmp_log(LOG_ERR, "Can't find directory of RPM packages\n");
|
2020-07-07 11:14:38 +00:00
|
|
|
pkg_directory[0] = '\0';
|
2022-08-04 13:03:38 +00:00
|
|
|
diff --git a/agent/mibgroup/host/hr_swinst.c b/agent/mibgroup/host/hr_swinst.c
|
|
|
|
index 1f52733..ccf1cab 100644
|
|
|
|
--- a/agent/mibgroup/host/hr_swinst.c
|
|
|
|
+++ b/agent/mibgroup/host/hr_swinst.c
|
2020-07-07 11:14:38 +00:00
|
|
|
@@ -231,6 +231,9 @@ init_hr_swinst(void)
|
|
|
|
snprintf(path, sizeof(path), "%s/packages.rpm", swi->swi_dbpath);
|
|
|
|
path[ sizeof(path)-1 ] = 0;
|
|
|
|
swi->swi_directory = strdup(path);
|
|
|
|
+#ifdef HAVE_RPMGETPATH
|
|
|
|
+ rpmFreeRpmrc();
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
# ifdef _PATH_HRSW_directory
|