Skip to content

Commit 63da96e

Browse files
committed
add passwords to Groups
1 parent 1794a47 commit 63da96e

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
@@ -2653,6 +2653,8 @@ impl User {
26532653
pub struct Group {
26542654
/// Group name
26552655
pub name: String,
2656+
/// Group password
2657+
pub passwd: CString,
26562658
/// Group ID
26572659
pub gid: Gid,
26582660
/// List of Group members
@@ -2665,6 +2667,7 @@ impl From<&libc::group> for Group {
26652667
unsafe {
26662668
Group {
26672669
name: CStr::from_ptr((*gr).gr_name).to_string_lossy().into_owned(),
2670+
passwd: CString::new(CStr::from_ptr((*gr).gr_passwd).to_bytes()).unwrap(),
26682671
gid: Gid::from_raw((*gr).gr_gid),
26692672
mem: Group::members((*gr).gr_mem)
26702673
}

0 commit comments

Comments
 (0)