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

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