--- 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 */ }