|
|
9a499a |
autofs-5.1.7 - fix is mounted check on non existent path
|
|
|
9a499a |
|
|
|
9a499a |
From: Ian Kent <raven@themaw.net>
|
|
|
9a499a |
|
|
|
9a499a |
When checking if a path is a mount point the case of a non-existent path
|
|
|
9a499a |
was not being handled.
|
|
|
9a499a |
|
|
|
9a499a |
Signed-off-by: Ian Kent <raven@themaw.net>
|
|
|
9a499a |
---
|
|
|
9a499a |
CHANGELOG | 1 +
|
|
|
9a499a |
lib/dev-ioctl-lib.c | 3 +++
|
|
|
9a499a |
lib/mounts.c | 12 +++++++++++-
|
|
|
9a499a |
3 files changed, 15 insertions(+), 1 deletion(-)
|
|
|
9a499a |
|
|
|
9a499a |
--- autofs-5.1.4.orig/CHANGELOG
|
|
|
9a499a |
+++ autofs-5.1.4/CHANGELOG
|
|
|
9a499a |
@@ -5,6 +5,7 @@
|
|
|
9a499a |
- use sprintf() when constructing hosts mapent.
|
|
|
9a499a |
- fix mnts_remove_amdmount() uses wrong list.
|
|
|
9a499a |
- eliminate cache_lookup_offset() usage.
|
|
|
9a499a |
+- fix is mounted check on non existent path.
|
|
|
9a499a |
|
|
|
9a499a |
xx/xx/2018 autofs-5.1.5
|
|
|
9a499a |
- fix flag file permission.
|
|
|
9a499a |
--- autofs-5.1.4.orig/lib/dev-ioctl-lib.c
|
|
|
9a499a |
+++ autofs-5.1.4/lib/dev-ioctl-lib.c
|
|
|
9a499a |
@@ -759,6 +759,9 @@ static int dev_ioctl_ismountpoint(unsign
|
|
|
9a499a |
int save_errno = errno;
|
|
|
9a499a |
free_dev_ioctl_path(param);
|
|
|
9a499a |
errno = save_errno;
|
|
|
9a499a |
+ /* Path doesn't exist */
|
|
|
9a499a |
+ if (errno == ENOENT)
|
|
|
9a499a |
+ return 0;
|
|
|
9a499a |
return -1;
|
|
|
9a499a |
}
|
|
|
9a499a |
|
|
|
9a499a |
--- autofs-5.1.4.orig/lib/mounts.c
|
|
|
9a499a |
+++ autofs-5.1.4/lib/mounts.c
|
|
|
9a499a |
@@ -1645,8 +1645,18 @@ static int table_is_mounted(const char *
|
|
|
9a499a |
struct mntent mnt_wrk;
|
|
|
9a499a |
char buf[PATH_MAX * 3];
|
|
|
9a499a |
size_t mp_len = strlen(mp);
|
|
|
9a499a |
+ struct stat st;
|
|
|
9a499a |
FILE *tab;
|
|
|
9a499a |
- int ret = 0;
|
|
|
9a499a |
+ int ret;
|
|
|
9a499a |
+
|
|
|
9a499a |
+ ret = stat(mp, &st);
|
|
|
9a499a |
+ if (ret == -1) {
|
|
|
9a499a |
+ if (errno == ENOENT) {
|
|
|
9a499a |
+ /* Path does not exist */
|
|
|
9a499a |
+ return 0;
|
|
|
9a499a |
+ }
|
|
|
9a499a |
+ ret = 0;
|
|
|
9a499a |
+ }
|
|
|
9a499a |
|
|
|
9a499a |
if (!mp || !mp_len || mp_len >= PATH_MAX)
|
|
|
9a499a |
return 0;
|