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

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