diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-07-27 18:11:42 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-07-27 18:11:42 +0000 |
commit | 4f3d72fb5383b08065624d212a587b2e2b654cfd (patch) | |
tree | 4b4a12503df87eec8ac95196df3520dad13c8608 | |
parent | 2010-07-27 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff) | |
download | rtems-4f3d72fb5383b08065624d212a587b2e2b654cfd.tar.bz2 |
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.
-rw-r--r-- | cpukit/ChangeLog | 5 | ||||
-rw-r--r-- | cpukit/libfs/src/imfs/imfs_load_tar.c | 5 | ||||
-rw-r--r-- | cpukit/libmisc/untar/untar.c | 7 |
3 files changed, 12 insertions, 5 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index b70bd5c4c9..1246b2eaac 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -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. diff --git a/cpukit/libfs/src/imfs/imfs_load_tar.c b/cpukit/libfs/src/imfs/imfs_load_tar.c index c542d34161..3cb3c4e195 100644 --- a/cpukit/libfs/src/imfs/imfs_load_tar.c +++ b/cpukit/libfs/src/imfs/imfs_load_tar.c @@ -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); diff --git a/cpukit/libmisc/untar/untar.c b/cpukit/libmisc/untar/untar.c index 7f2c55d1fd..b31eec9077 100644 --- a/cpukit/libmisc/untar/untar.c +++ b/cpukit/libmisc/untar/untar.c @@ -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; } |