2010-07-27 Joel Sherrill <joel.sherrill@oarcorp.com>

* libfs/src/imfs/imfs_load_tar.c, libmisc/untar/untar.c: Now supports
	both pax and GNU tar created tar files.
This commit is contained in:
Joel Sherrill
2010-07-27 18:11:42 +00:00
parent 234a36c996
commit 4f3d72fb53
3 changed files with 12 additions and 5 deletions

View File

@@ -1,3 +1,8 @@
2010-07-27 Joel Sherrill <joel.sherrill@oarcorp.com>
* libfs/src/imfs/imfs_load_tar.c, libmisc/untar/untar.c: Now supports
both pax and GNU tar created tar files.
2010-07-27 Joel Sherrill <joel.sherrilL@OARcorp.com>
* posix/src/sigsuspend.c: Do not assert unless RTEMS_DEBUG is defined.

View File

@@ -46,7 +46,8 @@
* 148 8 bytes Header checksum (in octal ascii)
* 156 1 bytes Link flag
* 157 100 bytes Linkname ('\0' terminated, 99 maxmum length)
* 257 8 bytes Magic ("ustar \0")
* 257 8 bytes Magic PAX ("ustar\0" + 2 bytes padding)
* 257 8 bytes Magic GNU tar ("ustar \0")
* 265 32 bytes User name ('\0' terminated, 31 maxmum length)
* 297 32 bytes Group name ('\0' terminated, 31 maxmum length)
* 329 8 bytes Major device ID (in octal ascii)
@@ -124,7 +125,7 @@ int rtems_tarfs_load(
*/
hdr_ptr = (char *) &tar_image[offset];
offset += 512;
if (strncmp(&hdr_ptr[257], "ustar ", 7))
if (strncmp(&hdr_ptr[257], "ustar", 5))
break;
strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE);

View File

@@ -39,7 +39,8 @@
* 148 8 bytes Header checksum (in octal ascii)
* 156 1 bytes Link flag
* 157 100 bytes Linkname ('\0' terminated, 99 maxmum length)
* 257 8 bytes Magic ("ustar \0")
* 257 8 bytes Magic PAX ("ustar\0" + 2 bytes padding)
* 257 8 bytes Magic GNU tar ("ustar \0")
* 265 32 bytes User name ('\0' terminated, 31 maxmum length)
* 297 32 bytes Group name ('\0' terminated, 31 maxmum length)
* 329 8 bytes Major device ID (in octal ascii)
@@ -143,7 +144,7 @@ Untar_FromMemory(
/* Read the header */
bufr = &tar_ptr[ptr];
ptr += 512;
if (strncmp(&bufr[257], "ustar ", 7))
if (strncmp(&bufr[257], "ustar", 5))
{
retval = UNTAR_SUCCESSFUL;
break;
@@ -283,7 +284,7 @@ Untar_FromFile(
break;
}
if (strncmp(&bufr[257], "ustar ", 7))
if (strncmp(&bufr[257], "ustar", 5))
{
break;
}