|
| 1 | +commit 585e751ad6cbf1d2fe212cca0004534ec9c8b472 |
| 2 | +Author: Kamil Trzciński < [email protected]> |
| 3 | +Date: Thu Dec 12 20:29:27 2024 +0100 |
| 4 | + |
| 5 | + Fix mismatched types on arm64 for `src/crypt.rs` |
| 6 | + |
| 7 | + --> /src/proxmox/proxmox-sys/src/crypt.rs:74:67 |
| 8 | + | |
| 9 | + 74 | if data.output.first().is_none() || Some(&('*' as i8)) == data.output.first() { |
| 10 | + | ^^^^^^^^^^^^^^^^^^^ expected `Option<&i8>`, found `Option<&u8>` |
| 11 | + | |
| 12 | + = note: expected enum `std::option::Option<&i8>` |
| 13 | + found enum `std::option::Option<&u8>` |
| 14 | + |
| 15 | +diff --git a/proxmox-sys/src/crypt.rs b/proxmox-sys/src/crypt.rs |
| 16 | +index 3313f668..a11c19f1 100644 |
| 17 | +--- a/proxmox-sys/src/crypt.rs |
| 18 | ++++ b/proxmox-sys/src/crypt.rs |
| 19 | +@@ -71,7 +71,7 @@ pub fn crypt(password: &[u8], salt: &[u8]) -> Result<String, Error> { |
| 20 | + // > output field of their data argument, and crypt writes an invalid hash to its static |
| 21 | + // > storage area. This string will be shorter than 13 characters, will begin with a ‘*’, |
| 22 | + // > and will not compare equal to setting. |
| 23 | +- if data.output.first().is_none() || Some(&('*' as i8)) == data.output.first() { |
| 24 | ++ if data.output.first().is_none() || Some(&('*' as libc::c_char)) == data.output.first() { |
| 25 | + bail!("internal error: crypt_r returned invalid hash"); |
| 26 | + } |
| 27 | + CStr::from_ptr(&data.output as *const _) |
| 28 | +@@ -133,7 +133,7 @@ pub fn crypt_gensalt(prefix: &str, count: u64, rbytes: &[u8]) -> Result<String, |
| 29 | + // while it states that this is "in addition" to returning a null pointer, this isn't how |
| 30 | + // `crypt_r` seems to behave (sometimes only setting an invalid hash) so add this here too just |
| 31 | + // in case. |
| 32 | +- if output.first().is_none() || Some(&('*' as i8)) == output.first() { |
| 33 | ++ if output.first().is_none() || Some(&('*' as libc::c_char)) == output.first() { |
| 34 | + bail!("internal error: crypt_gensalt_rn could not create a valid salt"); |
| 35 | + } |
| 36 | + |
0 commit comments