diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2023-04-17 19:01:31 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2023-04-17 19:03:15 (EDT) |
commit | 7d810e632719b9d910200c382a98d12252d40264 (patch) | |
tree | 1c1a189e568f2e299dc8f471b40cebe4efd7d8a7 /src/ustar.c | |
parent | cb5600ac708ddeac608ce47363c43bfd566b26d2 (diff) |
ustar, main: Show mode and mtime
Diffstat (limited to 'src/ustar.c')
-rw-r--r-- | src/ustar.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ustar.c b/src/ustar.c index 7e00cb6..a277f15 100644 --- a/src/ustar.c +++ b/src/ustar.c @@ -145,6 +145,7 @@ opkg_opk_ustar_list(struct opkg_opk_ustar *ustar, { static struct _opkg_opk_ustar_header header; int ret; + char *end; if ((ret =_opkg_opk_ustar_next(ustar, &header)) != OPKG_OPK_OK) { return ret; /* Error or end of archive */ @@ -156,7 +157,17 @@ opkg_opk_ustar_list(struct opkg_opk_ustar *ustar, memcpy(member->name, header.name, sizeof(header.name)); member->name[sizeof(header.name)] = '\0'; } + member->mode = strtol((char *) header.mode, &end, + OPKG_OPK_USTAR_NUM_BASE_); + if (*end != '\0') { + return OPKG_OPK_ERROR; + } member->size = ustar->data_size_remaining; + member->mtime = strtol((char *) header.mtime, &end, + OPKG_OPK_USTAR_NUM_BASE_); + if (*end != '\0') { + return OPKG_OPK_ERROR; + } switch (*header.typeflag) { case '0': /* Regular file */ case '7': /* High-performance or regular file */ |