comparison src/libpam/handle.rs @ 175:e30775c80b49

Separate #[cfg(feature = "link")] from other features.
author Paul Fisher <paul@pfish.zone>
date Wed, 30 Jul 2025 14:57:12 -0400
parents 9e4ce1631bd3
children 0730f5f2ee2a
comparison
equal deleted inserted replaced
174:9e4ce1631bd3 175:e30775c80b49
500 } 500 }
501 501
502 #[cfg(pam_impl = "Sun")] 502 #[cfg(pam_impl = "Sun")]
503 fn get_authtok(&mut self, _prompt: Option<&OsStr>, item_type: ItemType) -> Result<OsString> { 503 fn get_authtok(&mut self, _prompt: Option<&OsStr>, item_type: ItemType) -> Result<OsString> {
504 unsafe { items::get_cstr_item(self, item_type) }?.ok_or(ErrorCode::ConversationError) 504 unsafe { items::get_cstr_item(self, item_type) }?.ok_or(ErrorCode::ConversationError)
505 }
506
507 #[cfg(not(any(pam_impl = "LinuxPam", pam_impl = "OpenPam", pam_impl = "Sun")))]
508 fn get_authtok(&mut self, _: Option<&OsStr>, _: ItemType) -> Result<OsString> {
509 // We don't have an authtok implementation for other PAM implementations.
510 Err(ErrorCode::ConversationError)
505 } 511 }
506 512
507 /// Gets the `PAM_CONV` item from the handle. 513 /// Gets the `PAM_CONV` item from the handle.
508 fn conversation_item(&self) -> Result<&PamConv> { 514 fn conversation_item(&self) -> Result<&PamConv> {
509 let mut output: *const c_void = ptr::null(); 515 let mut output: *const c_void = ptr::null();