From d4e577609cceea48dbdf7967337d10e620ebd279 Mon Sep 17 00:00:00 2001 From: Ubuntu Developers Date: Mon, 27 Jun 2022 15:01:27 +0800 Subject: [PATCH] HOST-MIB, hr_filesys: Fix Check_HR_FileSys_AutoFs() On Linux getmntent() is available but getfsstat() not. Hence remove #if HAVE_GETFSSTAT from around the HRFS_type check. See also https://sourceforge.net/p/net-snmp/patches/1350/. Fixes: cf41e6e91015 ("HOST-MIB: Skip autofs entries"). Author: Bart Van Assche Origin: upstream, https://github.com/net-snmp/net-snmp/commit/bcb1a6b8afc444bbcd099a195e08f0b01cbc8f6b Bug: https://sourceforge.net/p/net-snmp/patches/1350/ Bug-Ubuntu: https://launchpad.net/bugs/1843036 Gbp-Pq: Name fix-check-hr-filesys-autofs.patch --- agent/mibgroup/host/hr_filesys.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/agent/mibgroup/host/hr_filesys.c b/agent/mibgroup/host/hr_filesys.c index 8caeecf..4e51dc8 100644 --- a/agent/mibgroup/host/hr_filesys.c +++ b/agent/mibgroup/host/hr_filesys.c @@ -841,18 +841,8 @@ Check_HR_FileSys_NFS (void) int Check_HR_FileSys_AutoFs(void) { -#if HAVE_GETFSSTAT - if (HRFS_entry->HRFS_type != NULL && -#if defined(MNTTYPE_AUTOFS) - !strcmp(HRFS_entry->HRFS_type, MNTTYPE_AUTOFS) -#else - !strcmp(HRFS_entry->HRFS_type, "autofs") -#endif - ) -#endif /* HAVE_GETFSSTAT */ - return 1; /* AUTOFS */ - - return 0; /* no AUTOFS */ + return HRFS_entry->HRFS_type && + strcmp(HRFS_entry->HRFS_type, MNTTYPE_AUTOFS) == 0; } void