forked from fedora-python/python26
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython-2.6.6-CVE-2011-4944.patch
More file actions
22 lines (21 loc) · 935 Bytes
/
python-2.6.6-CVE-2011-4944.patch
File metadata and controls
22 lines (21 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff -up Python-2.6.6/Lib/distutils/config.py.CVE-2011-4944 Python-2.6.6/Lib/distutils/config.py
--- Python-2.6.6/Lib/distutils/config.py.CVE-2011-4944 2008-12-27 08:28:42.000000000 -0500
+++ Python-2.6.6/Lib/distutils/config.py 2012-03-28 13:34:58.703059545 -0400
@@ -43,16 +43,8 @@ class PyPIRCCommand(Command):
def _store_pypirc(self, username, password):
"""Creates a default .pypirc file."""
rc = self._get_rc_file()
- f = open(rc, 'w')
- try:
- f.write(DEFAULT_PYPIRC % (username, password))
- finally:
- f.close()
- try:
- os.chmod(rc, 0600)
- except OSError:
- # should do something better here
- pass
+ with os.fdopen(os.open(rc, os.O_CREAT | os.O_WRONLY, 0600), 'w') as fp:
+ fp.write(DEFAULT_PYPIRC % (username, password))
def _read_pypirc(self):
"""Reads the .pypirc file."""