[BusyBox-cvs] busybox/archival/libunarchive data_extract_all.c, 1.17, 1.18

Erik Andersen andersen at busybox.net
Sun Dec 21 08:59:27 UTC 2003


Update of /var/cvs/busybox/archival/libunarchive
In directory nail:/tmp/cvs-serv2136

Modified Files:
	data_extract_all.c 
Log Message:
Don't hose up perms for files that happen to have symlinks
in the tarball that point to them.
 -Erik


Index: data_extract_all.c
===================================================================
RCS file: /var/cvs/busybox/archival/libunarchive/data_extract_all.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- data_extract_all.c	27 Nov 2003 00:01:43 -0000	1.17
+++ data_extract_all.c	21 Dec 2003 08:59:24 -0000	1.18
@@ -111,8 +111,10 @@
 		}
 	}
 
-	chown(file_header->name, file_header->uid, file_header->gid);
-	chmod(file_header->name, file_header->mode);
+	lchown(file_header->name, file_header->uid, file_header->gid);
+	if ((file_header->mode & S_IFMT) != S_IFLNK) {
+		chmod(file_header->name, file_header->mode);
+	}
 
 	if (archive_handle->flags & ARCHIVE_PRESERVE_DATE) {
 		struct utimbuf t;




More information about the busybox-cvs mailing list