Blame SOURCES/autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch

ab3a3d
autofs-5.0.7 - fix nobind sun escaped map entries
ab3a3d
ab3a3d
From: Ian Kent <ikent@redhat.com>
ab3a3d
ab3a3d
If a map contains a Sun colon escape to indicate the mount is a local
ab3a3d
file system and the "nobind" option is present there is no hostname in
ab3a3d
the mount location and the mount fails.
ab3a3d
---
ab3a3d
ab3a3d
 CHANGELOG           |    4 ++++
ab3a3d
 modules/mount_nfs.c |    5 +++--
ab3a3d
 2 files changed, 7 insertions(+), 2 deletions(-)
ab3a3d
ab3a3d
ab3a3d
diff --git a/CHANGELOG b/CHANGELOG
ab3a3d
index 67fdcec..faf4c80 100644
ab3a3d
--- a/CHANGELOG
ab3a3d
+++ b/CHANGELOG
ab3a3d
@@ -1,3 +1,7 @@
ab3a3d
+??/??/2012 autofs-5.0.8
ab3a3d
+=======================
ab3a3d
+- fix nobind sun escaped map entries.
ab3a3d
+
ab3a3d
 25/07/2012 autofs-5.0.7
ab3a3d
 =======================
ab3a3d
 - fix ipv6 name for lookup fix.
ab3a3d
diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c
ab3a3d
index 9b8e5f1..bbbb1de 100644
ab3a3d
--- a/modules/mount_nfs.c
ab3a3d
+++ b/modules/mount_nfs.c
ab3a3d
@@ -263,13 +263,14 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
ab3a3d
 			} else
ab3a3d
 				strcpy(loc, n_addr);
ab3a3d
 		} else {
ab3a3d
-			loc = malloc(strlen(this->name) + strlen(this->path) + 2);
ab3a3d
+			char *host = this->name ? this->name : "localhost";
ab3a3d
+			loc = malloc(strlen(host) + strlen(this->path) + 2);
ab3a3d
 			if (!loc) {
ab3a3d
 				char *estr = strerror_r(errno, buf, MAX_ERR_BUF);
ab3a3d
 				error(ap->logopt, "malloc: %s", estr);
ab3a3d
 				goto forced_fail;
ab3a3d
 			}
ab3a3d
-			strcpy(loc, this->name);
ab3a3d
+			strcpy(loc, host);
ab3a3d
 		}
ab3a3d
 		strcat(loc, ":");
ab3a3d
 		strcat(loc, this->path);