Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(807)

Issue 12561043: code review 12561043: archive/tar: Fix support for long links and improve PAX...

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 4 months ago by mhennings
Modified:
11 years, 4 months ago
Reviewers:
dsymonds
CC:
dsymonds, golang-dev
Visibility:
Public.

Description

archive/tar: Fix support for long links and improve PAX support. The tar/archive code from golang has a problem with linknames with length > 100. A pax header is added but the original header still written with a too long field length. As it is clear that pax support is incomplete I have added missing implementation parts. This commit contains code from the golang project in the folder tar/archiv. The following pax header records are now automatically written: - gname) - linkpath - path - uname The following fields can be written with PAX, but the default is to use the star binary extension. - gid (value > 2097151) - size (value > 8589934591) - uid (value > 2097151) The string fields are written when the value is longer as the field or if the string contains a char that is not encodable as 7-bit ASCII value. The change was tested against a current ubuntu-cloud image tarball comparing the compressed result. + added some automated tests for the new functionality. Fixes issue 6056.

Patch Set 1 #

Patch Set 2 : diff -r fbc1a650b595 https://code.google.com/p/go #

Patch Set 3 : diff -r fbc1a650b595 https://code.google.com/p/go #

Patch Set 4 : diff -r fbc1a650b595 https://code.google.com/p/go #

Total comments: 22

Patch Set 5 : diff -r fbc1a650b595 https://code.google.com/p/go #

Total comments: 16

Patch Set 6 : diff -r fbc1a650b595 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+262 lines, -66 lines) Patch
M src/pkg/archive/tar/common.go View 1 2 3 4 5 3 chunks +40 lines, -0 lines 0 comments Download
M src/pkg/archive/tar/reader.go View 1 2 3 4 1 chunk +10 lines, -10 lines 0 comments Download
M src/pkg/archive/tar/writer.go View 1 2 3 4 5 10 chunks +114 lines, -53 lines 0 comments Download
M src/pkg/archive/tar/writer_test.go View 1 2 3 4 1 chunk +98 lines, -3 lines 0 comments Download

Messages

Total messages: 13
mhennings
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com, marco.hennings@freiheit.com), I'd like you to review this change to https://code.google.com/p/go
11 years, 4 months ago (2013-08-06 19:52:59 UTC) #1
r
R=adg
11 years, 4 months ago (2013-08-06 22:34:48 UTC) #2
adg
R=dsymonds He wrote this stuff.
11 years, 4 months ago (2013-08-12 05:38:35 UTC) #3
dsymonds
A few places I've asked you to merge/revert things because the changes are unnecessary. Please ...
11 years, 4 months ago (2013-08-13 04:18:26 UTC) #4
mhennings
I've updated the code based on your comments. Please continue the review. https://codereview.appspot.com/12561043/diff/12001/src/pkg/archive/tar/common.go File src/pkg/archive/tar/common.go ...
11 years, 4 months ago (2013-08-13 12:56:23 UTC) #5
dsymonds
getting close. thanks for this. https://codereview.appspot.com/12561043/diff/19001/src/pkg/archive/tar/common.go File src/pkg/archive/tar/common.go (right): https://codereview.appspot.com/12561043/diff/19001/src/pkg/archive/tar/common.go#newcode295 src/pkg/archive/tar/common.go:295: buf.WriteRune(c) here you know ...
11 years, 4 months ago (2013-08-15 01:06:32 UTC) #6
mhennings
I have updated changeset based on your comments. Please continue the review. https://codereview.appspot.com/12561043/diff/19001/src/pkg/archive/tar/common.go File src/pkg/archive/tar/common.go ...
11 years, 4 months ago (2013-08-15 09:52:45 UTC) #7
dsymonds
LGTM
11 years, 4 months ago (2013-08-16 04:46:18 UTC) #8
dsymonds
This is ready to go in; you just need to sign the CLA: http://golang.org/doc/contribute.html#copyright
11 years, 4 months ago (2013-08-16 04:47:25 UTC) #9
mhennings
On 2013/08/16 04:47:25, dsymonds wrote: > This is ready to go in; you just need ...
11 years, 4 months ago (2013-08-16 12:12:00 UTC) #10
dsymonds
I checked before I asked (but can't check right now). Did you sign the CLA ...
11 years, 4 months ago (2013-08-16 12:30:16 UTC) #11
mhennings
On 2013/08/16 12:30:16, dsymonds wrote: > I checked before I asked (but can't check right ...
11 years, 4 months ago (2013-08-16 12:34:39 UTC) #12
dsymonds
11 years, 4 months ago (2013-08-19 00:45:50 UTC) #13
*** Submitted as https://code.google.com/p/go/source/detail?r=0c7e4c45acf8 ***

archive/tar: Fix support for long links and improve PAX support.

The tar/archive code from golang has a problem with linknames with length >
100. A pax header is added but the original header still written with a too
long field length.

As it is clear that pax support is incomplete I have added missing
implementation parts.

This commit contains code from the golang project in the folder tar/archiv.

The following pax header records are now automatically written:

- gname)
- linkpath
- path
- uname

The following fields can be written with PAX, but the default is to use the
star binary extension.

- gid  (value > 2097151)
- size (value > 8589934591)
- uid (value > 2097151)

The string fields are written when the value is longer as the field or if the
string contains a char that is not encodable as 7-bit ASCII value.

The change was tested against a current ubuntu-cloud image tarball comparing
the compressed result.

+ added some automated tests for the new functionality.

Fixes issue 6056.

R=dsymonds
CC=golang-dev
https://codereview.appspot.com/12561043

Committer: David Symonds <dsymonds@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b