mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-30 12:22:37 +08:00
Change temporary file permissions to 666
Set permissions of the temporary file to 666 before replacing. ComfyUI could be used in a shared environment and the restricted permissions introduced by this temporary file creation makes it so that workflows and other files saved through this endpoint are inaccessible by others.
This commit is contained in:
parent
e9a2d1e4cc
commit
8717b26698
@ -383,6 +383,7 @@ class UserManager():
|
|||||||
try:
|
try:
|
||||||
with os.fdopen(fd, "wb") as f:
|
with os.fdopen(fd, "wb") as f:
|
||||||
f.write(body)
|
f.write(body)
|
||||||
|
os.chmod(tmp_path, 0o666)
|
||||||
os.replace(tmp_path, path)
|
os.replace(tmp_path, path)
|
||||||
except:
|
except:
|
||||||
os.unlink(tmp_path)
|
os.unlink(tmp_path)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user