|
|
591f3a |
autofs-5.1.8 - fix incorrect path for is_mounted() in try_remount()
|
|
|
591f3a |
|
|
|
591f3a |
From: Ian Kent <raven@themaw.net>
|
|
|
591f3a |
|
|
|
591f3a |
A regression was introduced when the offset mount handling was rewritten.
|
|
|
591f3a |
|
|
|
591f3a |
It resulted in an incorrect path sometimes being used in an is_mounted()
|
|
|
591f3a |
check.
|
|
|
591f3a |
|
|
|
591f3a |
Signed-off-by: Ian Kent <raven@themaw.net>
|
|
|
591f3a |
---
|
|
|
591f3a |
CHANGELOG | 1 +
|
|
|
591f3a |
lib/mounts.c | 26 +++++++++++++++++++++-----
|
|
|
591f3a |
2 files changed, 22 insertions(+), 5 deletions(-)
|
|
|
591f3a |
|
|
|
591f3a |
--- autofs-5.1.4.orig/CHANGELOG
|
|
|
591f3a |
+++ autofs-5.1.4/CHANGELOG
|
|
|
591f3a |
@@ -104,6 +104,7 @@
|
|
|
591f3a |
- fix memory leak in update_hosts_mounts().
|
|
|
591f3a |
- fix concat_options() error handling.
|
|
|
591f3a |
- fix minus only option handling in concat_options().
|
|
|
591f3a |
+- fix incorrect path for is_mounted() in try_remount().
|
|
|
591f3a |
|
|
|
591f3a |
xx/xx/2018 autofs-5.1.5
|
|
|
591f3a |
- fix flag file permission.
|
|
|
591f3a |
--- autofs-5.1.4.orig/lib/mounts.c
|
|
|
591f3a |
+++ autofs-5.1.4/lib/mounts.c
|
|
|
591f3a |
@@ -2803,14 +2803,30 @@ int try_remount(struct autofs_point *ap,
|
|
|
591f3a |
ap->flags &= ~MOUNT_FLAG_DIR_CREATED;
|
|
|
591f3a |
else
|
|
|
591f3a |
ap->flags |= MOUNT_FLAG_DIR_CREATED;
|
|
|
591f3a |
+ goto done;
|
|
|
591f3a |
+ }
|
|
|
591f3a |
+
|
|
|
591f3a |
+ me->flags &= ~MOUNT_FLAG_DIR_CREATED;
|
|
|
591f3a |
+ /* Direct or offset mount, key is full path */
|
|
|
591f3a |
+ if (MM_PARENT(me)->key[0] == '/') {
|
|
|
591f3a |
+ if (!is_mounted(MM_PARENT(me)->key, MNTS_REAL))
|
|
|
591f3a |
+ me->flags |= MOUNT_FLAG_DIR_CREATED;
|
|
|
591f3a |
} else {
|
|
|
591f3a |
- me->flags &= ~MOUNT_FLAG_DIR_CREATED;
|
|
|
591f3a |
- if (type == t_offset) {
|
|
|
591f3a |
- if (!is_mounted(MM_PARENT(me)->key, MNTS_REAL))
|
|
|
591f3a |
- me->flags |= MOUNT_FLAG_DIR_CREATED;
|
|
|
591f3a |
+ char *p_key = MM_PARENT(me)->key;
|
|
|
591f3a |
+ char mp[PATH_MAX + 1];
|
|
|
591f3a |
+ int len;
|
|
|
591f3a |
+
|
|
|
591f3a |
+ len = mount_fullpath(mp, PATH_MAX, ap->path, ap->len, p_key);
|
|
|
591f3a |
+ if (len > PATH_MAX) {
|
|
|
591f3a |
+ /* This should never happen due to earlier checks */
|
|
|
591f3a |
+ error(ap->logopt, "mountpoint path too long");
|
|
|
591f3a |
+ return 0;
|
|
|
591f3a |
}
|
|
|
591f3a |
- }
|
|
|
591f3a |
|
|
|
591f3a |
+ if (!is_mounted(mp, MNTS_REAL))
|
|
|
591f3a |
+ me->flags |= MOUNT_FLAG_DIR_CREATED;
|
|
|
591f3a |
+ }
|
|
|
591f3a |
+done:
|
|
|
591f3a |
/*
|
|
|
591f3a |
* Either we opened the mount or we're re-reading the map.
|
|
|
591f3a |
* If we opened the mount and ioctlfd is not -1 we have
|