Skip to content

Commit

Permalink
Merge pull request #36 from rasmuspeders1/main
Browse files Browse the repository at this point in the history
Only show first part of /etc/passwd gecos field
  • Loading branch information
rharish101 committed Aug 3, 2023
2 parents 8ef03fc + f148a62 commit 1962191
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/sysutil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,13 @@ impl SysUtil {
);
entry.name.clone()
} else {
// Only take first entry in gecos field.
let gecos_name_part: &str = gecos.split(',').next().unwrap_or(&gecos);
debug!(
"Found user '{}' with UID '{}' and full name: {gecos}",
"Found user '{}' with UID '{}' and full name: {gecos_name_part}",
entry.name, entry.uid
);
gecos
gecos_name_part.into()
}
} else {
debug!(
Expand Down

0 comments on commit 1962191

Please sign in to comment.