diff options
author | Jason Stubbs <jstubbs@gentoo.org> | 2005-10-05 15:49:25 +0000 |
---|---|---|
committer | Jason Stubbs <jstubbs@gentoo.org> | 2005-10-05 15:49:25 +0000 |
commit | 1ffe6759c8e9bfec462a72cdbaf60a07c7a2f670 (patch) | |
tree | 42f4596ec698b662ae1bf0f55a69170b31007e66 | |
parent | 30c8cea7b8eee019708d18be278c647e03afe86d (diff) | |
download | portage-1ffe6759c8e9bfec462a72cdbaf60a07c7a2f670.tar.gz portage-1ffe6759c8e9bfec462a72cdbaf60a07c7a2f670.tar.bz2 portage-1ffe6759c8e9bfec462a72cdbaf60a07c7a2f670.zip |
Make dispatch-conf's log file have 0600 permissions.
svn path=/main/branches/2.0/; revision=2099
-rwxr-xr-x | bin/dispatch-conf | 9 |
1 files 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" |