From 7d810e632719b9d910200c382a98d12252d40264 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 17 Apr 2023 19:01:31 -0400 Subject: ustar, main: Show mode and mtime --- (limited to 'src/ustar.c') 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 */ -- cgit v0.9.1