parameters: (path)
docstring: If the default extraction path is overridden and set to an insecure
          location, such as /tmp, it opens up an opportunity for an attacker to
          replace an extracted file with an unauthorized payload. Warn the user
          if a known insecure location is used.
  
          See Distribute #375 for more details.
docstring_summary: If the default extraction path is overridden and set to an insecure
          location, such as /tmp, it opens up an opportunity for an attacker to
          replace an extracted file with an unauthorized payload. Warn the user
          if a known insecure location is used.
docstring_tokens: If the default extraction path is overridden and set to an insecure location such as / tmp it opens up an opportunity for an attacker to replace an extracted file with an unauthorized payload . Warn the user if a known insecure location is used .
function: def _warn_unsafe_extraction_path(path):
          """
          If the default extraction path is overridden and set to an insecure
          location, such as /tmp, it opens up an opportunity for an attacker to
          replace an extracted file with an unauthorized payload. Warn the user
          if a known insecure location is used.
  
          See Distribute #375 for more details.
          """
          if os.name == 'nt' and not path.startswith(os.environ['windir']):
              # On Windows, permissions are generally restrictive by default
              #  and temp directories are not writable by other users, so
              #  bypass the warning.
              return
          mode = os.stat(path).st_mode
          if mode & stat.S_IWOTH or mode & stat.S_IWGRP:
              msg = (
                  "Extraction path is writable by group/others "
                  "and vulnerable to attack when "
                  "used with get_resource_filename ({path}). "
                  "Consider a more secure "
                  "location (set with .set_extraction_path or the "
                  "PYTHON_EGG_CACHE environment variable)."
              ).format(**locals())
              warnings.warn(msg, UserWarning)
function_tokens: def _warn_unsafe_extraction_path ( path ) : if os . name == 'nt' and not path . startswith ( os . environ [ 'windir' ] ) : # On Windows, permissions are generally restrictive by default #  and temp directories are not writable by other users, so #  bypass the warning. return mode = os . stat ( path ) . st_mode if mode & stat . S_IWOTH or mode & stat . S_IWGRP : msg = ( "Extraction path is writable by group/others " "and vulnerable to attack when " "used with get_resource_filename ({path}). " "Consider a more secure " "location (set with .set_extraction_path or the " "PYTHON_EGG_CACHE environment variable)." ) . format ( * * locals ( ) ) warnings . warn ( msg , UserWarning )