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

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