From 1ffe6759c8e9bfec462a72cdbaf60a07c7a2f670 Mon Sep 17 00:00:00 2001 From: Jason Stubbs Date: Wed, 5 Oct 2005 15:49:25 +0000 Subject: Make dispatch-conf's log file have 0600 permissions. svn path=/main/branches/2.0/; revision=2099 --- bin/dispatch-conf | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/dispatch-conf b/bin/dispatch-conf index c1d8b700b..bc8077a63 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -64,9 +64,12 @@ class dispatch: self.options = dispatch_conf.read_config(MANDATORY_OPTS) if self.options.has_key("log-file"): - if os.path.exists(self.options["log-file"]): - shutil.copyfile(self.options["log-file"], self.options["log-file"] + '.old') - os.remove(self.options["log-file"]) + if os.path.isfile(self.options["log-file"]): + shutil.copy(self.options["log-file"], self.options["log-file"] + '.old') + if os.path.isfile(self.options["log-file"]) \ + or not os.path.exists(self.options["log-file"]): + open(self.options["log-file"], 'w').close() # Truncate it + os.chmod(self.options["log-file"], 0600) else: self.options["log-file"] = "/dev/null" -- cgit v1.2.3-1-g7c22