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

304803
autofs-5.1.5 - use local getmntent_r() in tree_make_mnt_list()
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
Change tree_make_mnt_list() to use the local getmntent_r() instead of
304803
the glibc version so that if glibc is changed to support the autofs
304803
"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
@@ -348,6 +348,7 @@
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
+- use local getmntent_r() in tree_make_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
@@ -1176,16 +1176,16 @@ struct mnt_list *tree_make_mnt_tree(cons
304803
 	size_t plen;
304803
 	int eq;
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
 	plen = strlen(path);
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
 		size_t len = strlen(mnt->mnt_dir);
304803
 
304803
 		/* Not matching path */
304803
@@ -1277,7 +1277,7 @@ struct mnt_list *tree_make_mnt_tree(cons
304803
 		if (!tree)
304803
 			tree = ent;
304803
 	}
304803
-	endmntent(tab);
304803
+	fclose(tab);
304803
 
304803
 	return tree;
304803
 }