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

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