Skip to content

Commit d53f785

Browse files
committed
fix: Fix mismatched types on arm64 for src/crypt.rs (v3.2.7)
1 parent bb5c741 commit d53f785

5 files changed

+43
-7
lines changed

versions/v3.2.7/server/proxmox-backup~fix-cargo.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/Makefile b/Makefile
2-
index dfbaacab..d7620d73 100644
2+
index dfbaacab..d233d4e2 100644
33
--- a/Makefile
44
+++ b/Makefile
55
@@ -42,6 +42,7 @@ COMPILEDIR := target/$(DEB_HOST_RUST_TYPE)/release
@@ -11,10 +11,10 @@ index dfbaacab..d7620d73 100644
1111
ifeq ($(valgrind), yes)
1212
CARGO_BUILD_ARGS += --features valgrind
1313
diff --git a/debian/rules b/debian/rules
14-
index fa94743d..675fd445 100755
14+
index a82c3e12..d9606b6d 100755
1515
--- a/debian/rules
1616
+++ b/debian/rules
17-
@@ -9,7 +9,7 @@ include /usr/share/rustc/architecture.mk
17+
@@ -8,7 +8,7 @@ include /usr/share/rustc/architecture.mk
1818

1919
export BUILD_MODE=release
2020

versions/v3.2.7/server/proxmox-backup~multi-arch.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ index ef1e9ba1..29b6b234
4040
usr/sbin/proxmox-backup-debug
4141
usr/sbin/proxmox-backup-manager
4242
diff --git a/debian/rules b/debian/rules
43-
index a82c3e12..92fd6e90 100755
43+
index d9606b6d..8f524579 100755
4444
--- a/debian/rules
4545
+++ b/debian/rules
4646
@@ -2,6 +2,7 @@

versions/v3.2.7/server/proxmox-backup~no-cargo.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/debian/rules b/debian/rules
2-
index 92fd6e90..fa94743d 100755
2+
index 8f524579..675fd445 100755
33
--- a/debian/rules
44
+++ b/debian/rules
55
@@ -28,7 +28,7 @@ endif

versions/v3.2.7/server/proxmox-perl-rs~no-test.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/pve-rs/debian/control b/pve-rs/debian/control
2-
index f752163..ee8d418 100644
2+
index b4a3485..ac1bbb9 100644
33
--- a/pve-rs/debian/control
44
+++ b/pve-rs/debian/control
5-
@@ -19,7 +19,6 @@ Architecture: any
5+
@@ -49,7 +49,6 @@ Architecture: any
66
Depends: ${misc:Depends},
77
${perl:Depends},
88
${shlibs:Depends},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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

Comments
 (0)