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

8fa62f
autofs-5.1.5 - use local getmntent_r in table_is_mounted()
8fa62f
8fa62f
From: Ian Kent <raven@themaw.net>
8fa62f
8fa62f
Use the local_getmntent_r() funtion copied from glibc in the function
8fa62f
table_is_mounted() so that if glibc is changed to support the autofs
8fa62f
"ignore" hint automount(8) won't be affected.
8fa62f
8fa62f
Signed-off-by: Ian Kent <raven@themaw.net>
8fa62f
---
8fa62f
 CHANGELOG    |    1 +
8fa62f
 lib/mounts.c |    8 ++++----
8fa62f
 2 files changed, 5 insertions(+), 4 deletions(-)
8fa62f
8fa62f
--- autofs-5.1.4.orig/CHANGELOG
8fa62f
+++ autofs-5.1.4/CHANGELOG
8fa62f
@@ -67,6 +67,7 @@ xx/xx/2018 autofs-5.1.5
8fa62f
 - use mp instead of path in mnt_list entries.
8fa62f
 - always use PROC_MOUNTS to make mount lists.
8fa62f
 - add glibc getmntent_r().
8fa62f
+- use local getmntent_r in table_is_mounted().
8fa62f
 
8fa62f
 19/12/2017 autofs-5.1.4
8fa62f
 - fix spec file url.
8fa62f
--- autofs-5.1.4.orig/lib/mounts.c
8fa62f
+++ autofs-5.1.4/lib/mounts.c
8fa62f
@@ -999,14 +999,14 @@ static int table_is_mounted(const char *
8fa62f
 	if (!mp || !mp_len || mp_len >= PATH_MAX)
8fa62f
 		return 0;
8fa62f
 
8fa62f
-	tab = open_setmntent_r(_PROC_MOUNTS);
8fa62f
+	tab = open_fopen_r(_PROC_MOUNTS);
8fa62f
 	if (!tab) {
8fa62f
 		char *estr = strerror_r(errno, buf, PATH_MAX - 1);
8fa62f
-		logerr("setmntent: %s", estr);
8fa62f
+		logerr("fopen: %s", estr);
8fa62f
 		return 0;
8fa62f
 	}
8fa62f
 
8fa62f
-	while ((mnt = getmntent_r(tab, &mnt_wrk, buf, PATH_MAX * 3))) {
8fa62f
+	while ((mnt = local_getmntent_r(tab, &mnt_wrk, buf, PATH_MAX * 3))) {
8fa62f
 		size_t len = strlen(mnt->mnt_dir);
8fa62f
 
8fa62f
 		if (type) {
8fa62f
@@ -1028,7 +1028,7 @@ static int table_is_mounted(const char *
8fa62f
 			break;
8fa62f
 		}
8fa62f
 	}
8fa62f
-	endmntent(tab);
8fa62f
+	fclose(tab);
8fa62f
 
8fa62f
 	return ret;
8fa62f
 }