diff --git a/CHANGELOG b/CHANGELOG
index 7bf6a22..830a1cb 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -35,6 +35,7 @@
 - allow for older schemas that allow "*" as a key value.
 - update master map lexer to also allow "." in macro name.
 - allow for "#" and "@" in hostname validation for sshfs mounts.
+- set working directory to base of mount before invoking program map.
 
 20/2/2007 autofs-5.0.1
 ----------------------
diff --git a/modules/lookup_program.c b/modules/lookup_program.c
index 1cdbf80..2fd521a 100644
--- a/modules/lookup_program.c
+++ b/modules/lookup_program.c
@@ -202,6 +202,10 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void *
 		dup2(epipefd[1], STDERR_FILENO);
 		close(pipefd[1]);
 		close(epipefd[1]);
+		if (chdir(ap->path))
+			warn(ap->logopt,
+			     MODPREFIX "failed to set PWD to %s for map %s",
+			     ap->path, ctxt->mapname);
 		execl(ctxt->mapname, ctxt->mapname, name, NULL);
 		_exit(255);	/* execl() failed */
 	}