From: Thibault Godouet Date: Sat, 7 Sep 2002 13:07:48 +0000 (+0000) Subject: chdir to / before running sendmail X-Git-Tag: ver2_9_4~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9099452bfdf069a454a484cce17b3888c02fc16e;p=thirdparty%2Ffcron.git chdir to / before running sendmail --- 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);