aboutsummaryrefslogtreecommitdiff
path: root/archival/libunarchive/header_verbose_list.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-02-14 20:37:54 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-02-14 20:37:54 +0000
commite00e5025ecb2eb6160e7b94c0e93fc2a777f6eaa (patch)
treec08295d50b96a33d51c11b8601ac455333b8004a /archival/libunarchive/header_verbose_list.c
parent39487e2d6a9a2b6e520969f65b4d326da82e354f (diff)
downloadbusybox-e00e5025ecb2eb6160e7b94c0e93fc2a777f6eaa.tar.gz
tar: real support for -p. +200 if selected.
By Natanael Copa <natanael.copa at gmail.com>
Diffstat (limited to 'archival/libunarchive/header_verbose_list.c')
-rw-r--r--archival/libunarchive/header_verbose_list.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/archival/libunarchive/header_verbose_list.c b/archival/libunarchive/header_verbose_list.c
index b9ac3c499..ea623ed85 100644
--- a/archival/libunarchive/header_verbose_list.c
+++ b/archival/libunarchive/header_verbose_list.c
@@ -10,6 +10,33 @@ void header_verbose_list(const file_header_t *file_header)
{
struct tm *mtime = localtime(&(file_header->mtime));
+#if ENABLE_FEATURE_TAR_UNAME_GNAME
+ char uid[8];
+ char gid[8];
+ char *user = file_header->uname;
+ char *group = file_header->gname;
+
+ if (user == NULL) {
+ snprintf(uid, sizeof(uid), "%u", (unsigned)file_header->uid);
+ user = uid;
+ }
+ if (group == NULL) {
+ snprintf(gid, sizeof(gid), "%u", (unsigned)file_header->gid);
+ group = gid;
+ }
+ printf("%s %s/%s %9u %4u-%02u-%02u %02u:%02u:%02u %s",
+ bb_mode_string(file_header->mode),
+ user,
+ group,
+ (unsigned int) file_header->size,
+ 1900 + mtime->tm_year,
+ 1 + mtime->tm_mon,
+ mtime->tm_mday,
+ mtime->tm_hour,
+ mtime->tm_min,
+ mtime->tm_sec,
+ file_header->name);
+#else /* !FEATURE_TAR_UNAME_GNAME */
printf("%s %d/%d %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s",
bb_mode_string(file_header->mode),
file_header->uid,
@@ -22,6 +49,7 @@ void header_verbose_list(const file_header_t *file_header)
mtime->tm_min,
mtime->tm_sec,
file_header->name);
+#endif /* FEATURE_TAR_UNAME_GNAME */
if (file_header->link_target) {
printf(" -> %s", file_header->link_target);