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 /cpukit/libmisc/untar/untar.c | |
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.
Diffstat (limited to '')
-rw-r--r-- | cpukit/libmisc/untar/untar.c | 7 |
1 files changed, 4 insertions, 3 deletions
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; } |