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

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