From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id EBA211FF0C0 for ; Wed, 21 Oct 2026 14:53:20 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 195002156D; Wed, 21 Oct 2026 14:53:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jing.rocks; h=cc :cc:content-transfer-encoding:date:from:from:message-id :mime-version:reply-to:subject:subject:to:to; s=mail-gw; bh=km2B 4H4wnvj1v4gfdbXSLLxct6/H+F7QdOmdj1Htp3k=; b=ZbVCTAXEGaxTbAGzEaM8 SBzG/5btJ6OtVqkY/JrzKftB07CtuPQRJ44RemhydGSCTKtE5bM2tVVJ6TbC7lSy gBDqjLWN+x+MZ3cBMQdM9u9DpKFmNYUBGvEc0d5wOB1NBMrZ3Od+yKJnYPlmnqjr HQI14ra8hFlJl+ZgZnFbU7azlFICU88iWdASrtZvGcPaT7J/Ty3BzuC3Mepunwxk U3AHEPDYy/8mW7poZr+/perYQ56LIMFmdlVBxEaPm7xvxGGOQkBeMqIbQJujA3iV gtH3R8DnM6nDR01yQgo9q2NeAfwsFqp/7xpb1IJSXFK+/hlzo1TG0E4fT4v98z3s Xg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=jing.rocks; s=default; t=1792587166; bh=sZs/xTlbm3PLEhuLrKzWd2YP0dwq1euhstBWPrCkV08=; h=From:To:Cc:Subject:Date:From; b=lQ9Cz0xEsb0sonWav6RPxObBBLpbC8E0ODizfmn8t6Tff7EiD0VQMcthDYHmqBR0L w9xlf16D95RZLTI+AC4QGPFdH3kvzqPN1y1Gqgv2xJ5Vaagfe8mInMdfrjslzReUpB yKkatRWxMNup9eH/K4c1DGBaaBnfvT6PKA9+xaGQm5Z08bhMrZ3k05eyloG6Hvcb6s imajr78JL3jcBhOS/UjaH8XC96TBNGf3hLmRitzso34IN/HUXHsPihx48XlWJC9Qy3 bqeiBBTs2ya6ofi2GlibM7qejdynXS8oTh7eI3ufhb/hF6PnFoK3eJTaP09SYL+fWF x3ZOb9wN82GMA== From: Luke Yasuda To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox-datacenter-manager] cli/proxmox-fido2: fix mismatched type on other arches Date: Wed, 21 Oct 2026 21:51:13 +0900 Message-ID: <20261021125228.210884-1-jing@jing.rocks> X-Mailer: git-send-email 2.56.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy KAM_INFOUSMEBIZ 0.75 Prevalent use of .info|.us|.me|.me.uk|.biz|xyz|id|rocks|life domains in spam/malware KAM_OTHER_BAD_TLD 0.75 Other untrustworthy TLDs SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: TUVUW6DEOWWJJHOVPJRO77JD33YDSF6C X-Message-ID-Hash: TUVUW6DEOWWJJHOVPJRO77JD33YDSF6C X-MailFrom: jing@jing.rocks X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Luke Yasuda X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This fixes FTBFS on non-amd64 platforms: mismatched types, expected u8 but got i8. --- This is more like an RFC, and I have little experience in rust and don't know what I'm doing, but it builds and passes the tests. --- cli/proxmox-fido2/src/lib.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/cli/proxmox-fido2/src/lib.rs b/cli/proxmox-fido2/src/lib.rs index afed3496..5413b9c0 100644 --- a/cli/proxmox-fido2/src/lib.rs +++ b/cli/proxmox-fido2/src/lib.rs @@ -1,5 +1,5 @@ use std::error::Error as StdError; -use std::ffi::{CStr, CString, OsStr, c_int, c_void}; +use std::ffi::{CStr, CString, OsStr, c_int, c_void, c_char}; use std::fmt; use std::path::{Path, PathBuf}; use std::sync::{Arc, Mutex}; @@ -92,7 +92,7 @@ impl Dl { pub struct Lib { _lib: Dl, fido_init: extern "C" fn(c_int), - fido_strerr: extern "C" fn(c_int) -> *const i8, + fido_strerr: extern "C" fn(c_int) -> *const c_char, fido_dev_new: extern "C" fn() -> *mut c_void, fido_dev_free: extern "C" fn(&mut *mut c_void), @@ -101,22 +101,22 @@ pub struct Lib { fido_dev_cancel: extern "C" fn(*mut c_void), fido_dev_is_fido2: extern "C" fn(*mut c_void) -> c_int, fido_dev_get_cbor_info: extern "C" fn(*mut c_void, *mut c_void) -> c_int, - fido_dev_make_cred: extern "C" fn(*mut c_void, *mut c_void, *const i8) -> c_int, - fido_dev_get_assert: extern "C" fn(*mut c_void, *mut c_void, *const i8) -> c_int, + fido_dev_make_cred: extern "C" fn(*mut c_void, *mut c_void, *const c_char) -> c_int, + fido_dev_get_assert: extern "C" fn(*mut c_void, *mut c_void, *const c_char) -> c_int, fido_dev_info_new: extern "C" fn(libc::size_t) -> *mut c_void, fido_dev_info_free: extern "C" fn(&mut *mut c_void, libc::size_t), fido_dev_info_manifest: extern "C" fn(*mut c_void, libc::size_t, *mut libc::size_t) -> c_int, fido_dev_info_ptr: extern "C" fn(*mut c_void, libc::size_t) -> *mut c_void, - fido_dev_info_manufacturer_string: extern "C" fn(*mut c_void) -> *const i8, - fido_dev_info_path: extern "C" fn(*mut c_void) -> *const i8, - fido_dev_info_product_string: extern "C" fn(*mut c_void) -> *const i8, + fido_dev_info_manufacturer_string: extern "C" fn(*mut c_void) -> *const c_char, + fido_dev_info_path: extern "C" fn(*mut c_void) -> *const c_char, + fido_dev_info_product_string: extern "C" fn(*mut c_void) -> *const c_char, fido_dev_get_touch_begin: extern "C" fn(*mut c_void) -> c_int, fido_dev_get_touch_status: extern "C" fn(*mut c_void, *mut c_int, c_int) -> c_int, fido_cbor_info_new: extern "C" fn() -> *mut c_void, fido_cbor_info_free: extern "C" fn(&mut *mut c_void), - fido_cbor_info_extensions_ptr: extern "C" fn(*mut c_void) -> *const *const i8, + fido_cbor_info_extensions_ptr: extern "C" fn(*mut c_void) -> *const *const c_char, fido_cbor_info_extensions_len: extern "C" fn(*mut c_void) -> libc::size_t, fido_cbor_info_options_name_ptr: extern "C" fn(*mut c_void) -> *const *const i8, fido_cbor_info_options_value_ptr: extern "C" fn(*mut c_void) -> *const i8, @@ -126,16 +126,16 @@ pub struct Lib { fido_cred_free: extern "C" fn(&mut *mut c_void), fido_cred_exclude: extern "C" fn(*mut c_void, *const u8, libc::size_t) -> c_int, fido_cred_set_extensions: extern "C" fn(*mut c_void, c_int) -> c_int, - fido_cred_set_rp: extern "C" fn(*mut c_void, *const i8, *const i8) -> c_int, - fido_cred_set_fmt: extern "C" fn(*mut c_void, *const i8) -> c_int, + fido_cred_set_rp: extern "C" fn(*mut c_void, *const c_char, *const c_char) -> c_int, + fido_cred_set_fmt: extern "C" fn(*mut c_void, *const c_char) -> c_int, fido_cred_set_type: extern "C" fn(*mut c_void, c_int) -> c_int, fido_cred_set_user: extern "C" fn( *mut c_void, *const u8, libc::size_t, - *const i8, - *const i8, - *const i8, + *const c_char, + *const c_char, + *const c_char, ) -> c_int, fido_cred_set_clientdata_hash: extern "C" fn(*mut c_void, *const u8, libc::size_t) -> c_int, fido_cred_set_rk: extern "C" fn(*mut c_void, FidoOpt) -> c_int, @@ -154,7 +154,7 @@ pub struct Lib { fido_assert_free: extern "C" fn(&mut *mut c_void), fido_assert_set_extensions: extern "C" fn(*mut c_void, c_int) -> c_int, fido_assert_set_hmac_salt: extern "C" fn(*mut c_void, *const u8, libc::size_t) -> c_int, - fido_assert_set_rp: extern "C" fn(*mut c_void, *const i8) -> c_int, + fido_assert_set_rp: extern "C" fn(*mut c_void, *const c_char) -> c_int, fido_assert_set_clientdata_hash: extern "C" fn(*mut c_void, *const u8, libc::size_t) -> c_int, fido_assert_allow_cred: extern "C" fn(*mut c_void, *const u8, libc::size_t) -> c_int, fido_assert_set_up: extern "C" fn(*mut c_void, FidoOpt) -> c_int, @@ -692,7 +692,7 @@ impl FidoDev { let extensions = (self.lib.fido_cbor_info_extensions_ptr)(info.info); if !extensions.is_null() { let len = (self.lib.fido_cbor_info_extensions_len)(info.info); - let extensions = unsafe { std::slice::from_raw_parts(extensions as *const &i8, len) }; + let extensions = unsafe { std::slice::from_raw_parts(extensions as *const &c_char, len) }; for ext in extensions { let name = unsafe { CStr::from_ptr(*ext) }; if name.to_bytes() == b"hmac-secret" { @@ -712,7 +712,7 @@ impl FidoDev { let len = (self.lib.fido_cbor_info_options_len)(info.info); let option_names = - unsafe { std::slice::from_raw_parts(option_names as *const &i8, len) }; + unsafe { std::slice::from_raw_parts(option_names as *const &c_char, len) }; let option_values = unsafe { std::slice::from_raw_parts(option_values, len) }; for (name, value) in std::iter::zip(option_names, option_values) { -- 2.55.0