Skip to content

Added Zip File containing files with characters invalid in Windows #230

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

Merged
merged 3 commits into from
Mar 27, 2022

Conversation

oguzeldereli1
Copy link
Contributor

@oguzeldereli1 oguzeldereli1 commented Mar 27, 2022

@danmoseley danmoseley changed the title Added Test Zip File (https://github.com/dotnet/runtime/issues/67201) Added Zip File containing files with characters invalid in Windows Mar 27, 2022
@danmoseley
Copy link
Member

danmoseley commented Mar 27, 2022

Thanks. I improved the filename and added a clickable link to the original issue.

It's probably helpful to document what you have put in this zip:

dan@danmoseL:~/zip$ unzip -l InvalidWindowsFileNameChars.zip
Archive:  InvalidWindowsFileNameChars.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2022-03-27 13:44   Test/
       12  2022-03-27 13:44   Test/normalText.txt
        0  2022-03-27 13:44   Test"<>|^A^B^C^D^E^F^G^H^I^J^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_/
       14  2022-03-27 13:44   Test"<>|^A^B^C^D^E^F^G^H^I^J^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_/TestText1"<>|^A^B^C^D^E^F^G^H^I^J^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_.txt
        0  2022-03-27 13:44   TestEmpty/
       14  2022-03-27 13:44   TestText"<>|^A^B^C^D^E^F^G^H^I^J^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_.txt

where ^A == 0x01 through ^_ == 0x31. It looks like you are missing these three: '*', '?', ':'. Could you please add those too? (There is no perfect set of valid Windows filename chars, as it depends on position to some extent, and some names are reserved. But this does not need to be perfect. Anyone can fall back to extracting one file at a time using whatever filenames they like. But '*', '?', ':' seem reasonable to sanitize also.)

@oguzeldereli1
Copy link
Contributor Author

@danmoseley on it

@oguzeldereli1
Copy link
Contributor Author

oguzeldereli1 commented Mar 27, 2022

@danmoseley I have added those three characters and committed the changes. I have also tested the newly built zip file with 7zip and SharpZipLib and they both seem to replace all characters with underscores

@danmoseley
Copy link
Member

dan@danmoseL:~/zip$ unzip -l InvalidWindowsFileNameChars.zip
Archive:  InvalidWindowsFileNameChars.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2022-03-27 15:07   Test/
       12  2022-03-27 15:07   Test/normalText.txt
        0  2022-03-27 15:07   Test"<>|^A^B^C^D^E^F^G^H^I^J^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_*?:/
       14  2022-03-27 15:07   Test"<>|^A^B^C^D^E^F^G^H^I^J^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_*?:/TestText1"<>|^A^B^C^D^E^F^G^H^I^J^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_*?:.txt
        0  2022-03-27 15:07   TestEmpty/
       14  2022-03-27 15:07   TestText"<>|^A^B^C^D^E^F^G^H^I^J^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_*?:.txt

@danmoseley danmoseley merged commit 3f09aa5 into dotnet:main Mar 27, 2022
@danmoseley
Copy link
Member

@Danyy427 I don't know how long it takes for this to insert itself into dotnet/runtime so that when you run the tests there, they see it.

However if you want to make progress meantime these instructions might help https://github.com/dotnet/runtime-assets/blob/main/README.md#optional-step-local-testing

@oguzeldereli1 oguzeldereli1 deleted the Danyy427-zipfile branch March 30, 2022 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants