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
The tar specification stores numeric fields using an octal representation. This limits the range of values that can be stored.
To increase the supported range, a GNU extension defines that when the leading byte is 0xff/0x80 the remaining bytes are a negative/positive big endian formatted value.
When writing under the PAX format, we continue to only use the only octal representation in the header fields. The values are overridden using extended attributes.
/// <remarks>Character and block devices are Unix-specific entry types.</remarks>
52
52
/// <exception cref="InvalidOperationException">The entry does not represent a block device or a character device.</exception>
53
-
/// <exception cref="ArgumentOutOfRangeException">The value is negative, or larger than 2097151.</exception>
53
+
/// <exception cref="ArgumentOutOfRangeException">The value is negative, or larger than 2097151 when using <see cref="TarEntryFormat.V7"/> or <see cref="TarEntryFormat.Ustar"/>.</exception>
ArgumentOutOfRangeException.ThrowIfGreaterThan(value,0x1FFFFF);// 7777777 in octal
65
+
if(FormatIsOctalOnly)
66
+
{
67
+
ArgumentOutOfRangeException.ThrowIfGreaterThan(value,0x1FFFFF);// 7777777 in octal
68
+
}
66
69
67
70
_header._devMajor=value;
68
71
}
@@ -73,7 +76,7 @@ public int DeviceMajor
73
76
/// </summary>
74
77
/// <remarks>Character and block devices are Unix-specific entry types.</remarks>
75
78
/// <exception cref="InvalidOperationException">The entry does not represent a block device or a character device.</exception>
76
-
/// <exception cref="ArgumentOutOfRangeException">The value is negative, or larger than 2097151.</exception>
79
+
/// <exception cref="ArgumentOutOfRangeException">The value is negative, or larger than 2097151 when using <see cref="TarEntryFormat.V7"/> or <see cref="TarEntryFormat.Ustar"/>.</exception>
/// A timestamps that represents the last time the contents of the file represented by this entry were modified.
93
96
/// </summary>
94
97
/// <remarks>In Unix platforms, this timestamp is commonly known as <c>mtime</c>.</remarks>
95
-
/// <exception cref="ArgumentOutOfRangeException">The specified value is larger than <see cref="DateTimeOffset.UnixEpoch"/>.</exception>
98
+
/// <exception cref="ArgumentOutOfRangeException">The specified value is larger than <see cref="DateTimeOffset.UnixEpoch"/> when using <see cref="TarEntryFormat.V7"/> or <see cref="TarEntryFormat.Ustar"/>.</exception>
// TODO: Read the bytes of the currently unsupported GNU fields, in case user wants to write this entry into another GNU archive, they need to be preserved. https://github.com/dotnet/runtime/issues/68230
0 commit comments