def _safemembers(members):
base = _resolved("<STR_LIT:.>")<EOL>for finfo in members:<EOL><INDENT>if _badpath(finfo.name, base):<EOL><INDENT>print(finfo.name, "<STR_LIT>")<EOL><DEDENT>elif finfo.issym() and _badlink(finfo, base):<EOL><INDENT>print(finfo.name, "<STR_LIT>", finfo.linkname)<EOL><DEDENT>elif finfo.islnk() and _badlink(finfo, base):<EOL><INDENT>print(finfo.name, "<STR_LIT>", finfo.linkname)<EOL><DEDENT>else:<EOL><INDENT>yield finfo<EOL><DEDENT><DEDENT>
Check members of a tar archive for safety.
    Ensure that they do not contain paths or links outside of where we
    need them - this would only happen if the archive wasn't made by
    eqcorrscan.

    :type members: :class:`tarfile.TarFile`
    :param members: an open tarfile.