X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Flogging.py;h=f0dcd9c94201435288f3bd37e9e8896b4edc8631;hb=d9822f04453a1b62ca0aa66e2efeea35f654778f;hp=9b27aeb790f906eac7fbd6a1a666586954d68e89;hpb=e2110abd8654360401bd66eaf32b16e66a92d059;p=dak.git diff --git a/daklib/logging.py b/daklib/logging.py index 9b27aeb7..f0dcd9c9 100644 --- a/daklib/logging.py +++ b/daklib/logging.py @@ -39,13 +39,16 @@ class Logger: if not os.path.exists(logdir): umask = os.umask(00000) os.makedirs(logdir, 02775) + os.umask(umask) # Open the logfile logfilename = "%s/%s" % (logdir, time.strftime("%Y-%m")) - logfile = None - if debug: - logfile = sys.stderr - else: - logfile = utils.open_file(logfilename, 'a') + logfile = None + if debug: + logfile = sys.stderr + else: + umask = os.umask(00002) + logfile = utils.open_file(logfilename, 'a') + os.umask(umask) self.logfile = logfile # Log the start of the program user = pwd.getpwuid(os.getuid())[0]