]> granicus.if.org Git - fcron/commitdiff
chdir to / before running sendmail
authorthib <thib>
Sat, 7 Sep 2002 13:07:48 +0000 (13:07 +0000)
committerthib <thib>
Sat, 7 Sep 2002 13:07:48 +0000 (13:07 +0000)
job.c

diff --git a/job.c b/job.c
index 9ec9130cf979fd5d2075de22242e532e9074398a..a7881dec6b7f99634a1df2d95bc827251970b4db 100644 (file)
--- 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);