mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-22 05:56:03 +00:00

When sending file from a Linux host to a Windows remote, Linux host will try to copy the source file's permission bits, which will contain `_S_I?GRP` and `_S_I?OTH` bits. Those bits are rejected by `_wsopen_s`, causing it to return EINVAL. This patch masks out the rejected bits. GitHub issue: #64313 Reviewed By: jasonmolenda, DavidSpickett Differential Revision: https://reviews.llvm.org/D156817 (cherry picked from commit 9a4b3fdb82327e808213070fd157be3c557b8b9d)