crash_collector: add /crash to the user crash path
The recent multiprofile work forgot to append /crash to the user-specific
crash path. It was in the fallback path, but not the dynamic one.
BUG=chromium:248629
TEST=`cros_run_unit_tests --board=x86-alex -p crash-reporter` works
TEST=`cbuildbot x86-generic-full` works
Change-Id: If87848526b0e78f3f76fd412b0f46e37b7022bd6
Reviewed-on: https://gerrit.chromium.org/gerrit/58232
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/crash_reporter/crash_collector.cc b/crash_reporter/crash_collector.cc
index 55fdd57..b433bec 100644
--- a/crash_reporter/crash_collector.cc
+++ b/crash_reporter/crash_collector.cc
@@ -196,7 +196,8 @@
GList *list = g_hash_table_get_values(active_sessions);
if (list) {
const char *salted_path = static_cast<const char *>(list->data);
- user_path = chromeos::cryptohome::home::GetHashedUserPath(salted_path);
+ user_path = chromeos::cryptohome::home::GetHashedUserPath(salted_path)
+ .Append("crash");
g_list_free(list);
}
diff --git a/crash_reporter/crash_collector_test.cc b/crash_reporter/crash_collector_test.cc
index b9a48a0..64a8653 100644
--- a/crash_reporter/crash_collector_test.cc
+++ b/crash_reporter/crash_collector_test.cc
@@ -139,7 +139,7 @@
&directory_mode,
&directory_owner,
&directory_group);
- EXPECT_EQ("/home/user/hashcakes", path.value());
+ EXPECT_EQ("/home/user/hashcakes/crash", path.value());
EXPECT_EQ(kExpectedUserMode, directory_mode);
EXPECT_EQ(kChronosUid, directory_owner);
EXPECT_EQ(kChronosGid, directory_group);