From 2a4fabbee28525028812b46c5eea2496da345ea6 Mon Sep 17 00:00:00 2001 From: Christian Weisgerber Date: Fri, 14 Oct 2005 12:25:57 +0000 Subject: Update to 5.21n. No user-visible changes. The new upstream version now opens temporary files in a safe manner, so our local patches for this are no longer needed. Approved by: ache --- archivers/arc/files/patch-ad | 60 +++----------------------------------------- 1 file changed, 4 insertions(+), 56 deletions(-) (limited to 'archivers/arc/files/patch-ad') diff --git a/archivers/arc/files/patch-ad b/archivers/arc/files/patch-ad index 36dc9639f290..63954d8d2317 100644 --- a/archivers/arc/files/patch-ad +++ b/archivers/arc/files/patch-ad @@ -1,58 +1,6 @@ ---- ./arc.c.orig Tue Apr 14 18:58:59 1992 -+++ ./arc.c Wed Aug 11 10:21:06 1999 -@@ -76,11 +76,14 @@ - #if UNIX - #include - #include -+#include - #endif - - #include - #if BSD - #include -+#include -+#include - #endif - - #if !__STDC__ -@@ -101,6 +104,7 @@ - static char **lst; /* files list */ - static int lnum; /* length of files list */ - -+int - main(num, arg) /* system entry point */ - int num; /* number of arguments */ - char *arg[]; /* pointers to arguments */ -@@ -110,7 +114,7 @@ - VOID upper();/* case conversion routine */ - char *envfind(); /* environment searcher */ - int n; /* index */ -- char *arctemp2, *mktemp(); -+ char *arctemp2; - #if GEMDOS - VOID exitpause(); - int append; -@@ -219,8 +223,17 @@ - #endif - #if !MSDOS - { -- static char tempname[] = "AXXXXXX"; -- strcat(arctemp, mktemp(tempname)); -+ static char tempname[] = "AXXXXXX.arc"; -+ int fd=-1; -+ strcat(arctemp, tempname); -+ if((fd = mkstemps(arctemp,4)) == -1 || -+ (new = fdopen(fd, "w+")) == NULL) { -+ if (fd != -1) { -+ unlink(arctemp); -+ close(fd); -+ } -+ err(1, "can't create temp file %s", arctemp); -+ } - } - #else - strcat(arctemp, "$ARCTEMP"); -@@ -276,7 +289,7 @@ +--- arc.c.orig Sun Oct 9 03:38:22 2005 ++++ arc.c Fri Oct 14 14:22:38 2005 +@@ -290,7 +290,7 @@ keepbak = 1; else if (*a == 'W') /* suppress warnings */ @@ -61,7 +9,7 @@ #if !DOS else if (*a == 'I') /* image mode, no ASCII/EBCDIC x-late */ image = !image; -@@ -401,7 +414,7 @@ +@@ -426,7 +426,7 @@ expandlst(n) /* expand an indirect reference */ int n; /* number of entry to expand */ { -- cgit v1.2.3