head	1.2;
access;
symbols
	RELEASE_8_3_0:1.2
	RELEASE_9_0_0:1.2
	RELEASE_7_4_0:1.2
	RELEASE_8_2_0:1.2
	RELEASE_6_EOL:1.2
	RELEASE_8_1_0:1.2
	RELEASE_7_3_0:1.2
	RELEASE_8_0_0:1.2
	RELEASE_7_2_0:1.2
	RELEASE_7_1_0:1.2
	RELEASE_6_4_0:1.2
	RELEASE_5_EOL:1.2
	RELEASE_7_0_0:1.2
	RELEASE_6_3_0:1.2
	PRE_XORG_7:1.2
	RELEASE_4_EOL:1.2
	RELEASE_6_2_0:1.2
	RELEASE_6_1_0:1.2
	RELEASE_5_5_0:1.2
	RELEASE_6_0_0:1.1
	RELEASE_5_4_0:1.1
	RELEASE_4_11_0:1.1
	RELEASE_5_3_0:1.1
	RELEASE_4_10_0:1.1
	RELEASE_5_2_1:1.1
	RELEASE_5_2_0:1.1
	RELEASE_4_9_0:1.1
	RELEASE_5_1_0:1.1
	RELEASE_4_8_0:1.1
	RELEASE_5_0_0:1.1
	RELEASE_4_7_0:1.1
	RELEASE_4_6_2:1.1
	RELEASE_4_6_1:1.1
	RELEASE_4_6_0:1.1
	RELEASE_5_0_DP1:1.1
	RELEASE_4_5_0:1.1
	RELEASE_4_4_0:1.1
	RELEASE_4_3_0:1.1
	RELEASE_4_2_0:1.1
	RELEASE_4_1_1:1.1
	RELEASE_4_1_0:1.1
	RELEASE_3_5_0:1.1
	RELEASE_4_0_0:1.1;
locks; strict;
comment	@# @;


1.2
date	2005.10.14.12.25.57;	author naddy;	state Exp;
branches;
next	1.1;

1.1
date	2000.03.05.09.27.25;	author kris;	state Exp;
branches;
next	;


desc
@@


1.2
log
@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
@
text
@--- 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 */
-			warn = 0;
+			arcwarn = 0;
 #if	!DOS
 		else if (*a == 'I')	/* image mode, no ASCII/EBCDIC x-late */
 			image = !image;
@@@@ -426,7 +426,7 @@@@
 expandlst(n)			/* expand an indirect reference */
 	int		n;	/* number of entry to expand */
 {
-	FILE	       *lf, *fopen();	/* list file, opener */
+	FILE	       *lf;	/* list file, opener */
 	char		buf[100];	/* input buffer */
 	int		x;	/* index */
 	char	       *p = lst[n] + 1; /* filename pointer */
@


1.1
log
@From OpenBSD: generate tempfiles securely with mkstemps()

Approved by:	Maintainer
@
text
@d1 3
a3 55
--- ./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 <sys/types.h>
 #include <sys/stat.h>
+#include <unistd.h>
 #endif
 
 #include <string.h>
 #if BSD
 #include <strings.h>
+#include <err.h>
+#include <errno.h>
 #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 @@@@
d12 1
a12 1
@@@@ -401,7 +414,7 @@@@
@

