Skip to content

Commit 4d7289b

Browse files
committed
explicitly set permissions of config files
1 parent d81394c commit 4d7289b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ldm/invoke/config/invokeai_configure.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,8 @@ def initialize_rootdir(root: str, yes_to_all: bool = False):
675675
for root,dirs,_ in os.walk(os.path.join(root,name)):
676676
for d in dirs:
677677
Path(root,d).chmod(0o775)
678+
for f in files:
679+
Path(root,d).chmod(0o644)
678680

679681
# -------------------------------------
680682
def run_console_ui(

ldm/invoke/config/model_install_backend.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,11 @@ def update_config_file(successfully_downloaded: dict, config_file: Path):
397397
# Fix up directory permissions so that they are writable
398398
# This can happen when running under Nix environment which
399399
# makes the runtime directory template immutable.
400-
for root,dirs,_ in os.walk(default_config_file().parent):
400+
for root,dirs,files in os.walk(default_config_file().parent):
401401
for d in dirs:
402402
Path(root,d).chmod(0o775)
403+
for f in files:
404+
Path(root,d).chmod(0o644)
403405

404406
yaml = new_config_file_contents(successfully_downloaded, config_file)
405407

0 commit comments

Comments
 (0)