Add a comment to verify_import() to clarify its purpose.

This commit is contained in:
Todd C. Miller
2021-01-06 19:16:26 -07:00
parent 4e11bc0e26
commit 4603da02af

View File

@@ -35,6 +35,8 @@ _verify_import(const char *file_path)
{
debug_decl(_verify_import, PYTHON_DEBUG_INTERNAL);
// Check mode and owner similar to what we do in open_sudoers().
// This is to help avoid loading a potentially insecure module.
struct stat sb;
if (stat(file_path, &sb) != 0) {
PyErr_Format(PyExc_ImportError, "Failed to stat file '%s'", file_path);