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 <bvanassche@acm.org>
Origin: upstream, bcb1a6b8af
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
This commit is contained in:
Ubuntu Developers 2022-06-27 15:01:27 +08:00 committed by Lu zhiping
parent dbaba49fae
commit d4e577609c
1 changed files with 2 additions and 12 deletions

View File

@ -841,18 +841,8 @@ Check_HR_FileSys_NFS (void)
int int
Check_HR_FileSys_AutoFs(void) Check_HR_FileSys_AutoFs(void)
{ {
#if HAVE_GETFSSTAT return HRFS_entry->HRFS_type &&
if (HRFS_entry->HRFS_type != NULL && strcmp(HRFS_entry->HRFS_type, MNTTYPE_AUTOFS) == 0;
#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 */
} }
void void