1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-15 01:31:08 +00:00

id: fix '-u'

Some cases printed gid instead of uid.
This commit is contained in:
Michael Gehring 2015-12-21 10:33:48 +01:00
parent 7c1bb4cb97
commit cf8a86ca2d

View file

@ -141,9 +141,9 @@ pub fn uumain(args: Vec<String>) -> i32 {
let id = if possible_pw.is_some() {
possible_pw.unwrap().pw_uid
} else if rflag {
unsafe { getgid() }
unsafe { getuid() }
} else {
unsafe { getegid() }
unsafe { geteuid() }
};
let pw = unsafe { getpwuid(id) };