--- arcsvc.c~   2005-03-13 16:48:09.000000000 +0100 +++ arcsvc.c    2005-09-17 09:41:51.000000000 +0200 @@ -17,6 +17,9 @@          Computer Innovations Optimizing C86  */  #include +#include +#include +#include  #include "arc.h"  #if    _MTS  #include @@ -52,7 +55,12 @@ openarc(chg)                 /* open archive */         }  #endif         if (chg) {              /* if opening for changes */ -               if (!(new = fopen(newname, OPEN_W))) +               int fd; + +               if ((fd = open(newname, O_CREAT|O_EXCL|O_RDWR, S_IREAD|S_IWRITE)) == -1) +                       arcdie("Cannot create archive copy: %s", newname); + +               if (!(new = fdopen(fd, OPEN_W)))                         arcdie("Cannot create archive copy: %s", newname);           changing = chg;         /* note if open for changes */