Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 130701790bf2d95e902edf16031ff596 > files > 204

autofs-5.0.1-0.rc2.164.el5_8.src.rpm

---
 modules/lookup_program.c |    4 ++++
 1 file changed, 4 insertions(+)

--- autofs-5.0.1.orig/modules/lookup_program.c
+++ autofs-5.0.1/modules/lookup_program.c
@@ -221,6 +221,10 @@ int lookup_mount(struct autofs_point *ap
 		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 */
 	}