You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This table shows each field max allowed length, in bytes, according to which format you choose:
V7
Ustar
Gnu
Pax
Name
100
256
Unlimited
Unlimited
LinkName
100
100
Unlimited
Unlimited
UserName
N/A
32
32
Unlimited
GroupName
N/A
32
32
Unlimited
Our current behavior using TarWriter.WriteEntry is to truncate fields when a string larger-than-the-limit is passed, but I think this is wrong since users may not be aware of such behavior.
I think we should instead throw when a field is unable to fit in the archive entry and there's no other way to preserve it.
That last bit is only true for a subset of the table, i.e:
Name and LinkName on V7 and Ustar.
UserName and GroupName on Ustar and Gnu.
For Name and LinkName on Pax and Gnu is acceptable to truncate as those formats are capable of storing those fields without limit restriction (although, they still populate the legacy fields).
I also checked how GNU Tar handles these cases and it aligns with what I just described.