Skip to content

Commit 8b6dcc1

Browse files
[gdb-remote] process properly effective uid
Summary: Someone wrote SetEffectiveSetEffectiveGroupID instead of SetEffectiveUserID. After this fix, the android process list can show user names, e.g. ``` PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE ARGUMENTS ====== ====== ========== ========== ========== ========== ============================== ============================ 529 1 root 0 root 0 /sbin/ueventd ``` Reviewers: labath,clayborg,aadsm,xiaobai Subscribers: llvm-svn: 373953
1 parent d457f7e commit 8b6dcc1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestPlatformClient.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
class TestPlatformClient(GDBRemoteTestBase):
1010

11-
def test_process_list_with_all_users(self):
11+
def test_process_list(self):
1212
"""Test connecting to a remote linux platform"""
1313

1414
class MyResponder(MockGDBServerResponder):
1515
def qfProcessInfo(self, packet):
1616
if "all_users:1" in packet:
17-
return "pid:10;ppid:1;uid:1;gid:1;euid:1;egid:1;name:" + binascii.hexlify("/a/process") + ";args:"
17+
return "pid:10;ppid:1;uid:2;gid:3;euid:4;egid:5;name:" + binascii.hexlify("/a/process") + ";args:"
1818
else:
1919
return "E04"
2020

@@ -28,6 +28,10 @@ def qfProcessInfo(self, packet):
2828
self.assertTrue(self.dbg.GetSelectedPlatform().IsConnected())
2929
self.expect("platform process list -x",
3030
startstr="1 matching process was found", endstr="process" + os.linesep)
31+
self.expect("platform process list -xv",
32+
substrs=[
33+
"PID PARENT USER GROUP EFF USER EFF GROUP",
34+
"10 1 2 3 4 5"])
3135
self.expect("platform process list",
3236
error="error: no processes were found on the \"remote-linux\" platform")
3337
finally:

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1906,7 +1906,7 @@ bool GDBRemoteCommunicationClient::DecodeProcessInfoResponse(
19061906
} else if (name.equals("euid")) {
19071907
uint32_t uid = UINT32_MAX;
19081908
value.getAsInteger(0, uid);
1909-
process_info.SetEffectiveGroupID(uid);
1909+
process_info.SetEffectiveUserID(uid);
19101910
} else if (name.equals("gid")) {
19111911
uint32_t gid = UINT32_MAX;
19121912
value.getAsInteger(0, gid);

0 commit comments

Comments
 (0)