Skip to content

Commit 8aaaa23

Browse files
committed
process: Add suid/sgid
1 parent 1c55833 commit 8aaaa23

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/uu/pgrep/src/process.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,14 @@ impl ProcessInformation {
409409
self.get_uid_or_gid_field("Gid", 1)
410410
}
411411

412+
pub fn suid(&mut self) -> Result<u32, io::Error> {
413+
self.get_uid_or_gid_field("Uid", 2)
414+
}
415+
416+
pub fn sgid(&mut self) -> Result<u32, io::Error> {
417+
self.get_uid_or_gid_field("Gid", 2)
418+
}
419+
412420
// Root directory of the process (which can be changed by chroot)
413421
pub fn root(&mut self) -> Result<PathBuf, io::Error> {
414422
read_link(format!("/proc/{}/root", self.pid))

0 commit comments

Comments
 (0)