-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
The library is able to deserialize Header structs from Symlink files:
Lines 90 to 101 in b4d3577
| // read link name | |
| if hdr.Mode&^ModePerm == ModeSymlink { | |
| if hdr.Size < 1 || hdr.Size > svr4MaxNameSize { | |
| return nil, ErrHeader | |
| } | |
| b := make([]byte, hdr.Size) | |
| if _, err := io.ReadFull(r, b); err != nil { | |
| return nil, err | |
| } | |
| hdr.Linkname = string(b) | |
| hdr.Size = 0 | |
| } |
However, it completely ignores the Linkname attribute while writing the header, resulting in zero-sized files without target.
Note that using writer.Write(target) as a workaround isn't an option because the method isn't supported for files other than Regular:
Lines 103 to 105 in b4d3577
| // Calling Write on special types like TypeLink, TypeSymlink, TypeChar, | |
| // TypeBlock, TypeDir, and TypeFifo returns (0, ErrWriteTooLong) regardless of | |
| // what the Header.Size claims. |
rollcat
Metadata
Metadata
Assignees
Labels
No labels