crash: crash_sender: whitelist . and - chars in key names
Since Chrome reports include these chars, and they aren't a problem to
allow, whitelist to unbreak Chrome crash reports.
BUG=chromium:821530
TEST=precq passes
Change-Id: I321361266b75664225782251039aabfe0b1d0905
Reviewed-on: https://chromium-review.googlesource.com/961681
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
diff --git a/crash-reporter/crash_sender b/crash-reporter/crash_sender
index 447788f..1303425 100755
--- a/crash-reporter/crash_sender
+++ b/crash-reporter/crash_sender
@@ -549,7 +549,9 @@
# 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.
- [ -z "$(sed -E -e '/^#/d' -e '/^$/d' -e '/^[a-zA-Z0-9_]+=/d' "$1")" ]
+ # 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")" ]
}
# Remove the given report path.