diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-27 07:44:51 +0300 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-27 07:44:51 +0300 |
commit | d0119d15f97750c49f9955e6c6f952f03d72e795 (patch) | |
tree | 193a70e3d5ed19939c8460afb725c0fdf38d065d /archival | |
parent | 8d42f86b146871ae4c4cafd3801a85f381249a14 (diff) |
Simple fixes accumulated after 1.3.0.
busybox-1.3.0.ash.patch
busybox-1.3.0.bb_strtou.patch
busybox-1.3.0.CONFIG_FEATURE_TAR_GNU_EXTENSIONS.patch
busybox-1.3.0.dhcprelay.patch
busybox-1.3.0.dpkg_ar.patch
busybox-1.3.0.find.patch
busybox-1.3.0.mount.patch
busybox-1.3.0.perror.patch
busybox-1.3.0.sed.patch
busybox-1.3.0.shadow.patch
busybox-1.3.0.xregcomp.patch
Diffstat (limited to 'archival')
-rw-r--r-- | archival/libunarchive/get_header_ar.c | 23 | ||||
-rw-r--r-- | archival/libunarchive/get_header_tar.c | 4 |
2 files changed, 19 insertions, 8 deletions
diff --git a/archival/libunarchive/get_header_ar.c b/archival/libunarchive/get_header_ar.c index 7f8c81ca0..897c89918 100644 --- a/archival/libunarchive/get_header_ar.c +++ b/archival/libunarchive/get_header_ar.c @@ -9,6 +9,7 @@ char get_header_ar(archive_handle_t *archive_handle) { + int err; file_header_t *typed = archive_handle->file_header; union { char raw[60]; @@ -45,15 +46,23 @@ char get_header_ar(archive_handle_t *archive_handle) archive_handle->offset += 60; /* align the headers based on the header magic */ - if ((ar.formatted.magic[0] != '`') || (ar.formatted.magic[1] != '\n')) { + if (ar.formatted.magic[0] != '`' || ar.formatted.magic[1] != '\n') bb_error_msg_and_die("invalid ar header"); - } - typed->mode = xstrtoul(ar.formatted.mode, 8); - typed->mtime = xatou(ar.formatted.date); - typed->uid = xatou(ar.formatted.uid); - typed->gid = xatou(ar.formatted.gid); - typed->size = xatoul(ar.formatted.size); + /* FIXME: more thorough routine would be in order here */ + /* (we have something like that in tar) */ + /* but for now we are lax. This code works because */ + /* on misformatted numbers bb_strtou returns all-ones */ + typed->mode = err = bb_strtou(ar.formatted.mode, NULL, 8); + if (err == -1) bb_error_msg_and_die("invalid ar header"); + typed->mtime = err = bb_strtou(ar.formatted.date, NULL, 10); + if (err == -1) bb_error_msg_and_die("invalid ar header"); + typed->uid = err = bb_strtou(ar.formatted.uid, NULL, 10); + if (err == -1) bb_error_msg_and_die("invalid ar header"); + typed->gid = err = bb_strtou(ar.formatted.gid, NULL, 10); + if (err == -1) bb_error_msg_and_die("invalid ar header"); + typed->size = err = bb_strtou(ar.formatted.size, NULL, 10); + if (err == -1) bb_error_msg_and_die("invalid ar header"); /* long filenames have '/' as the first character */ if (ar.formatted.name[0] == '/') { diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c index 66c3314a1..88f72bd15 100644 --- a/archival/libunarchive/get_header_tar.c +++ b/archival/libunarchive/get_header_tar.c @@ -74,8 +74,10 @@ char get_header_tar(archive_handle_t *archive_handle) if (sizeof(tar) != 512) BUG_tar_header_size(); - again: +#if ENABLE_FEATURE_TAR_GNU_EXTENSIONS + again: +#endif /* Align header */ data_align(archive_handle, 512); |