From 1e33e7734fe684f25f381c1d1dfdce661962db2a Mon Sep 17 00:00:00 2001 From: Ben Linsay Date: Sat, 26 Sep 2020 19:50:27 -0400 Subject: [PATCH] add passwords to Groups --- src/unistd.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/unistd.rs b/src/unistd.rs index dd33559624..7a4517e65f 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -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 @@ -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) }