mirror of
https://github.com/uutils/coreutils.git
synced 2025-12-23 08:47:37 +00:00
Merge pull request #9670 from sylvestre/id-unwrap
id -p crashes with panic when the real GID doesn't exist in /etc/group
This commit is contained in:
commit
ae3c51ff60
1 changed files with 2 additions and 2 deletions
|
|
@ -468,7 +468,7 @@ fn pretty(possible_pw: Option<Passwd>) {
|
|||
"{}",
|
||||
p.belongs_to()
|
||||
.iter()
|
||||
.map(|&gr| entries::gid2grp(gr).unwrap())
|
||||
.map(|&gr| entries::gid2grp(gr).unwrap_or_else(|_| gr.to_string()))
|
||||
.collect::<Vec<_>>()
|
||||
.join(" ")
|
||||
);
|
||||
|
|
@ -508,7 +508,7 @@ fn pretty(possible_pw: Option<Passwd>) {
|
|||
entries::get_groups_gnu(None)
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(|&gr| entries::gid2grp(gr).unwrap())
|
||||
.map(|&gr| entries::gid2grp(gr).unwrap_or_else(|_| gr.to_string()))
|
||||
.collect::<Vec<_>>()
|
||||
.join(" ")
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue