(self, fp)
| 161 | return |
| 162 | |
| 163 | def _security_check(self, fp): |
| 164 | prop = os.fstat(fp.fileno()) |
| 165 | current_user_id = os.getuid() |
| 166 | if prop.st_uid != current_user_id: |
| 167 | fowner = _getpwuid(prop.st_uid) |
| 168 | user = _getpwuid(current_user_id) |
| 169 | raise NetrcParseError( |
| 170 | f"~/.netrc file owner ({fowner}) does not match" |
| 171 | f" current user ({user})") |
| 172 | if (prop.st_mode & (stat.S_IRWXG | stat.S_IRWXO)): |
| 173 | raise NetrcParseError( |
| 174 | "~/.netrc access too permissive: access" |
| 175 | " permissions must restrict access to only" |
| 176 | " the owner") |
| 177 | |
| 178 | def authenticators(self, host): |
| 179 | """Return a (user, account, password) tuple for given host.""" |
no test coverage detected