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

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