aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorIan Kent <raven@themaw.net>2017-10-12 09:50:06 +0800
committerIan Kent <raven@themaw.net>2017-10-27 20:16:55 +0800
commit0f12714f23cb13bc6a07fdc0a206f7a4df33e1f1 (patch)
treea18b3d6fc5effc1154db60e0c5a74f27968b46d2 /modules
parent709ad9a6935e036832858155f7092a050f7e3aac (diff)
downloadautofs-0f12714f23cb13bc6a07fdc0a206f7a4df33e1f1.tar.gz
autofs-5.1.3 - port option should not behave like nobind option
The "port=" option currently prevents bind mounting when the host corresponds to localhost or a local interface. But this interferes with cases where the "port" option needs to be used and bind mounting of local mounts is also required. So remove the age old hack of the "port" option preventing this in favour of explicitly requiring the "nobind" option. Signed-off-by: Ian Kent <raven@themaw.net>
Diffstat (limited to 'modules')
-rw-r--r--modules/mount_nfs.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c
index 63f16b19..5245d960 100644
--- a/modules/mount_nfs.c
+++ b/modules/mount_nfs.c
@@ -68,7 +68,6 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
struct host *this, *hosts = NULL;
unsigned int mount_default_proto, vers;
char *nfsoptions = NULL;
- const char *port_opt = NULL;
unsigned int flags = ap->flags &
(MOUNT_FLAG_RANDOM_SELECT | MOUNT_FLAG_USE_WEIGHT_ONLY);
int nobind = ap->flags & MOUNT_FLAG_NOBIND;
@@ -168,7 +167,6 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
port = atoi(optport);
if (port < 0)
port = 0;
- port_opt = cp;
} else if (_strncmp("proto=udp", cp, o_len) == 0 ||
_strncmp("udp", cp, o_len) == 0) {
vers &= ~TCP_SUPPORTED;
@@ -286,22 +284,13 @@ dont_probe:
if (!status)
existed = 0;
- /*
- * If any *port= option is specified, then we don't want
- * a bind mount. Use the "port" option if you want to
- * avoid attempting a local bind mount, such as when
- * tunneling NFS via localhost.
- */
- if (nfsoptions && *nfsoptions && !port_opt)
- port_opt = strstr(nfsoptions, "port=");
-
this = hosts;
while (this) {
char *loc;
/* Port option specified, don't try to bind */
if (!(nosymlink || nobind) &&
- !port_opt && this->proximity == PROXIMITY_LOCAL) {
+ this->proximity == PROXIMITY_LOCAL) {
/* Local host -- do a "bind" */
const char *bind_options = ro ? "ro" : "";