Exemplo n.º 1
0
void PktCaptureManager::checkCaptureName(folly::StringPiece name) {
  // We use the capture name for the on-disk filename, so don't allow
  // directory separator characters or nul bytes.
  std::string invalidChars("\0/", 2);
  size_t idx = name.find_first_of(invalidChars);
  if (idx != std::string::npos) {
    throw FbossError("invalid capture name \"", name,
                     "\": invalid character at byte ", idx);
  }
}