Skip to content

Commit

Permalink
Restrict mode of configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarpenter committed Jul 9, 2019
1 parent d7c57ab commit 7a95739
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gitsome/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,11 @@ def save_config(self):
parser.set(self.CONFIG_SECTION,
self.CONFIG_CLR_VIEW_INDEX,
self.clr_view_index)
old_umask = os.umask(0o77)
with open(config, 'w+') as config_file:
parser.write(config_file)
os.chmod(config, 0o600)
_ = os.umask(old_umask)

def save_urls(self):
"""Save the current set of urls to ~/.gitsomeconfigurl."""
Expand Down

0 comments on commit 7a95739

Please sign in to comment.