Merge pull request #6324 from gabriel-samfira/set-explicit-acl

Set explicit ACL on test files
This commit is contained in:
Phil Estes 2021-12-03 13:14:04 -05:00 committed by GitHub
commit d742453086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 7 deletions

View File

@ -26,9 +26,12 @@ RUN cmd.exe /c "@echo off && FOR %i in (%BUSYBOX_EXES%) do (mklink %i.exe busybo
USER ContainerUser
RUN cmd.exe /c mkdir C:\test_dir
RUN /bin/sh.exe -c "echo test_content > /test_dir/test_file"
# Explicitly set full access rights for "CREATOR OWNER". While
# this is set by default for Windows Server 2019, it seems that
# on Windows Server 2022 it is not.
RUN mkdir C:\test_dir && \
icacls C:\test_dir /grant "CREATOR OWNER":(OI)(CI)(IO)F /T && \
/bin/sh.exe -c "echo test_content > /test_dir/test_file"
ENV PATH="C:\bin;C:\Windows\System32;C:\Windows;"
VOLUME "C:/test_dir"

View File

@ -25,12 +25,15 @@ WORKDIR C:/bin
ADD tools/get_owner_windows.exe C:/bin/get_owner.exe
RUN cmd.exe /c "@echo off && FOR %i in (%BUSYBOX_EXES%) do (mklink %i.exe busybox.exe)"
RUN cmd.exe /c mkdir C:\volumes
USER ContainerUser
RUN mkdir C:\volumes\test_dir
RUN /bin/sh.exe -c "echo test_content > /volumes/test_dir/test_file"
# Explicitly set full access rights for "CREATOR OWNER". While
# this is set by default for Windows Server 2019, it seems that
# on Windows Server 2022 it is not.
RUN mkdir C:\volumes && \
icacls C:\volumes /grant "CREATOR OWNER":(OI)(CI)(IO)F /T && \
mkdir C:\volumes\test_dir && \
/bin/sh.exe -c "echo test_content > /volumes/test_dir/test_file"
ENV PATH="C:\bin;C:\Windows\System32;C:\Windows;"
VOLUME "C:/volumes/test_dir"