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

1c5f92
autofs-5.1.5 - use local getmntent_r in table_is_mounted()
1c5f92
1c5f92
From: Ian Kent <raven@themaw.net>
1c5f92
1c5f92
Use the local_getmntent_r() funtion copied from glibc in the function
1c5f92
table_is_mounted() 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
@@ -67,6 +67,7 @@ xx/xx/2018 autofs-5.1.5
1c5f92
 - use mp instead of path in mnt_list entries.
1c5f92
 - always use PROC_MOUNTS to make mount lists.
1c5f92
 - add glibc getmntent_r().
1c5f92
+- use local getmntent_r in table_is_mounted().
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
@@ -999,14 +999,14 @@ static int table_is_mounted(const char *
1c5f92
 	if (!mp || !mp_len || mp_len >= PATH_MAX)
1c5f92
 		return 0;
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 0;
1c5f92
 	}
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
 		if (type) {
1c5f92
@@ -1028,7 +1028,7 @@ static int table_is_mounted(const char *
1c5f92
 			break;
1c5f92
 		}
1c5f92
 	}
1c5f92
-	endmntent(tab);
1c5f92
+	fclose(tab);
1c5f92
 
1c5f92
 	return ret;
1c5f92
 }