Skip to content

Commit 9a8ff50

Browse files
committed
id: Print real GID if it is different from EGID
1 parent 80bd61a commit 9a8ff50

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/uu/id/src/id.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,16 @@ fn pretty(possible_pw: Option<Passwd>) {
468468
}
469469
}
470470

471+
let rgid = getgid();
472+
let egid = getegid();
473+
if egid != rgid {
474+
if let Ok(g) = Group::locate(rgid) {
475+
println!("rgid\t{}", g.name);
476+
} else {
477+
println!("rgid\t{rgid}");
478+
}
479+
}
480+
471481
println!(
472482
"groups\t{}",
473483
entries::get_groups_gnu(None)

0 commit comments

Comments
 (0)