mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 22:26:06 +00:00
linux: Support 4.10 format for empty Groups: lines in /proc/pid/status
The Groups: line unfortunately always had a trailing space, but Linux 4.10 takes this to a new level by including a trailing space even when no groups are present. See commit f7a5f132b447, linux-4.10.10/fs/proc/array.c task_state(). Bug: crashpad:30 Test: crashpad_util_test ProcessInfo.Pid1 Change-Id: If498abd929b27c7f28b69144e7c4928b1626acdb Reviewed-on: https://chromium-review.googlesource.com/477070 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
parent
5d07d81458
commit
2ec34e32c2
@ -209,6 +209,8 @@ bool ProcessInfo::Initialize(pid_t pid) {
|
|||||||
LOG(ERROR) << "format error: multiple Groups lines";
|
LOG(ERROR) << "format error: multiple Groups lines";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!AdvancePastPrefix(&line_c, " ")) {
|
||||||
|
// In Linux 4.10, even an empty Groups: line has a trailing space.
|
||||||
gid_t group;
|
gid_t group;
|
||||||
while (AdvancePastNumber(&line_c, &group)) {
|
while (AdvancePastNumber(&line_c, &group)) {
|
||||||
supplementary_groups_.insert(group);
|
supplementary_groups_.insert(group);
|
||||||
@ -217,6 +219,7 @@ bool ProcessInfo::Initialize(pid_t pid) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
have_groups = true;
|
have_groups = true;
|
||||||
understood_line = true;
|
understood_line = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user