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

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