Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

archive/tar: FileInfo representation of header returns full path instead of base name at Name() method #6180

Closed
gopherbot opened this issue Aug 18, 2013 · 3 comments
Milestone

Comments

@gopherbot
Copy link

by christian.h7r:

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Read an existing tar file with tar.Reader
2. Use FileInfo representation of Header (fi := hdr.FileInfo())
3. Call fi.Name()
4. http://play.golang.org/p/yQXR3n1Shf demonstrates the bug.

What is the expected output?
According to the documentation of os.FileInfo I expect the base name as output.

What do you see instead?
The full path of the file in the tar archive.

Which compiler are you using (5g, 6g, 8g, gccgo)?
-

Which operating system are you using?
Ubuntu 13.04 64-bit

Which version are you using?  (run 'go version')
go version go1.1.2 linux/amd64

Please provide any additional information below.

The problem seems to be here:
http://golang.org/src/pkg/archive/tar/common.go?s=2710:2755#L78

The documentation for the Method of this internal struct says it returns the base name,
but it actually returns the full path.
@robpike
Copy link
Contributor

robpike commented Aug 19, 2013

Comment 1:

Labels changed: added priority-later, removed priority-triage.

Status changed to Accepted.

@robpike
Copy link
Contributor

robpike commented Aug 20, 2013

Comment 2:

Status changed to Started.

@robpike
Copy link
Contributor

robpike commented Aug 20, 2013

Comment 3:

This issue was closed by revision 9364868.

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants