Skip to content

Commit 75ca9cd

Browse files
committed
Add POSIX euid and egid properties
1 parent afaf708 commit 75ca9cd

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

qiling/loader/elf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,9 @@ def __push_str(top: int, s: str) -> int:
363363
(AUX.AT_FLAGS, 0),
364364
(AUX.AT_ENTRY, elf_entry),
365365
(AUX.AT_UID, self.ql.os.uid),
366-
(AUX.AT_EUID, self.ql.os.uid),
366+
(AUX.AT_EUID, self.ql.os.euid),
367367
(AUX.AT_GID, self.ql.os.gid),
368-
(AUX.AT_EGID, self.ql.os.gid),
368+
(AUX.AT_EGID, self.ql.os.egid),
369369
(AUX.AT_HWCAP, elf_hwcap),
370370
(AUX.AT_CLKTCK, 100),
371371
(AUX.AT_RANDOM, randstraddr),

qiling/os/posix/posix.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,8 @@ def __init__(self, ql: Qiling):
5959
self.ql = ql
6060
self.sigaction_act = [0] * 256
6161

62-
if self.ql.root:
63-
self.uid = 0
64-
self.gid = 0
65-
else:
66-
self.uid = self.profile.getint("KERNEL","uid")
67-
self.gid = self.profile.getint("KERNEL","gid")
62+
self.uid = self.euid = self.profile.getint("KERNEL","uid")
63+
self.gid = self.egid = self.profile.getint("KERNEL","gid")
6864

6965
self.pid = self.profile.getint("KERNEL", "pid")
7066
self.ipv6 = self.profile.getboolean("NETWORK", "ipv6")

0 commit comments

Comments
 (0)