Skip to content

Commit

Permalink
add passwords to Groups
Browse files Browse the repository at this point in the history
  • Loading branch information
blinsay committed Feb 7, 2021
1 parent e7c7021 commit 1e33e77
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/unistd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2671,6 +2671,8 @@ impl User {
pub struct Group {
/// Group name
pub name: String,
/// Group password
pub passwd: CString,
/// Group ID
pub gid: Gid,
/// List of Group members
Expand All @@ -2683,6 +2685,7 @@ impl From<&libc::group> for Group {
unsafe {
Group {
name: CStr::from_ptr((*gr).gr_name).to_string_lossy().into_owned(),
passwd: CString::new(CStr::from_ptr((*gr).gr_passwd).to_bytes()).unwrap(),
gid: Gid::from_raw((*gr).gr_gid),
mem: Group::members((*gr).gr_mem)
}
Expand Down

0 comments on commit 1e33e77

Please sign in to comment.