[PATCH] for pax(1)

Robert Nagy robert at bsd.hu
Wed Oct 13 11:31:35 PDT 2004


If you use the -C option of pax(1) and the chdir fails,
pax will go on so you can easily overwrite your files.

http://www.openbsd.org/cgi-bin/cvsweb.cgi/src/bin/pax/ar_io.c.diff?r1=1.35&r2=1.36&f=h


Index: src/bin/pax/ar_io.c
===================================================================
RCS file: /home/dcvs/src/bin/pax/ar_io.c,v
retrieving revision 1.5
diff -u -r1.5 ar_io.c
--- src/bin/pax/ar_io.c	28 Sep 2003 14:39:14 -0000	1.5
+++ src/bin/pax/ar_io.c	13 Oct 2004 18:30:25 -0000
@@ -151,8 +151,10 @@
 		return(-1);
 
 	if (chdname != NULL)
-		if (chdir(chdname) != 0)
+		if (chdir(chdname) != 0) {
 			syswarn(1, errno, "Failed chdir to %s", chdname);
+			return(-1);
+		}
 	/*
 	 * set up is based on device type
 	 */





More information about the Submit mailing list