Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 0 additions & 4 deletions SickBeard.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ def daemonize():

os.setsid() # @UndefinedVariable - only available in UNIX

# Make sure I can read my own files and shut out others
prev = os.umask(0)
os.umask(prev and int('077', 8))

# Make the child a session-leader by detaching from the terminal
try:
pid = os.fork() # @UndefinedVariable - only available in UNIX
Expand Down
8 changes: 7 additions & 1 deletion lib/configobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -2057,7 +2057,11 @@ def write(self, outfile=None, section=None):
if self.BOM and ((self.encoding is None) or match_utf8(self.encoding)):
# Add the UTF8 BOM
output = BOM_UTF8 + output


# Protect our configuration file so we can read the configuration file, and others can not.
prev = os.umask(0)
os.umask(prev and int('077', 8))

if not output.endswith(newline):
output += newline
if outfile is not None:
Expand All @@ -2066,6 +2070,8 @@ def write(self, outfile=None, section=None):
h = open(self.filename, 'wb')
h.write(output)
h.close()
# Reset the umask to the original setting
os.umask(prev)


def validate(self, validator, preserve_errors=False, copy=False,
Expand Down