Skip to content

Commit 8dc757b

Browse files
committed
add passwords to Groups
1 parent e7c7021 commit 8dc757b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
55

66
## [Unreleased] - ReleaseDate
77
### Added
8+
9+
- Added a `passwd` field to `Group` (#[1338](https://github.com/nix-rust/nix/pull/1338))
810
- Added `mremap` (#[1306](https://github.com/nix-rust/nix/pull/1306))
911
- Added `personality` (#[1331](https://github.com/nix-rust/nix/pull/1331))
1012
- Added limited Fuchsia support (#[1285](https://github.com/nix-rust/nix/pull/1285))

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)