From 6afa8ceaac52e10599370114b947e5723a9f363c Mon Sep 17 00:00:00 2001 From: Packit Bot Date: May 04 2021 22:13:46 +0000 Subject: Apply patch autofs-5.1.7-fix-mount_fullpath.patch patch_name: autofs-5.1.7-fix-mount_fullpath.patch present_in_specfile: true --- diff --git a/CHANGELOG b/CHANGELOG index e712965..9af5557 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -36,6 +36,7 @@ - add tree_mapent_add_node(). - add tree_mapent_delete_offsets(). - add tree_mapent_traverse_subtree(). +- fix mount_fullpath(). xx/xx/2018 autofs-5.1.5 - fix flag file permission. diff --git a/lib/mounts.c b/lib/mounts.c index 9f7811b..557f5e8 100644 --- a/lib/mounts.c +++ b/lib/mounts.c @@ -371,8 +371,10 @@ int mount_fullpath(char *fullpath, size_t max_len, /* Root offset of multi-mount or direct or offset mount. * Direct or offset mount, name (or root) is absolute path. */ - if (root[last] == '/' || *name == '/') + if (root[last] == '/') len = snprintf(fullpath, max_len, "%s", root); + else if (*name == '/') + len = snprintf(fullpath, max_len, "%s", name); else len = snprintf(fullpath, max_len, "%s/%s", root, name); diff --git a/modules/parse_amd.c b/modules/parse_amd.c index e7c86b6..a7ae3f5 100644 --- a/modules/parse_amd.c +++ b/modules/parse_amd.c @@ -1177,7 +1177,8 @@ static int do_generic_mount(struct autofs_point *ap, const char *name, * the automount filesystem. */ if (!is_mounted(entry->fs, MNTS_REAL)) { - ret = do_mount(ap, entry->fs, "/", 1, + ret = do_mount(ap, entry->fs, + entry->fs, strlen(entry->fs), target, entry->type, opts); if (ret) goto out; @@ -1227,7 +1228,8 @@ static int do_nfs_mount(struct autofs_point *ap, const char *name, mount_nfs->context); } else { if (!is_mounted(entry->fs, MNTS_REAL)) { - ret = mount_nfs->mount_mount(ap, entry->fs, "/", 1, + ret = mount_nfs->mount_mount(ap, entry->fs, + entry->fs, strlen(entry->fs), target, entry->type, opts, mount_nfs->context); if (ret)