mirror of
https://github.com/python/cpython.git
synced 2025-07-07 11:25:30 +00:00
gh-135823: improve error message in netrc
security checks (#135827)
This commit is contained in:
parent
6aa0826ed7
commit
396ca9a641
2 changed files with 5 additions and 2 deletions
|
@ -162,8 +162,8 @@ class netrc:
|
|||
fowner = _getpwuid(prop.st_uid)
|
||||
user = _getpwuid(current_user_id)
|
||||
raise NetrcParseError(
|
||||
(f"~/.netrc file owner ({fowner}, {user}) does not match"
|
||||
" current user"))
|
||||
f"~/.netrc file owner ({fowner}) does not match"
|
||||
f" current user ({user})")
|
||||
if (prop.st_mode & (stat.S_IRWXG | stat.S_IRWXO)):
|
||||
raise NetrcParseError(
|
||||
"~/.netrc access too permissive: access"
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
:mod:`netrc`: improve the error message when the security check for the
|
||||
ownership of the default configuration file ``~/.netrc`` fails. Patch by
|
||||
Bénédikt Tran.
|
Loading…
Add table
Add a link
Reference in a new issue