From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 1DD8E1FF0C4 for ; Tue, 27 Oct 2026 10:31:15 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E0CAE21635; Tue, 27 Oct 2026 10:31:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jing.rocks; h=cc :content-transfer-encoding:content-type:content-type:date:from :from:in-reply-to:message-id:mime-version:references:reply-to :subject:subject:to:to; s=mail-gw; bh=xbeTEb9stnIms27vQytqYFrIVV 80dwt9sxZy3SdeU/4=; b=kwiVRiEQc8nqUYGZS9lzbU6LZN1nssIciSJ+lszmXS dPoXULCv9IS5+YBamBrswayT2tYMEA3NcHe7m8L9FGt00vtIVfr7cgghzzKmBH/m 6wpbCu2ZOF41vafDiY5Vd2OrO5AdCG8FYjIh23MjLOTzL5RrBo3RAgzb2a0Re1IK NkdHQ1Mt9k7HTWqPeRWRENPoImmh+orLnIO3LwkISK4YpJOCmSFZ4UnC+h865+C3 Kt5jg8en7RjRvoxo41xf4lBSinMifArzhRz7WwT+KQ6FkarxzhQlqxf0NGH30Krv ZXI+9whQGqOSqYN4umvm+ubPXfu81wu9it4R36wV6kPg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=jing.rocks; s=default; t=1792595343; bh=2LHbsGFC0Kx6bJ8UrivRoIdQac1+ldyqUPI03XB13/w=; h=Date:From:To:Subject:In-Reply-To:References:From; b=CE4WxwAo1RdhZf9iZa8jJM7/FoQwnvmJozIHamfbzpfTqRLGD++lQ86i7gbkMhfn4 raNXEPnsDD+K0oDoJ/Uw2sRuiLA1d6ledggyzuo8QoLkNxCbfQp0qjZX9E5xIQp2hR el6zG/WIXh6iygTDK+Z29FkRlm5nzjjprQwhTSJYp5zMLFG+09Zluy1Cisuo3r8mTD EYPZwLyhEUGGTcBTx6sO/xCiycRXRnl0LAc2nwDWTaAOPTxAMggEMemob1SVjA7Ykd 7/gr2GoGtQJN3oroim5VH00rCAD7kDZdP6Nj3e+XgkdILxTbH/lgRFA5jVKmtbeywA EDlK9QjiXrVpA== MIME-Version: 1.0 Date: Thu, 22 Oct 2026 00:09:03 +0900 From: Luke Yasuda To: pdm-devel@lists.proxmox.com Subject: Fwd: [PATCH proxmox-datacenter-manager] cli/proxmox-fido2: fix mismatched type on other arches In-Reply-To: <20261021125228.210884-1-jing@jing.rocks> References: <20261021125228.210884-1-jing@jing.rocks> Message-ID: <8af3d9b019c07f2afd17cf46d2b0cc0f@jing.rocks> X-Sender: jing@jing.rocks Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit 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 X-MailFrom: jing@jing.rocks X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation Message-ID-Hash: 56G4VV6HMHEBG3OJ3ZEGSYHWYQYBV74J X-Message-ID-Hash: 56G4VV6HMHEBG3OJ3ZEGSYHWYQYBV74J X-Mailman-Approved-At: Tue, 27 Oct 2026 10:31:06 +0100 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Subject: [PATCH proxmox-datacenter-manager] cli/proxmox-fido2: fix mismatched type on other arches Date: 2026-10-21 21:51 From: Luke Yasuda To: pve-devel@lists.proxmox.com Cc: Luke Yasuda This fixes FTBFS on non-amd64 platforms: mismatched types, expected u8 but got i8. --- (resend, sent to the wrong list) 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) {