Zip.Unix: don't hang when creating zip file from directory with named pipe. (#85301)
authorTom Deseyn <tom.deseyn@gmail.com>
Thu, 18 May 2023 16:58:31 +0000 (18:58 +0200)
committerGitHub <noreply@github.com>
Thu, 18 May 2023 16:58:31 +0000 (10:58 -0600)
commitb86722cd15603c080fdb276e1fb8b41c2d75d3e5
treea32577b34b165adc47d4053e57f68582bb09e67b
parent5fb5a6fe220d813e27996ca0d82a160fa090ca79
Zip.Unix: don't hang when creating zip file from directory with named pipe. (#85301)

* Zip.Unix: don't hang when creating zip file from directory with named pipe.

When we open the named pipe for reading, that call will block indefinitely
when there is no writer to provide data.

And if we manage to read data from a pipe, that data was probably meant
for someone else.

Rather than opening named pipes, throw an IOException indicating they
are not supported.

And like the named pipes, this also treat character devices,
block devices, and sockets as unsupported types.

* Skip test on browser.

* Tar,Zip: update unsupported file type error message.

* Skip tests on tvOS/iOS.
src/libraries/Common/src/System/IO/Archiving.Utils.cs
src/libraries/System.Formats.Tar/src/Resources/Strings.resx
src/libraries/System.IO.Compression.ZipFile/src/Resources/Strings.resx
src/libraries/System.IO.Compression.ZipFile/src/System.IO.Compression.ZipFile.csproj
src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.Unix.cs [new file with mode: 0644]
src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.Windows.cs [new file with mode: 0644]
src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs
src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Unix.cs