gh-135823: improve error message in netrc security checks (#135827)
This commit is contained in:
@@ -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.
|
||||
Reference in New Issue
Block a user