summaryrefslogtreecommitdiff
path: root/src/pkg/archive/tar/writer.go
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@debian.org>2014-06-19 09:23:02 +0200
committerMichael Stapelberg <stapelberg@debian.org>2014-06-19 09:23:02 +0200
commit8fcc691d6fa80c9ddf38bf0d34b803bab0e421d5 (patch)
treeba71646a10b518372d110532d86fcf0b98edc14f /src/pkg/archive/tar/writer.go
parent3bb719bbf3cdb97b3901f3baaa2da9d02a5c3cdb (diff)
parent8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1 (diff)
downloadgolang-8fcc691d6fa80c9ddf38bf0d34b803bab0e421d5.tar.gz
Merge tag 'upstream/1.3' into debian-sid
Upstream version 1.3
Diffstat (limited to 'src/pkg/archive/tar/writer.go')
-rw-r--r--src/pkg/archive/tar/writer.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/pkg/archive/tar/writer.go b/src/pkg/archive/tar/writer.go
index 549f1464c..6eff6f6f8 100644
--- a/src/pkg/archive/tar/writer.go
+++ b/src/pkg/archive/tar/writer.go
@@ -218,8 +218,8 @@ func (tw *Writer) writeHeader(hdr *Header, allowPax bool) error {
tw.cString(prefixHeaderBytes, prefix, false, paxNone, nil)
// Use the ustar magic if we used ustar long names.
- if len(prefix) > 0 {
- copy(header[257:265], []byte("ustar\000"))
+ if len(prefix) > 0 && !tw.usedBinary {
+ copy(header[257:265], []byte("ustar\x00"))
}
}
}
@@ -236,6 +236,12 @@ func (tw *Writer) writeHeader(hdr *Header, allowPax bool) error {
return tw.err
}
+ if allowPax {
+ for k, v := range hdr.Xattrs {
+ paxHeaders[paxXattr+k] = v
+ }
+ }
+
if len(paxHeaders) > 0 {
if !allowPax {
return errInvalidHeader