[PATCH 30/32] autofs-5.1.5 - use local getmntent_r() in tree_make_mnt_list()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Change tree_make_mnt_list() to use the local getmntent_r() instead of
the glibc version so that if glibc is changed to support the autofs
"ignore" hint automount(8) won't be affected.

Signed-off-by: Ian Kent <raven@xxxxxxxxxx>
---
 CHANGELOG    |    1 +
 lib/mounts.c |    8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 24620911..05acd16a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -36,6 +36,7 @@ xx/xx/2019 autofs-5.1.6
 - move unlink_mount_tree() to lib/mounts.c.
 - use local_getmntent_r() for unlink_mount_tree().
 - use local getmntent_r() in get_mnt_list().
+- use local getmntent_r() in tree_make_mnt_list().
 
 30/10/2018 autofs-5.1.5
 - fix flag file permission.
diff --git a/lib/mounts.c b/lib/mounts.c
index 86382bf3..83d053c8 100644
--- a/lib/mounts.c
+++ b/lib/mounts.c
@@ -1182,16 +1182,16 @@ struct mnt_list *tree_make_mnt_tree(const char *path)
 	size_t plen;
 	int eq;
 
-	tab = open_setmntent_r(_PROC_MOUNTS);
+	tab = open_fopen_r(_PROC_MOUNTS);
 	if (!tab) {
 		char *estr = strerror_r(errno, buf, PATH_MAX - 1);
-		logerr("setmntent: %s", estr);
+		logerr("fopen: %s", estr);
 		return NULL;
 	}
 
 	plen = strlen(path);
 
-	while ((mnt = getmntent_r(tab, &mnt_wrk, buf, PATH_MAX * 3))) {
+	while ((mnt = local_getmntent_r(tab, &mnt_wrk, buf, PATH_MAX * 3))) {
 		size_t len = strlen(mnt->mnt_dir);
 
 		/* Not matching path */
@@ -1283,7 +1283,7 @@ struct mnt_list *tree_make_mnt_tree(const char *path)
 		if (!tree)
 			tree = ent;
 	}
-	endmntent(tab);
+	fclose(tab);
 
 	return tree;
 }




[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux