From 6074481d100bed754b7b600373e1422f58e8aa2d Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Tue, 16 Apr 2024 18:53:06 +0200 Subject: [PATCH] Set permissions for include folder on Windows --- .github/workflows/build-cpp.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 5de6e65dd..6a2b36380 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -101,10 +101,20 @@ jobs: name: libbitwarden_c_files-${{ matrix.settings.target }} path: languages/cpp/include - - name: List includes + - name: Set permissions to include folder if: runner.os == 'Windows' + shell: pwsh run: | - ls languages/cpp/include + Get-Acl languages/cpp/include/* | Format-List + + $path = "./languages/cpp/include" + $name = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name + $acl = Get-Acl languages/cpp/include + $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($name,"FullControl","Allow") + $acl.SetAccessRule($accessRule) + $acl | Set-Acl languages/cpp/include + Get-ChildItem -Path "$path" -Recurse -Force | Set-Acl -aclObject $acl -Verbose + Get-Acl languages/cpp/include/* | Format-List - name: Build unix