diff options
author | Rob Landley <rob@landley.net> | 2019-04-02 13:55:58 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-04-02 13:55:58 -0500 |
commit | 40fe0f18ffba7015828dddb7fce023250ca9073f (patch) | |
tree | 0977ffd2657c4ca987c703acb9c3266a7b3091cd /toys/pending | |
parent | facfdfec126231aba10a8dd8b740119811a1a0fb (diff) | |
download | toybox-40fe0f18ffba7015828dddb7fce023250ca9073f.tar.gz |
More tar cleanup and tests.
Diffstat (limited to 'toys/pending')
-rw-r--r-- | toys/pending/tar.c | 6 |
1 files changed, 5 insertions, 1 deletions
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)); |