New issue
Advanced search Search tips

Issue 870791 link

Starred by 0 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Feature



Sign in to add a comment

crash: harmonize filename validation

Project Member Reported by vapier@chromium.org, Aug 3

Issue description

currently crash_sender.sh has a helper to validate the .meta file:
# Make sure the file is sane.  If the disk was corrupted, we should just delete.
is_valid_metadata() {
  # Delete comments, blank lines, and lines that start with valid keys.
  # We allow underscores, dashes, and periods as Chrome uses them.
  #  https://crbug.com/821530 
  [ -z "$(sed -E -e '/^#/d' -e '/^$/d' -e '/^[a-zA-Z0-9_.-]+=/d' "$1")" ]
}

this implicitly validates filenames too.  as we move crash_sender.sh into C++, we should reuse this to validate the metadata entries as we write them.

e.g. CrashCollector::AddCrashMetaUploadFile should call this func instead of just checking for a / in the argument.
 

Comment 1 Deleted

Sign in to add a comment