summaryrefslogtreecommitdiffstats
path: root/bugzilla
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2008-09-04 12:15:38 -0400
committerWill Woods <wwoods@redhat.com>2008-09-04 12:15:38 -0400
commit8765e33c2267b1408bd4d11d1bf596ad1d53eb21 (patch)
tree1c008cf36ef00348d984214f09c57ccd572f443a /bugzilla
parent71bab41bf6068f464827700f68ab7cfbae51e7ab (diff)
downloadpython-bugzilla-8765e33c2267b1408bd4d11d1bf596ad1d53eb21.tar.gz
python-bugzilla-8765e33c2267b1408bd4d11d1bf596ad1d53eb21.tar.xz
python-bugzilla-8765e33c2267b1408bd4d11d1bf596ad1d53eb21.zip
Create cookiefile with 0600 perms
Diffstat (limited to 'bugzilla')
-rw-r--r--bugzilla/base.py6
1 files changed, 6 insertions, 0 deletions
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