You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the StartAppContainer c++ code at the bottom of this report, build the StartAppContainer.exe.
Grab both the 3.12.3 and 3.12.4 embedded distributions of python.
Use this python code:
importtempfileimportos# Create a temporary directorytemp_dir=tempfile.mkdtemp()
file_path=os.path.join(temp_dir, "tempfile.txt")
content_to_write="Hello, this is a test."# Create and write to a file inside the temporary directorywithopen(file_path, 'w') asf:
f.write(content_to_write)
# Read the content back to verifywithopen(file_path, 'r') asf:
content_read=f.read()
# Verify the contentifcontent_read==content_to_write:
print("Success: Content verified.")
else:
print("Error: Content does not match.")
Traceback (most recent call last):
File "C:\code\test_temp.py", line 11, in <module>
with open(file_path, 'w') as f:
^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\UserName\\AppData\\Local\\Packages\\testpythonappcontainer\\AC\\Temp\\tmp2sy87dk4\\tempfile.txt'
As seen in the error, AppContainer processes get their temp files redirected to %LOCALAPPDATA%\Packages\[PackageName]\AC\Temp. When an AppContainer gets created by the system, %LOCALAPPDATA%\Packages\[PackageName]\AC is explicitly ACL-ed to allow Inherited Full Control of the SID associated with the AppContainer.
I believe this is because of the changes associated with #118486 where the temp directory created with 700 is explicitly no longer inheriting the permissions from their parent.
Is it possible to grab the SID of the process' AppContainer (if any) and append that SID with Full Control to the SDDL being set as the security descriptor on the temp directory?
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
Using the StartAppContainer c++ code at the bottom of this report, build the StartAppContainer.exe.
Grab both the 3.12.3 and 3.12.4 embedded distributions of python.
Use this python code:
in a test_temp.py file.
Then from a command line run:
and see it works. But run
and see it fails with
As seen in the error, AppContainer processes get their temp files redirected to
%LOCALAPPDATA%\Packages\[PackageName]\AC\Temp
. When an AppContainer gets created by the system,%LOCALAPPDATA%\Packages\[PackageName]\AC
is explicitly ACL-ed to allow Inherited Full Control of the SID associated with the AppContainer.I believe this is because of the changes associated with #118486 where the temp directory created with 700 is explicitly no longer inheriting the permissions from their parent.
Is it possible to grab the SID of the process' AppContainer (if any) and append that SID with Full Control to the SDDL being set as the security descriptor on the temp directory?
StartAppContainer.cpp code:
CPython versions tested on:
3.12
Operating systems tested on:
Windows
Linked PRs
The text was updated successfully, but these errors were encountered: