summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-09-18 00:30:02 (GMT)
committerR David Murray <rdmurray@bitdance.com>2013-09-18 00:30:02 (GMT)
commit104aab956f6de4131cab800f742cc108f9f92edf (patch)
tree2d651d492a76a00270e0c86bf9c1a2a289e12219 /Doc
parentc17a8dfaca76016202c49b2150c946f5ba70db29 (diff)
downloadcpython-104aab956f6de4131cab800f742cc108f9f92edf.zip
cpython-104aab956f6de4131cab800f742cc108f9f92edf.tar.gz
cpython-104aab956f6de4131cab800f742cc108f9f92edf.tar.bz2
#14984: On POSIX, enforce permissions when reading default .netrc.
Initial patch by Bruno Piguet. This is implemented as if a useful .netrc file could exist without passwords, which is possible in the general case; but in fact our netrc implementation does not support it. Fixing that issue will be an enhancement.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/netrc.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/netrc.rst b/Doc/library/netrc.rst
index 91990df..b6c1066 100644
--- a/Doc/library/netrc.rst
+++ b/Doc/library/netrc.rst
@@ -19,6 +19,14 @@ the Unix :program:`ftp` program and other FTP clients.
no argument is given, the file :file:`.netrc` in the user's home directory will
be read. Parse errors will raise :exc:`NetrcParseError` with diagnostic
information including the file name, line number, and terminating token.
+ If no argument is specified on a POSIX system, the presence of passwords in
+ the :file:`.netrc` file will raise a :exc:`NetrcParseError` if the file
+ ownership or permissions are insecure (owned by a user other than the user
+ running the process, or accessible for read or write by any other user).
+ This implements security behavior equivalent to that of ftp and other
+ programs that use :file:`.netrc`.
+
+ .. versionchanged:: 3.1.6 Added the POSIX permission check.
.. exception:: NetrcParseError