diff --git a/SOURCES/autofs-5.1.6-fix-autofs-mount-options-construction.patch b/SOURCES/autofs-5.1.6-fix-autofs-mount-options-construction.patch
new file mode 100644
index 0000000..27dbc3e
--- /dev/null
+++ b/SOURCES/autofs-5.1.6-fix-autofs-mount-options-construction.patch
@@ -0,0 +1,273 @@
+autofs-5.1.6 - fix autofs mount options construction
+
+From: Ian Kent <raven@themaw.net>
+
+There's an off by one length error in the autofs mount options
+construction.
+
+Consolidate the options construction into make_options_string() and
+use snprintf() to verify the options length calculation is correct.
+
+Signed-off-by: Ian Kent <raven@themaw.net>
+---
+ CHANGELOG         |    1 
+ daemon/direct.c   |   46 ++-----------------------
+ daemon/indirect.c |   23 +-----------
+ include/mounts.h  |    3 +
+ lib/mounts.c      |   98 +++++++++++++++++++++++++++++++++++++++++++++---------
+ 5 files changed, 92 insertions(+), 79 deletions(-)
+
+--- autofs-5.0.7.orig/CHANGELOG
++++ autofs-5.0.7/CHANGELOG
+@@ -354,6 +354,7 @@
+ - fix trailing dollar sun entry expansion.
+ - initialize struct addrinfo for getaddrinfo() calls.
+ - fix quoted string length calc in expandsunent().
++- fix autofs mount options construction.
+ 
+ 25/07/2012 autofs-5.0.7
+ =======================
+--- autofs-5.0.7.orig/daemon/direct.c
++++ autofs-5.0.7/daemon/direct.c
+@@ -347,39 +347,10 @@ int do_mount_autofs_direct(struct autofs
+ 	}
+ 
+ 	if (!mp->options) {
+-		mp->options = make_options_string(ap->path, ap->kpipefd, str_direct);
++		mp->options = make_options_string(ap->path,
++				ap->kpipefd, str_direct, ap->flags);
+ 		if (!mp->options)
+ 			return 0;
+-
+-		if ((ap->flags & MOUNT_FLAG_STRICTEXPIRE) &&
+-		    ((get_kver_major() == 5 && get_kver_minor() > 3) ||
+-		     (get_kver_major() > 5))) {
+-			char *tmp = realloc(mp->options, strlen(mp->options) + 12);
+-			if (tmp) {
+-				strcat(tmp, ",strictexpire");
+-				mp->options = tmp;
+-			}
+-		}
+-
+-		if ((ap->flags & MOUNT_FLAG_IGNORE) &&
+-		    ((get_kver_major() == 5 && get_kver_minor() > 4) ||
+-		     (get_kver_major() > 5))) {
+-			char *tmp = realloc(mp->options, strlen(mp->options) + 7);
+-			if (tmp) {
+-				strcat(tmp, ",ignore");
+-				mp->options = tmp;
+-			}
+-		}
+-
+-		if ((ap->flags & MOUNT_FLAG_IGNORE) &&
+-		    ((get_kver_major() == 5 && get_kver_minor() > 4) ||
+-		     (get_kver_major() > 5))) {
+-			char *tmp = realloc(mp->options, strlen(mp->options) + 7);
+-			if (tmp) {
+-				strcat(tmp, ",ignore");
+-				mp->options = tmp;
+-			}
+-		}
+ 	}
+ 
+ 	/* In case the directory doesn't exist, try to mkdir it */
+@@ -682,19 +653,10 @@ int mount_autofs_offset(struct autofs_po
+ 	}
+ 
+ 	if (!mp->options) {
+-		mp->options = make_options_string(ap->path, ap->kpipefd, str_offset);
++		mp->options = make_options_string(ap->path,
++				ap->kpipefd, str_offset, ap->flags);
+ 		if (!mp->options)
+ 			return MOUNT_OFFSET_OK;
+-
+-		if ((ap->flags & MOUNT_FLAG_STRICTEXPIRE) &&
+-		    ((get_kver_major() == 5 && get_kver_minor() > 3) ||
+-		     (get_kver_major() > 5))) {
+-			char *tmp = realloc(mp->options, strlen(mp->options) + 12);
+-			if (tmp) {
+-				strcat(tmp, ",strictexpire");
+-				mp->options = tmp;
+-			}
+-		}
+ 	}
+ 
+ 	strcpy(mountpoint, root);
+--- autofs-5.0.7.orig/daemon/indirect.c
++++ autofs-5.0.7/daemon/indirect.c
+@@ -77,32 +77,13 @@ static int do_mount_autofs_indirect(stru
+ 		}
+ 	}
+ 
+-	options = make_options_string(ap->path, ap->kpipefd, str_indirect);
++	options = make_options_string(ap->path,
++				ap->kpipefd, str_indirect, ap->flags);
+ 	if (!options) {
+ 		error(ap->logopt, "options string error");
+ 		goto out_err;
+ 	}
+ 
+-	if ((ap->flags & MOUNT_FLAG_STRICTEXPIRE) &&
+-	    ((get_kver_major() == 5 && get_kver_minor() > 3) ||
+-	     (get_kver_major() > 5))) {
+-		char *tmp = realloc(options, strlen(options) + 12);
+-		if (tmp) {
+-			strcat(tmp, ",strictexpire");
+-			options = tmp;
+-		}
+-	}
+-
+-	if ((ap->flags & MOUNT_FLAG_IGNORE) &&
+-	    ((get_kver_major() == 5 && get_kver_minor() > 4) ||
+-	     (get_kver_major() > 5))) {
+-		char *tmp = realloc(options, strlen(options) + 7);
+-		if (tmp) {
+-			strcat(tmp, ",ignore");
+-			options = tmp;
+-		}
+-	}
+-
+ 	/* In case the directory doesn't exist, try to mkdir it */
+ 	if (mkdir_path(root, 0555) < 0) {
+ 		if (errno != EEXIST && errno != EROFS) {
+--- autofs-5.0.7.orig/include/mounts.h
++++ autofs-5.0.7/include/mounts.h
+@@ -94,7 +94,8 @@ void free_amd_entry_list(struct list_hea
+ unsigned int query_kproto_ver(void);
+ unsigned int get_kver_major(void);
+ unsigned int get_kver_minor(void);
+-char *make_options_string(char *path, int kernel_pipefd, const char *extra);
++char *make_options_string(char *path, int pipefd,
++			  const char *type, unsigned int flags);
+ char *make_mnt_name_string(char *path);
+ int ext_mount_add(struct list_head *, const char *, unsigned int);
+ int ext_mount_remove(struct list_head *, const char *);
+--- autofs-5.0.7.orig/lib/mounts.c
++++ autofs-5.0.7/lib/mounts.c
+@@ -597,43 +597,111 @@ void free_amd_entry_list(struct list_hea
+ 	}
+ }
+ 
++static int cacl_max_options_len(unsigned int flags)
++{
++	unsigned int kver_major = get_kver_major();
++	unsigned int kver_minor = get_kver_minor();
++	int max_len;
++
++	/* %d and %u are maximum lenght of 10 and mount type is maximum
++	 * length of 9 (e. ",indirect").
++	 * The base temaplate is "fd=%d,pgrp=%u,minproto=5,maxproto=%d"
++	 * plus the length of mount type plus 1 for the NULL.
++	 */
++	max_len = 79 + 1;
++
++	if (kver_major < 5 || (kver_major == 5 && kver_minor < 4))
++		goto out;
++
++	/* maybe add ",strictexpire" */
++	if (flags & MOUNT_FLAG_STRICTEXPIRE)
++		max_len += 13;
++
++	if (kver_major == 5 && kver_minor < 5)
++		goto out;
++
++	/* maybe add ",ignore" */
++	if (flags & MOUNT_FLAG_IGNORE)
++		max_len += 7;
++out:
++	return max_len;
++}
++
+ /*
+  * Make common autofs mount options string
+  */
+-char *make_options_string(char *path, int pipefd, const char *extra)
++char *make_options_string(char *path, int pipefd,
++			  const char *type, unsigned int flags)
+ {
++	unsigned int kver_major = get_kver_major();
++	unsigned int kver_minor = get_kver_minor();
+ 	char *options;
+-	int len;
++	int max_len, len, new;
+ 
+-	options = malloc(MAX_OPTIONS_LEN + 1);
++	max_len = cacl_max_options_len(flags);
++
++	options = malloc(max_len);
+ 	if (!options) {
+ 		logerr("can't malloc options string");
+ 		return NULL;
+ 	}
+ 
+-	if (extra) 
+-		len = snprintf(options, MAX_OPTIONS_LEN,
++	if (type)
++		len = snprintf(options, max_len,
+ 				options_template_extra,
+ 				pipefd, (unsigned) getpgrp(),
+-				AUTOFS_MAX_PROTO_VERSION, extra);
++				AUTOFS_MAX_PROTO_VERSION, type);
+ 	else
+-		len = snprintf(options, MAX_OPTIONS_LEN, options_template,
++		len = snprintf(options, max_len, options_template,
+ 			pipefd, (unsigned) getpgrp(),
+ 			AUTOFS_MAX_PROTO_VERSION);
+ 
+-	if (len >= MAX_OPTIONS_LEN) {
+-		logerr("buffer to small for options - truncated");
+-		len = MAX_OPTIONS_LEN - 1;
++	if (len < 0)
++		goto error_out;
++
++	if (len >= max_len)
++		goto truncated;
++
++	if (kver_major < 5 || (kver_major == 5 && kver_minor < 4))
++		goto out;
++
++	/* maybe add ",strictexpire" */
++	if (flags & MOUNT_FLAG_STRICTEXPIRE) {
++		new = snprintf(options + len,
++			       max_len, "%s", ",strictexpire");
++		if (new < 0)
++		       goto error_out;
++		len += new;
++		if (len >= max_len)
++			goto truncated;
+ 	}
+ 
+-	if (len < 0) {
+-		logerr("failed to malloc autofs mount options for %s", path);
+-		free(options);
+-		return NULL;
++	if (kver_major == 5 && kver_minor < 5)
++		goto out;
++
++	/* maybe add ",ignore" */
++	if (flags & MOUNT_FLAG_IGNORE) {
++		new = snprintf(options + len,
++			       max_len, "%s", ",ignore");
++		if (new < 0)
++		       goto error_out;
++		len += new;
++		if (len >= max_len)
++			goto truncated;
+ 	}
++out:
+ 	options[len] = '\0';
+-
+ 	return options;
++
++truncated:
++	logerr("buffer to small for options - truncated");
++	len = max_len -1;
++	goto out;
++
++error_out:
++	logerr("error constructing mount options string for %s", path);
++	free(options);
++	return NULL;
+ }
+ 
+ char *make_mnt_name_string(char *path)
diff --git a/SOURCES/autofs-5.1.6-fix-direct-mount-unlink_mount_tree-path.patch b/SOURCES/autofs-5.1.6-fix-direct-mount-unlink_mount_tree-path.patch
new file mode 100644
index 0000000..c2ad632
--- /dev/null
+++ b/SOURCES/autofs-5.1.6-fix-direct-mount-unlink_mount_tree-path.patch
@@ -0,0 +1,40 @@
+autofs-5.1.6 - fix direct mount unlink_mount_tree() path
+
+From: Ian Kent <raven@themaw.net>
+
+Oops!
+
+The path used if unlink_mount_tree() is called for direct mount entries
+is not correct, fix it.
+
+Note: the mount table handling has changed and using the --force option
+with automount when direct mount maps are large will result in somewhat
+larger overhead.
+
+Signed-off-by: Ian Kent <raven@themaw.net>
+---
+ CHANGELOG       |    1 +
+ daemon/direct.c |    2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+--- autofs-5.0.7.orig/CHANGELOG
++++ autofs-5.0.7/CHANGELOG
+@@ -355,6 +355,7 @@
+ - initialize struct addrinfo for getaddrinfo() calls.
+ - fix quoted string length calc in expandsunent().
+ - fix autofs mount options construction.
++- fix direct mount unlink_mount_tree() path.
+ 
+ 25/07/2012 autofs-5.0.7
+ =======================
+--- autofs-5.0.7.orig/daemon/direct.c
++++ autofs-5.0.7/daemon/direct.c
+@@ -310,7 +310,7 @@ int do_mount_autofs_direct(struct autofs
+ 			return 0;
+ 		}
+ 
+-		ret = unlink_mount_tree(ap, ap->path);
++		ret = unlink_mount_tree(ap, me->key);
+ 		if (!ret) {
+ 			error(ap->logopt,
+ 			     "already mounted as other than autofs "
diff --git a/SOURCES/autofs-5.1.6-fix-incorrect-logical-compare-in-unlink_mount_tree.patch b/SOURCES/autofs-5.1.6-fix-incorrect-logical-compare-in-unlink_mount_tree.patch
new file mode 100644
index 0000000..2dfb139
--- /dev/null
+++ b/SOURCES/autofs-5.1.6-fix-incorrect-logical-compare-in-unlink_mount_tree.patch
@@ -0,0 +1,33 @@
+autofs-5.1.6 - fix incorrect logical compare in unlink_mount_tree()
+
+From: Ian Kent <raven@themaw.net>
+
+Fix silly mistake using or instead of and in unlink_mount_tree().
+
+Signed-off-by: Ian Kent <raven@themaw.net>
+---
+ CHANGELOG    |    1 +
+ lib/mounts.c |    2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+--- autofs-5.0.7.orig/CHANGELOG
++++ autofs-5.0.7/CHANGELOG
+@@ -357,6 +357,7 @@
+ - fix autofs mount options construction.
+ - fix direct mount unlink_mount_tree() path.
+ - fix unlink mounts umount order.
++- fix incorrect logical compare in unlink_mount_tree().
+ 
+ 25/07/2012 autofs-5.0.7
+ =======================
+--- autofs-5.0.7.orig/lib/mounts.c
++++ autofs-5.0.7/lib/mounts.c
+@@ -960,7 +960,7 @@ int unlink_mount_tree(struct autofs_poin
+ 		return 0;
+ 
+ 	for (mnt = mnts; mnt; mnt = mnt->next) {
+-		if (mnt->flags | MNTS_AUTOFS)
++		if (mnt->flags & MNTS_AUTOFS)
+ 			rv = umount2(mnt->mp, MNT_DETACH);
+ 		else
+ 			rv = spawn_umount(ap->logopt, "-l", mnt->mp, NULL);
diff --git a/SOURCES/autofs-5.1.6-fix-quoted-string-length-calc-in-expandsunent.patch b/SOURCES/autofs-5.1.6-fix-quoted-string-length-calc-in-expandsunent.patch
new file mode 100644
index 0000000..aae844e
--- /dev/null
+++ b/SOURCES/autofs-5.1.6-fix-quoted-string-length-calc-in-expandsunent.patch
@@ -0,0 +1,44 @@
+autofs-5.1.6 - fix quoted string length calc in expandsunent()
+
+From: Ian Kent <raven@themaw.net>
+
+The expandsunent() function in modules/parse_sun.c fails to properly
+handle the ending " in a quoted string causing the length calculation
+to not account for the ending quote and also doesn't properly account
+for the remainder of the string being expanded.
+
+Also, when called again (after being called to get the length) the
+allocated buffer is too small leading to out of bounds accesses.
+
+Signed-off-by: Ian Kent <raven@themaw.net>
+---
+ CHANGELOG           |    1 +
+ modules/parse_sun.c |    6 ++++--
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+--- autofs-5.0.7.orig/CHANGELOG
++++ autofs-5.0.7/CHANGELOG
+@@ -353,6 +353,7 @@
+ - also use strictexpire for offsets.
+ - fix trailing dollar sun entry expansion.
+ - initialize struct addrinfo for getaddrinfo() calls.
++- fix quoted string length calc in expandsunent().
+ 
+ 25/07/2012 autofs-5.0.7
+ =======================
+--- autofs-5.0.7.orig/modules/parse_sun.c
++++ autofs-5.0.7/modules/parse_sun.c
+@@ -213,9 +213,11 @@ int expandsunent(const char *src, char *
+ 					*dst++ = *src;
+ 				src++;
+ 			}
+-			if (*src && dst) {
++			if (*src) {
+ 				len++;
+-				*dst++ = *src++;
++				if (dst)
++					*dst++ = *src;
++				src++;
+ 			}
+ 			break;
+ 
diff --git a/SOURCES/autofs-5.1.6-fix-unlink-mounts-umount-order.patch b/SOURCES/autofs-5.1.6-fix-unlink-mounts-umount-order.patch
new file mode 100644
index 0000000..1eb8005
--- /dev/null
+++ b/SOURCES/autofs-5.1.6-fix-unlink-mounts-umount-order.patch
@@ -0,0 +1,89 @@
+autofs-5.1.6 - fix unlink mounts umount order
+
+From: Ian Kent <raven@themaw.net>
+
+The recent changes to mount table handling to support the "ignore"
+autofs pseudo option resulted in the incorrect umount order being used
+in the unlink_mount_tree() function.
+
+To fix this change unlink_mount_tree() to use the existing get_mnt_list()
+function to construct a correctly ordered list for the umounts.
+
+Signed-off-by: Ian Kent <raven@themaw.net>
+---
+ CHANGELOG    |    1 +
+ lib/mounts.c |   39 +++++++++------------------------------
+ 2 files changed, 10 insertions(+), 30 deletions(-)
+
+--- autofs-5.0.7.orig/CHANGELOG
++++ autofs-5.0.7/CHANGELOG
+@@ -356,6 +356,7 @@
+ - fix quoted string length calc in expandsunent().
+ - fix autofs mount options construction.
+ - fix direct mount unlink_mount_tree() path.
++- fix unlink mounts umount order.
+ 
+ 25/07/2012 autofs-5.0.7
+ =======================
+--- autofs-5.0.7.orig/lib/mounts.c
++++ autofs-5.0.7/lib/mounts.c
+@@ -952,42 +952,21 @@ local_getmntent_r(FILE *tab, struct mnte
+ 
+ int unlink_mount_tree(struct autofs_point *ap, const char *mp)
+ {
+-	FILE *tab;
+-	struct mntent *mnt;
+-	struct mntent mnt_wrk;
+-	char buf[PATH_MAX * 3];
+-	unsigned int mp_len = strlen(mp);
++	struct mnt_list *mnts, *mnt;
+ 	int rv, ret = 1;
+ 
+-	tab = open_fopen_r(_PROC_MOUNTS);
+-	if (!tab) {
+-		char *estr = strerror_r(errno, buf, PATH_MAX - 1);
+-		logerr("fopen: %s", estr);
++	mnts = get_mnt_list(mp, 1);
++	if (!mnts)
+ 		return 0;
+-	}
+-
+-	while ((mnt = local_getmntent_r(tab, &mnt_wrk, buf, PATH_MAX * 3))) {
+-		unsigned int mnt_dir_len;
+-		int is_autofs;
+-
+-		if (strncmp(mnt->mnt_dir, mp, mp_len))
+-			continue;
+-
+-		mnt_dir_len = strlen(mnt->mnt_dir);
+-		is_autofs = !strcmp(mnt->mnt_type, "autofs");
+-
+-		if (mnt_dir_len == mp_len && !is_autofs) {
+-			ret = 0;
+-			break;
+-		}
+ 
+-		if (is_autofs)
+-			rv = umount2(mnt->mnt_dir, MNT_DETACH);
++	for (mnt = mnts; mnt; mnt = mnt->next) {
++		if (mnt->flags | MNTS_AUTOFS)
++			rv = umount2(mnt->mp, MNT_DETACH);
+ 		else
+-			rv = spawn_umount(ap->logopt, "-l", mnt->mnt_dir, NULL);
++			rv = spawn_umount(ap->logopt, "-l", mnt->mp, NULL);
+ 		if (rv == -1) {
+ 			debug(ap->logopt,
+-			      "can't unlink %s from mount tree", mnt->mnt_dir);
++			      "can't unlink %s from mount tree", mnt->mp);
+ 
+ 			switch (errno) {
+ 			case EINVAL:
+@@ -1003,7 +982,7 @@ int unlink_mount_tree(struct autofs_poin
+ 			}
+ 		}
+ 	}
+-	fclose(tab);
++	free_mnt_list(mnts);
+ 
+ 	return ret;
+ }
diff --git a/SOURCES/autofs-5.1.6-initialize-struct-addrinfo-for-getaddrinfo-calls.patch b/SOURCES/autofs-5.1.6-initialize-struct-addrinfo-for-getaddrinfo-calls.patch
new file mode 100644
index 0000000..85aee1d
--- /dev/null
+++ b/SOURCES/autofs-5.1.6-initialize-struct-addrinfo-for-getaddrinfo-calls.patch
@@ -0,0 +1,104 @@
+autofs-5.1.6 - initialize struct addrinfo for getaddrinfo() calls
+
+From: Ian Kent <raven@themaw.net>
+
+The getaddrinfo() call may have become more fussy about initialization
+of the passed in struct addrinfo that receives the results.
+
+It's good practice to initialize it prior to the gataddrinfo() call just
+in case.
+
+Signed-off-by: Ian Kent <raven@themaw.net>
+---
+ CHANGELOG            |    1 +
+ lib/parse_subs.c     |    1 +
+ lib/rpc_subs.c       |    1 +
+ modules/dclist.c     |    1 +
+ modules/parse_amd.c  |    3 +++
+ modules/replicated.c |    2 ++
+ 6 files changed, 9 insertions(+)
+
+--- autofs-5.0.7.orig/CHANGELOG
++++ autofs-5.0.7/CHANGELOG
+@@ -352,6 +352,7 @@
+ - fix missing initialization of autofs_point flags.
+ - also use strictexpire for offsets.
+ - fix trailing dollar sun entry expansion.
++- initialize struct addrinfo for getaddrinfo() calls.
+ 
+ 25/07/2012 autofs-5.0.7
+ =======================
+--- autofs-5.0.7.orig/lib/parse_subs.c
++++ autofs-5.0.7/lib/parse_subs.c
+@@ -474,6 +474,7 @@ unsigned int get_network_proximity(const
+ 	hints.ai_socktype = SOCK_DGRAM;
+ 	hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME;
+ 
++	ni = NULL;
+ 	ret = getaddrinfo(name_or_num, NULL, &hints, &ni);
+ 	if (ret) {
+ 		logerr("hostname lookup for %s failed: %s",
+--- autofs-5.0.7.orig/lib/rpc_subs.c
++++ autofs-5.0.7/lib/rpc_subs.c
+@@ -699,6 +699,7 @@ static int create_client(struct conn_inf
+ 	else
+ 		hints.ai_socktype = SOCK_STREAM;
+ 
++	ai = NULL;
+ 	ret = getaddrinfo(info->host, NULL, &hints, &ai);
+ 	if (ret) {
+ 		error(LOGOPT_ANY,
+--- autofs-5.0.7.orig/modules/dclist.c
++++ autofs-5.0.7/modules/dclist.c
+@@ -355,6 +355,7 @@ static char *getdnsdomainname(unsigned i
+ 	hints.ai_family = AF_UNSPEC;
+ 	hints.ai_socktype = SOCK_DGRAM;
+ 
++	ni = NULL;
+ 	ret = getaddrinfo(name, NULL, &hints, &ni);
+ 	if (ret) {
+ 		error(logopt,
+--- autofs-5.0.7.orig/modules/parse_amd.c
++++ autofs-5.0.7/modules/parse_amd.c
+@@ -269,6 +269,7 @@ static int match_my_name(struct autofs_p
+ 	hints.ai_socktype = SOCK_DGRAM;
+ 
+ 	/* Get host canonical name */
++	cni = NULL;
+ 	ret = getaddrinfo(v->val, NULL, &hints, &cni);
+ 	if (ret) {
+ 		error(logopt, MODPREFIX
+@@ -280,6 +281,7 @@ static int match_my_name(struct autofs_p
+ 	hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME;
+ 
+ 	/* Resolve comparison name to its names and compare */
++	ni = NULL;
+ 	ret = getaddrinfo(exp_name, NULL, &hints, &ni);
+ 	if (ret) {
+ 		error(logopt, MODPREFIX
+@@ -777,6 +779,7 @@ static char *normalize_hostname(unsigned
+ 		hints.ai_family = AF_UNSPEC;
+ 		hints.ai_socktype = SOCK_DGRAM;
+ 
++		ni = NULL;
+ 		ret = getaddrinfo(host, NULL, &hints, &ni);
+ 		if (ret) {
+ 			error(logopt, MODPREFIX
+--- autofs-5.0.7.orig/modules/replicated.c
++++ autofs-5.0.7/modules/replicated.c
+@@ -923,6 +923,7 @@ static int add_host_addrs(struct host **
+ 	hints.ai_family = AF_UNSPEC;
+ 	hints.ai_socktype = SOCK_DGRAM;
+ 
++	ni = NULL;
+ 	ret = getaddrinfo(name, NULL, &hints, &ni);
+ 	if (ret)
+ 		goto try_name;
+@@ -943,6 +944,7 @@ try_name:
+ 	hints.ai_family = AF_UNSPEC;
+ 	hints.ai_socktype = SOCK_DGRAM;
+ 
++	ni = NULL;
+ 	ret = getaddrinfo(name, NULL, &hints, &ni);
+ 	if (ret) {
+ 		error(LOGOPT_ANY,
diff --git a/SOURCES/autofs-5.1.6-mount_nfs_c-fix-local-rdma-share-not-mounting.patch b/SOURCES/autofs-5.1.6-mount_nfs_c-fix-local-rdma-share-not-mounting.patch
new file mode 100644
index 0000000..2bfbb4d
--- /dev/null
+++ b/SOURCES/autofs-5.1.6-mount_nfs_c-fix-local-rdma-share-not-mounting.patch
@@ -0,0 +1,38 @@
+autofs-5.1.6 - mount_nfs.c fix local rdma share not mounting
+
+From: Achilles Gaikwad <agaikwad@redhat.com>
+
+When using the same system as nfs-server and nfs-client, and
+using `nobind` option for autofs we would fall to the code where
+we let `mount.nfs(8)` to handle the mount. However, when the
+nfs-server and the nfs-client is the same system we end up calling
+`rpc_ping` which gives negative return code. Due to this we fall to
+the label next: and never attempt a mount of nfs share.
+This patch fixes this BUG by not probing rpc_ping if we're
+using rdma.
+
+Signed-off-by: Achilles Gaikwad <agaikwad@redhat.com>
+Signed-off-by: Ian Kent <raven@themaw.net>
+---
+ modules/mount_nfs.c |    9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+--- autofs-5.0.7.orig/modules/mount_nfs.c
++++ autofs-5.0.7/modules/mount_nfs.c
+@@ -366,9 +366,14 @@ dont_probe:
+ 		 */
+ 		if (this->proximity == PROXIMITY_LOCAL) {
+ 			char *host = this->name ? this->name : "localhost";
+-			int ret;
++			int ret = 1;
+ 
+-			ret = rpc_ping(host, port, vers, 2, 0, RPC_CLOSE_DEFAULT);
++			/* If we're using RDMA, rpc_ping will fail when
++			 * nfs-server is local. Therefore, don't probe
++			 * when we're using RDMA.
++			 */
++			if(!rdma)
++				ret = rpc_ping(host, port, vers, 2, 0, RPC_CLOSE_DEFAULT);
+ 			if (ret <= 0)
+ 				goto next;
+ 		}
diff --git a/SPECS/autofs.spec b/SPECS/autofs.spec
index ca6f07e..62e01b8 100644
--- a/SPECS/autofs.spec
+++ b/SPECS/autofs.spec
@@ -8,7 +8,7 @@
 Summary: A tool for automatically mounting and unmounting filesystems
 Name: autofs
 Version: 5.0.7
-Release: 113%{?dist}
+Release: 116%{?dist}
 Epoch: 1
 License: GPLv2+
 Group: System Environment/Daemons
@@ -522,6 +522,17 @@ Patch920: autofs-5.1.5-fix-missing-initialization-of-autofs_point-flags.patch
 Patch921: autofs-5.1.5-also-use-strictexpire-for-offsets.patch
 Patch922: autofs-5.1.6-fix-trailing-dollar-sun-entry-expansion.patch
 
+Patch923: autofs-5.1.6-initialize-struct-addrinfo-for-getaddrinfo-calls.patch
+Patch924: autofs-5.1.6-fix-quoted-string-length-calc-in-expandsunent.patch
+Patch925: autofs-5.1.6-fix-autofs-mount-options-construction.patch
+
+Patch926: autofs-5.1.6-fix-direct-mount-unlink_mount_tree-path.patch
+Patch927: autofs-5.1.6-fix-unlink-mounts-umount-order.patch
+
+Patch928: autofs-5.1.6-mount_nfs_c-fix-local-rdma-share-not-mounting.patch
+
+Patch929: autofs-5.1.6-fix-incorrect-logical-compare-in-unlink_mount_tree.patch
+
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 %if %{with_systemd}
 BuildRequires: systemd-units
@@ -1082,6 +1093,17 @@ echo %{version}-%{release} > .version
 %patch921 -p1
 %patch922 -p1
 
+%patch923 -p1
+%patch924 -p1
+%patch925 -p1
+
+%patch926 -p1
+%patch927 -p1
+
+%patch928 -p1
+
+%patch929 -p1
+
 %build
 LDFLAGS=-Wl,-z,now
 %configure --disable-mount-locking \
@@ -1178,6 +1200,30 @@ fi
 %dir /etc/auto.master.d
 
 %changelog
+* Fri Oct 30 2020 Ian Kent <ikent@redhat.com> - 5.0.7-116
+- bz1885511 - automount force unlink option (-F) does not work as expected
+  on autofs-5.0.7-109.el7
+  - fix incorrect logical compare in unlink_mount_tree().
+- Related: rhbz#1885511
+
+* Fri Oct 30 2020 Ian Kent <ikent@redhat.com> - 5.0.7-115
+- bz1885511 - automount force unlink option (-F) does not work as expected
+  on autofs-5.0.7-109.el7
+  - fix direct mount unlink_mount_tree() path.
+  - fix unlink mounts umount order.
+- bz1858586 - autofs share doesn't mount when using nobind over RDMA where
+  nfs-server and nfs-client are the same systems
+  - mount_nfs.c fix local rdma share not mounting.
+- Resolves: rhbz#1885511 rhbz#1858586
+
+* Fri Jun 26 2020 Ian Kent <ikent@redhat.com> - 5.0.7-114
+- bz1847762 - automount program crashes with "malloc(): invalid next size
+  (unsorted)
+  - initialize struct addrinfo for getaddrinfo() calls.
+  - fix quoted string length calc in expandsunent().
+  - fix autofs mount options construction.
+-Resolves: rhbz#1847762
+
 * Mon Mar 30 2020 Ian Kent <ikent@redhat.com> - 5.0.7-113
 - Fix changelog revision for previous 2 commits.
 - Related: rhbz#1806514 rhbz#1818664