Skip to content

Commit

Permalink
Merge pull request #634 from terop/non_executable_config
Browse files Browse the repository at this point in the history
Make config and stylesheet files non-executable
  • Loading branch information
deltragon authored Aug 12, 2024
2 parents de8fc94 + 1d3f804 commit 9a8891d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions safeeyes/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def initialize_safeeyes():

# Copy the safeeyes.json
shutil.copy2(SYSTEM_CONFIG_FILE_PATH, CONFIG_FILE_PATH)
os.chmod(CONFIG_FILE_PATH, 0o777)
os.chmod(CONFIG_FILE_PATH, 0o666)

create_user_stylesheet_if_missing()

Expand All @@ -385,7 +385,7 @@ def create_user_stylesheet_if_missing():
# Copy the new style sheet
if not os.path.isfile(STYLE_SHEET_PATH):
shutil.copy2(SYSTEM_STYLE_SHEET_PATH, STYLE_SHEET_PATH)
os.chmod(STYLE_SHEET_PATH, 0o777)
os.chmod(STYLE_SHEET_PATH, 0o666)

def create_startup_entry(force=False):
"""
Expand Down Expand Up @@ -493,8 +493,8 @@ def reset_config():
shutil.copy2(SYSTEM_STYLE_SHEET_PATH, STYLE_SHEET_PATH)

# Add write permission (e.g. if original file was stored in /nix/store)
os.chmod(CONFIG_FILE_PATH, 0o777)
os.chmod(STYLE_SHEET_PATH, 0o777)
os.chmod(CONFIG_FILE_PATH, 0o666)
os.chmod(STYLE_SHEET_PATH, 0o666)

create_startup_entry()

Expand All @@ -505,7 +505,7 @@ def replace_style_sheet():
"""
delete(STYLE_SHEET_PATH)
shutil.copy2(SYSTEM_STYLE_SHEET_PATH, STYLE_SHEET_PATH)
os.chmod(STYLE_SHEET_PATH, 0o777)
os.chmod(STYLE_SHEET_PATH, 0o666)


def initialize_logging(debug):
Expand Down

0 comments on commit 9a8891d

Please sign in to comment.