[BusyBox-cvs] busybox/archival/libunarchive get_header_tar.c, 1.21, 1.22

Glenn McGrath bug1 at busybox.net
Fri Sep 12 06:31:35 UTC 2003


Update of /var/cvs/busybox/archival/libunarchive
In directory winder:/tmp/cvs-serv20434/archival/libunarchive

Modified Files:
	get_header_tar.c 
Log Message:
Use the typeflag to identify if its a hardlink on OLD and GNU posix 
modes, fixes a bug extracting hardlinks to symlinks.


Index: get_header_tar.c
===================================================================
RCS file: /var/cvs/busybox/archival/libunarchive/get_header_tar.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- get_header_tar.c	9 Sep 2003 17:41:03 -0000	1.21
+++ get_header_tar.c	12 Sep 2003 06:31:28 -0000	1.22
@@ -29,6 +29,7 @@
 {
 	file_header_t *file_header = archive_handle->file_header;
 	union {
+		/* ustar header, Posix 1003.1 */
 		unsigned char raw[512];
 		struct {
 			char name[100];	/*   0-99 */
@@ -128,12 +129,6 @@
 			file_header->mode |= S_IFREG;
 		}
 		break;
-#if 0
-	/* hard links are detected as entries with 0 size, a link name, 
-	 * and not being a symlink, hence we have nothing to do here */
-	case '1':
-		break;
-#endif
 	case '2':
 		file_header->mode |= S_IFLNK;
 		break;
@@ -150,6 +145,11 @@
 		file_header->mode |= S_IFIFO;
 		break;
 # endif
+	/* hard links are detected as entries with 0 size, a link name, 
+	 * and not being a symlink, hence we have nothing to do here */
+	case '1':
+		file_header->mode |= ~S_IFLNK;
+		break;
 # ifdef CONFIG_FEATURE_TAR_GNU_EXTENSIONS
 	case 'L': {
 			longname = xmalloc(file_header->size + 1);




More information about the busybox-cvs mailing list