mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +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,12 +209,15 @@ bool ProcessInfo::Initialize(pid_t pid) {
|
||||
LOG(ERROR) << "format error: multiple Groups lines";
|
||||
return false;
|
||||
}
|
||||
gid_t group;
|
||||
while (AdvancePastNumber(&line_c, &group)) {
|
||||
supplementary_groups_.insert(group);
|
||||
if (!AdvancePastPrefix(&line_c, " ")) {
|
||||
LOG(ERROR) << "format error: unrecognized Groups format";
|
||||
return false;
|
||||
if (!AdvancePastPrefix(&line_c, " ")) {
|
||||
// In Linux 4.10, even an empty Groups: line has a trailing space.
|
||||
gid_t group;
|
||||
while (AdvancePastNumber(&line_c, &group)) {
|
||||
supplementary_groups_.insert(group);
|
||||
if (!AdvancePastPrefix(&line_c, " ")) {
|
||||
LOG(ERROR) << "format error: unrecognized Groups format";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
have_groups = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user