Fix posix extend to correctly remove the matching attribute during set. (#387)

This commit is contained in:
Firstyear 2021-03-25 10:33:37 +10:00 committed by GitHub
parent db3904759d
commit a22c8efe9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1085,9 +1085,15 @@ impl QueryServerWriteV1 {
"class".into(),
Value::new_class("posixaccount"),
)))
.chain(iter::once(gidnumber.as_ref().map(|_| {
Modify::Purged("gidnumber".into())
})))
.chain(iter::once(gidnumber.map(|n| {
Modify::Present("gidnumber".into(), Value::new_uint32(n))
})))
.chain(iter::once(shell.as_ref().map(|_| {
Modify::Purged("loginshell".into())
})))
.chain(iter::once(shell.map(|s| {
Modify::Present("loginshell".into(), Value::new_iutf8(s.as_str()))
})))