Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make config and stylesheet files non-executable #634

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading