Blame SOURCES/autofs-5.1.5-use-local-getmntent_r-in-get_mnt_list.patch

8fa62f
autofs-5.1.5 - use local getmntent_r() in get_mnt_list()
8fa62f
8fa62f
From: Ian Kent <raven@themaw.net>
8fa62f
8fa62f
Change get_mnt_list() to use the local getmntent_r() instead of
8fa62f
the glibc version so that if glibc is changed to support the
8fa62f
autofs "ignore" hint automount(8) won't be affected.
8fa62f
8fa62f
Signed-off-by: Ian Kent <raven@themaw.net>
8fa62f
---
8fa62f
 CHANGELOG    |    1 +
8fa62f
 lib/mounts.c |    8 ++++----
8fa62f
 2 files changed, 5 insertions(+), 4 deletions(-)
8fa62f
8fa62f
--- autofs-5.1.4.orig/CHANGELOG
8fa62f
+++ autofs-5.1.4/CHANGELOG
8fa62f
@@ -73,6 +73,7 @@ xx/xx/2018 autofs-5.1.5
8fa62f
 - use single unlink_umount_tree() for both direct and indirect mounts.
8fa62f
 - move unlink_mount_tree() to lib/mounts.c.
8fa62f
 - use local_getmntent_r() for unlink_mount_tree().
8fa62f
+- use local getmntent_r() in get_mnt_list().
8fa62f
 
8fa62f
 19/12/2017 autofs-5.1.4
8fa62f
 - fix spec file url.
8fa62f
--- autofs-5.1.4.orig/lib/mounts.c
8fa62f
+++ autofs-5.1.4/lib/mounts.c
8fa62f
@@ -956,14 +956,14 @@ struct mnt_list *get_mnt_list(const char
8fa62f
 	if (!path || !pathlen || pathlen > PATH_MAX)
8fa62f
 		return NULL;
8fa62f
 
8fa62f
-	tab = open_setmntent_r(_PROC_MOUNTS);
8fa62f
+	tab = open_fopen_r(_PROC_MOUNTS);
8fa62f
 	if (!tab) {
8fa62f
 		char *estr = strerror_r(errno, buf, PATH_MAX - 1);
8fa62f
-		logerr("setmntent: %s", estr);
8fa62f
+		logerr("fopen: %s", estr);
8fa62f
 		return NULL;
8fa62f
 	}
8fa62f
 
8fa62f
-	while ((mnt = getmntent_r(tab, &mnt_wrk, buf, PATH_MAX * 3))) {
8fa62f
+	while ((mnt = local_getmntent_r(tab, &mnt_wrk, buf, PATH_MAX * 3))) {
8fa62f
 		len = strlen(mnt->mnt_dir);
8fa62f
 
8fa62f
 		if ((!include && len <= pathlen) ||
8fa62f
@@ -1020,7 +1020,7 @@ struct mnt_list *get_mnt_list(const char
8fa62f
 				ent->flags |= MNTS_OFFSET;
8fa62f
 		}
8fa62f
 	}
8fa62f
-	endmntent(tab);
8fa62f
+	fclose(tab);
8fa62f
 
8fa62f
 	return list;
8fa62f
 }