summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Stubbs <jstubbs@gentoo.org>2005-10-05 15:49:25 +0000
committerJason Stubbs <jstubbs@gentoo.org>2005-10-05 15:49:25 +0000
commit1ffe6759c8e9bfec462a72cdbaf60a07c7a2f670 (patch)
tree42f4596ec698b662ae1bf0f55a69170b31007e66
parentAdd new tool to check and fix problems with the world file (to begin with) (diff)
downloadportage-multirepo-1ffe6759c8e9bfec462a72cdbaf60a07c7a2f670.tar.gz
portage-multirepo-1ffe6759c8e9bfec462a72cdbaf60a07c7a2f670.tar.bz2
portage-multirepo-1ffe6759c8e9bfec462a72cdbaf60a07c7a2f670.zip
Make dispatch-conf's log file have 0600 permissions.
svn path=/main/branches/2.0/; revision=2099
-rwxr-xr-xbin/dispatch-conf9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index c1d8b700..bc8077a6 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"