Skip to content

Commit 1e33e77

Browse files
committed
add passwords to Groups
1 parent e7c7021 commit 1e33e77

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/unistd.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2671,6 +2671,8 @@ impl User {
26712671
pub struct Group {
26722672
/// Group name
26732673
pub name: String,
2674+
/// Group password
2675+
pub passwd: CString,
26742676
/// Group ID
26752677
pub gid: Gid,
26762678
/// List of Group members
@@ -2683,6 +2685,7 @@ impl From<&libc::group> for Group {
26832685
unsafe {
26842686
Group {
26852687
name: CStr::from_ptr((*gr).gr_name).to_string_lossy().into_owned(),
2688+
passwd: CString::new(CStr::from_ptr((*gr).gr_passwd).to_bytes()).unwrap(),
26862689
gid: Gid::from_raw((*gr).gr_gid),
26872690
mem: Group::members((*gr).gr_mem)
26882691
}

0 commit comments

Comments
 (0)