Blame SOURCES/autofs-5.0.9-amd-lookup-add-remopts-handling.patch

304803
autofs-5.0.9 - amd lookup add remopts handling
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
304803
---
304803
 modules/parse_amd.c |   10 ++++++++--
304803
 1 file changed, 8 insertions(+), 2 deletions(-)
304803
304803
diff --git a/modules/parse_amd.c b/modules/parse_amd.c
304803
index bf673b3..4cebce8 100644
304803
--- a/modules/parse_amd.c
304803
+++ b/modules/parse_amd.c
304803
@@ -988,20 +988,26 @@ static int do_nfs_mount(struct autofs_point *ap, const char *name,
304803
 			struct amd_entry *entry, unsigned int flags)
304803
 {
304803
 	char target[PATH_MAX + 1];
304803
+	unsigned int proximity;
304803
+	char *opts = entry->opts;
304803
 	int ret = 0;
304803
 
304803
 	strcpy(target, entry->rhost);
304803
 	strcat(target, ":");
304803
 	strcat(target, entry->rfs);
304803
 
304803
+	proximity = get_network_proximity(entry->rhost);
304803
+	if (proximity == PROXIMITY_OTHER && entry->remopts)
304803
+		opts = entry->remopts;
304803
+
304803
 	if (!entry->sublink) {
304803
 		ret = mount_nfs->mount_mount(ap, ap->path, name, strlen(name),
304803
-					     target, entry->type, entry->opts,
304803
+					     target, entry->type, opts,
304803
 					     mount_nfs->context);
304803
 	} else {
304803
 		if (!is_mounted(_PATH_MOUNTED, entry->fs, MNTS_REAL)) {
304803
 			ret = mount_nfs->mount_mount(ap, entry->fs, "/", 1,
304803
-						target, entry->type, entry->opts,
304803
+						target, entry->type, opts,
304803
 						mount_nfs->context);
304803
 			if (ret)
304803
 				goto out;