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

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