]> granicus.if.org Git - fcron/commitdiff
bug fix : added O_WRONLY in read()
authorthib <thib>
Sun, 15 Sep 2002 18:07:47 +0000 (18:07 +0000)
committerthib <thib>
Sun, 15 Sep 2002 18:07:47 +0000 (18:07 +0000)
fcrontab.c
fileconf.c

index 701e205d460a512e28e479380fac84c3eef03781..1fa0be87760458ebe9feed007dc7af6b07405b8c 100644 (file)
@@ -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;
index 0839870971017a5679adb4c1ef9da2dc5f389463..f8f185237564e7ce280b399bfd13af21a5c7d67b 100644 (file)
@@ -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;