def verify_fs_pcap(fspcap):
    """Validate the filename for the pcap.

    Validates passed in filename (should be from Flowsynth) to verify
    that it exists and isn't trying to do something nefarious like
    directory traversal.
    """
    # require fspcap to be POSIX fully portable filename
    if not re.match(r"^[A-Za-z0-9\x5F\x2D\x2E]+$", fspcap):
        logger.error(
            "Bad fspcap filename provided: '%s'. Filename must be POSIX fully portable."
            % fspcap
        )
        return "Bad pcap filename provided: '%s'" % (fspcap)
    fspcap_path = os.path.join(FS_PCAP_PATH, os.path.basename(fspcap))
    logger.debug("Flowsynth pcap file passed: %s" % fspcap_path)
    if not os.path.isfile(fspcap_path):
        logger.error("fspcap file '%s' not found." % fspcap_path)
        return "File not found: '%s'" % os.path.basename(fspcap)
    return None
Validate the filename for the pcap.

    Validates passed in filename (should be from Flowsynth) to verify
    that it exists and isn't trying to do something nefarious like
    directory traversal.
    
app/dalton.py