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

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