DragonFly BSD
DragonFly submit List (threaded) for 2004-10
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

[PATCH] for pax(1)


From: Robert Nagy <robert@xxxxxx>
Date: Wed, 13 Oct 2004 20:55:21 +0200

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
 	 */



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]