Mercurial > crates > nonstick
comparison testharness/src/lib.rs @ 182:346dc13724ce
Check for Sun-specific password change behavior.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Wed, 30 Jul 2025 18:39:41 -0400 |
parents | 46e8ce5cd5d1 |
children | 42f747774d94 |
comparison
equal
deleted
inserted
replaced
181:a8c814843ccb | 182:346dc13724ce |
---|---|
90 action: AuthtokAction, | 90 action: AuthtokAction, |
91 _flags: AuthtokFlags, | 91 _flags: AuthtokFlags, |
92 ) -> nonstick::Result<()> { | 92 ) -> nonstick::Result<()> { |
93 match action { | 93 match action { |
94 AuthtokAction::Validate => { | 94 AuthtokAction::Validate => { |
95 if handle.old_authtok(None)?.as_bytes() != b"old token!" { | 95 let expected: &[u8] = if cfg!(pam_impl = "Sun") { |
96 b"valid" | |
97 } else { | |
98 b"old token!" | |
99 }; | |
100 if handle.old_authtok(None)?.as_bytes() != expected { | |
96 return Err(ErrorCode::AuthenticationError); | 101 return Err(ErrorCode::AuthenticationError); |
97 } | 102 } |
98 Ok(()) | 103 Ok(()) |
99 } | 104 } |
100 AuthtokAction::Update => { | 105 AuthtokAction::Update => { |