From 40fe0f18ffba7015828dddb7fce023250ca9073f Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 2 Apr 2019 13:55:58 -0500 Subject: More tar cleanup and tests. --- toys/pending/tar.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'toys/pending') diff --git a/toys/pending/tar.c b/toys/pending/tar.c index 7cad2729..bff8b540 100644 --- a/toys/pending/tar.c +++ b/toys/pending/tar.c @@ -121,7 +121,6 @@ static void write_longname(char *name, char type) memset(&tmp, 0, sizeof(tmp)); strcpy(tmp.name, "././@LongLink"); - ITOO(tmp.mode, 0); ITOO(tmp.uid, 0); ITOO(tmp.gid, 0); ITOO(tmp.size, sz); @@ -129,6 +128,11 @@ static void write_longname(char *name, char type) tmp.type = type; strcpy(tmp.magic, "ustar "); + // Historical nonsense to match other implementations. Never used. + ITOO(tmp.mode, 0644); + strcpy(tmp.uname, "root"); + strcpy(tmp.gname, "root"); + // Calculate checksum. Since 512*255 = 0377000 in octal, this can never // use more than 6 digits. The last byte is ' ' or historical reasons. itoo(tmp.chksum, sizeof(tmp.chksum)-1, cksum(&tmp)); -- cgit v1.2.3