diff --git a/agent/mibgroup/host/data_access/swinst_rpm.c b/agent/mibgroup/host/data_access/swinst_rpm.c index 71595bea2..ea28a14a3 100644 --- a/agent/mibgroup/host/data_access/swinst_rpm.c +++ b/agent/mibgroup/host/data_access/swinst_rpm.c @@ -119,11 +119,11 @@ netsnmp_swinst_arch_load( netsnmp_container *container, u_int flags) CONTAINER_INSERT(container, entry); h = headerLink( h ); - headerGetEntry( h, RPMTAG_NAME, NULL, (void**)&n, NULL); - headerGetEntry( h, RPMTAG_VERSION, NULL, (void**)&v, NULL); - headerGetEntry( h, RPMTAG_RELEASE, NULL, (void**)&r, NULL); - headerGetEntry( h, RPMTAG_GROUP, NULL, (void**)&g, NULL); - headerGetEntry( h, RPMTAG_INSTALLTIME, NULL, (void**)&t, NULL); + headerGet( h, RPMTAG_NAME, (void**)&n, HEADERGET_DEFAULT); + headerGet( h, RPMTAG_VERSION, (void**)&v, HEADERGET_DEFAULT); + headerGet( h, RPMTAG_RELEASE, (void**)&r, HEADERGET_DEFAULT); + headerGet( h, RPMTAG_GROUP, (void**)&g, HEADERGET_DEFAULT); + headerGet( h, RPMTAG_INSTALLTIME, (void**)&t, HEADERGET_DEFAULT); entry->swName_len = snprintf( entry->swName, sizeof(entry->swName), "%s-%s-%s", n, v, r); diff --git a/agent/mibgroup/host/hr_swinst.c b/agent/mibgroup/host/hr_swinst.c index 25582bd45..1fb234070 100644 --- a/agent/mibgroup/host/hr_swinst.c +++ b/agent/mibgroup/host/hr_swinst.c @@ -485,7 +485,7 @@ var_hrswinst(struct variable * vp, #else # ifdef HAVE_LIBRPM char *rpm_groups; - if ( headerGetEntry(swi->swi_h, RPMTAG_GROUP, NULL, (void **) &rpm_groups, NULL) ) { + if ( headerGet(swi->swi_h, RPMTAG_GROUP,(void **) &rpm_groups, HEADERGET_DEFAULT) ) { if ( strstr(rpm_groups, "System Environment") != NULL ) long_return = 2; /* operatingSystem */ else @@ -504,7 +504,7 @@ var_hrswinst(struct variable * vp, { #ifdef HAVE_LIBRPM int32_t *rpm_data; - if ( headerGetEntry(swi->swi_h, RPMTAG_INSTALLTIME, NULL, (void **) &rpm_data, NULL) ) { + if ( headerGet(swi->swi_h, RPMTAG_INSTALLTIME, (void **) &rpm_data, HEADERGET_DEFAULT) ) { time_t installTime = *rpm_data; ret = date_n_time(&installTime, var_len); } else { @@ -690,11 +690,11 @@ Save_HR_SW_info(int ix) swi->swi_h = h; swi->swi_prevx = ix; - headerGetEntry(swi->swi_h, RPMTAG_NAME, NULL, (void **) &n, NULL); - headerGetEntry(swi->swi_h, RPMTAG_VERSION, NULL, (void **) &v, - NULL); - headerGetEntry(swi->swi_h, RPMTAG_RELEASE, NULL, (void **) &r, - NULL); + headerGet(swi->swi_h, RPMTAG_NAME, (void **) &n, HEADERGET_DEFAULT); + headerGet(swi->swi_h, RPMTAG_VERSION, (void **) &v, + HEADERGET_DEFAULT); + headerGet(swi->swi_h, RPMTAG_RELEASE, (void **) &r, + HEADERGET_DEFAULT); snprintf(swi->swi_name, sizeof(swi->swi_name), "%s-%s-%s", n, v, r); swi->swi_name[ sizeof(swi->swi_name)-1 ] = 0; } diff --git a/configure b/configure index 433ba5ba2..b312eb575 100755 --- a/configure +++ b/configure @@ -19628,10 +19628,10 @@ $as_echo "#define HAVE_LIBRPM 1" >>confdefs.h # rpm 4.6 has incompatible API, turn on the legacy one - ac_fn_c_check_decl "$LINENO" "headerGetEntry" "ac_cv_have_decl_headerGetEntry" "#include + ac_fn_c_check_decl "$LINENO" "headerGet" "ac_cv_have_decl_headerGet" "#include " -if test "x$ac_cv_have_decl_headerGetEntry" = xyes; then : +if test "x$ac_cv_have_decl_headerGet" = xyes; then : : else diff --git a/configure.d/config_os_libs1 b/configure.d/config_os_libs1 index 35f052a1f..d922db073 100644 --- a/configure.d/config_os_libs1 +++ b/configure.d/config_os_libs1 @@ -46,7 +46,7 @@ if test "x$with_rpm" != "xno"; then ],, $LMIBLIBS, _rpmlibs) # rpm 4.6 has incompatible API, turn on the legacy one - AC_CHECK_DECL([headerGetEntry], + AC_CHECK_DECL([headerGet], : , AC_DEFINE([_RPM_4_4_COMPAT], [], [Define if you have RPM 4.6 or newer to turn on legacy API]), [[#include ]]