From 8765e33c2267b1408bd4d11d1bf596ad1d53eb21 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Thu, 4 Sep 2008 12:15:38 -0400 Subject: Create cookiefile with 0600 perms --- bugzilla/base.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bugzilla') diff --git a/bugzilla/base.py b/bugzilla/base.py index 8024736..04b7883 100644 --- a/bugzilla/base.py +++ b/bugzilla/base.py @@ -100,6 +100,12 @@ class BugzillaBase(object): cj = cookielib.MozillaCookieJar(self.cookiefile) if os.path.exists(self.cookiefile): cj.load() + else: + # Create an empty file that's only readable by this user + old_umask = os.umask(0077) + f = open(self.cookiefile,"w") + f.close() + os.umask(old_umask) self._cookiejar = cj self._cookiejar.filename = self.cookiefile -- cgit