From 43ed993500ac7362381bc57aa3b55b86c0bb7520 Mon Sep 17 00:00:00 2001 From: thib Date: Sun, 15 Sep 2002 18:07:47 +0000 Subject: [PATCH] bug fix : added O_WRONLY in read() --- fcrontab.c | 6 +++--- fileconf.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fcrontab.c b/fcrontab.c index 701e205..1fa0be8 100644 --- a/fcrontab.c +++ b/fcrontab.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fcrontab.c,v 1.60 2002-09-07 13:10:50 thib Exp $ */ + /* $Id: fcrontab.c,v 1.61 2002-09-15 18:07:47 thib Exp $ */ /* * The goal of this program is simple : giving a user interface to fcron @@ -47,7 +47,7 @@ #include "temp_file.h" #include "read_string.h" -char rcs_info[] = "$Id: fcrontab.c,v 1.60 2002-09-07 13:10:50 thib Exp $"; +char rcs_info[] = "$Id: fcrontab.c,v 1.61 2002-09-15 18:07:47 thib Exp $"; void info(void); void usage(void); @@ -203,7 +203,7 @@ copy(char *orig, char *dest) error_e("seteuid(fcrontab_uid[%d])", fcrontab_uid); } #endif - to_fd = open(dest, O_CREAT | O_TRUNC | O_SYNC); + to_fd = open(dest, O_WRONLY | O_CREAT | O_TRUNC | O_SYNC); if (to_fd == -1) { error_e("copy: dest"); return ERR; diff --git a/fileconf.c b/fileconf.c index 0839870..f8f1852 100644 --- a/fileconf.c +++ b/fileconf.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fileconf.c,v 1.62 2002-09-07 13:11:25 thib Exp $ */ + /* $Id: fileconf.c,v 1.63 2002-09-15 18:09:42 thib Exp $ */ #include "fcrontab.h" @@ -1704,7 +1704,7 @@ save_file(char *path) for (file = file_base; file; file = file->cf_next) { /* open file */ - fd = open(path, O_CREAT | O_TRUNC | O_SYNC); + fd = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_SYNC); if ( fd == -1 ) { error_e("Could not open %s : file has not be installed.", path); return ERR; -- 2.40.0