From 90b63d621a9e5cfe42a9d96ae73c03ea7a39c99e Mon Sep 17 00:00:00 2001 From: thib Date: Sat, 7 Sep 2002 13:07:48 +0000 Subject: [PATCH] chdir to / before running sendmail --- job.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/job.c b/job.c index 9ec9130..a7881de 100644 --- a/job.c +++ b/job.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: job.c,v 1.52 2002-08-29 17:30:54 thib Exp $ */ + /* $Id: job.c,v 1.53 2002-09-07 13:07:48 thib Exp $ */ #include "fcron.h" @@ -449,6 +449,9 @@ launch_mailer(CL *line, FILE *mailf) xcloselog(); + if ( chdir("/") < 0 ) + die_e("Could not chdir to /"); + /* run sendmail with mail file as standard input */ execl(sendmail, sendmail, SENDMAIL_ARGS, line->cl_mailto, NULL); error_e("Can't find \"%s\". Trying a execlp(\"sendmail\")", sendmail); -- 2.50.1