|
|
8fa62f |
autofs-5.1.5 - use local getmntent_r() in tree_make_mnt_list()
|
|
|
8fa62f |
|
|
|
8fa62f |
From: Ian Kent <raven@themaw.net>
|
|
|
8fa62f |
|
|
|
8fa62f |
Change tree_make_mnt_list() to use the local getmntent_r() instead of
|
|
|
8fa62f |
the glibc version 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 |
@@ -74,6 +74,7 @@ xx/xx/2018 autofs-5.1.5
|
|
|
8fa62f |
- move unlink_mount_tree() to lib/mounts.c.
|
|
|
8fa62f |
- use local_getmntent_r() for unlink_mount_tree().
|
|
|
8fa62f |
- use local getmntent_r() in get_mnt_list().
|
|
|
8fa62f |
+- use local getmntent_r() in tree_make_mnt_list().
|
|
|
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 |
@@ -1182,16 +1182,16 @@ struct mnt_list *tree_make_mnt_tree(cons
|
|
|
8fa62f |
size_t plen;
|
|
|
8fa62f |
int eq;
|
|
|
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 NULL;
|
|
|
8fa62f |
}
|
|
|
8fa62f |
|
|
|
8fa62f |
plen = strlen(path);
|
|
|
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 |
/* Not matching path */
|
|
|
8fa62f |
@@ -1283,7 +1283,7 @@ struct mnt_list *tree_make_mnt_tree(cons
|
|
|
8fa62f |
if (!tree)
|
|
|
8fa62f |
tree = ent;
|
|
|
8fa62f |
}
|
|
|
8fa62f |
- endmntent(tab);
|
|
|
8fa62f |
+ fclose(tab);
|
|
|
8fa62f |
|
|
|
8fa62f |
return tree;
|
|
|
8fa62f |
}
|