-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Pax Headers incorrectly treated is invalid if value contains an '=' sign #81699
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Thanks for reporting, @Danielku15. I agree it's a bug. I could not find a spec explicitly forbidding the '=' character. The only character that should be forbidden as part of a value is '\n' because it is used as separator of the key value pairs. I have prepared a fix for main and will submit a PR soon. I assume the sdk-container-builds needs a backport for 7.0, correct? |
@carlossanlop Yes, that would be beneficial. There are extensions planned for 7.0.300 which require currently the certain checks in the unit tests to be disabled. This implies a risk of regression bugs of the related features. |
Description
The current TarReader treats any extended headers which contain an equals sign as invalid. While I am not sure about the exact spec, it is in conflict with the
MSWINDOWS.rawsd
extension which is used to define the Windows Security Descriptors for files. They are supposed to be encoded as base64 which can have=
signs as padding characters.Reproduction Steps
Expected behavior
Output should show
Security Descriptor: AQAAgBQAAAAkAAAAAAAAAAAAAAABAgAAAAAABSAAAAAhAgAAAQIAAAAAAAUgAAAAIQIAAA==
Actual behavior
Output shows
Security Descriptor: missing!
Regression?
No, was like this since the beginning.
Known Workarounds
None known.
Configuration
.net Version: 7.0.102
Architecture: x64
Other information
It currently seems by design to treat equals sign values as invalid even though it shouldn't be a problem to support it. From the remaining parsing code it seems to be expected that properties are separated by newlines and key-value by the first equals sign.
Related code:
runtime/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Read.cs
Lines 736 to 740 in 1671125
I was extending https://github.com/dotnet/sdk-container-builds with features to support Windows Containers better and ran into this problem while creating unit tests to verify that the extended attributes are written.
The text was updated successfully, but these errors were encountered: