From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <pbs-devel-bounces@lists.proxmox.com> Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 3ED991FF168 for <inbox@lore.proxmox.com>; Tue, 4 Mar 2025 15:41:35 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 017C91D24; Tue, 4 Mar 2025 15:41:27 +0100 (CET) From: Maximiliano Sandoval <m.sandoval@proxmox.com> To: pbs-devel@lists.proxmox.com Date: Tue, 4 Mar 2025 15:40:43 +0100 Message-Id: <20250304144051.585163-1-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.101 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox 1/9] mark extern C blocks as unsafe X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion <pbs-devel.lists.proxmox.com> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pbs-devel>, <mailto:pbs-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pbs-devel/> List-Post: <mailto:pbs-devel@lists.proxmox.com> List-Help: <mailto:pbs-devel-request@lists.proxmox.com?subject=help> List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel>, <mailto:pbs-devel-request@lists.proxmox.com?subject=subscribe> Reply-To: Proxmox Backup Server development discussion <pbs-devel@lists.proxmox.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" <pbs-devel-bounces@lists.proxmox.com> This is required in edition 2024. Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com> --- The changes up to 'port to edition 2024' could be added as of now, the rest require changes in debcargo. proxmox-acme-api/src/certificate_helpers.rs | 2 +- proxmox-async/src/runtime.rs | 2 +- proxmox-rest-server/src/rest.rs | 2 +- proxmox-sys/src/crypt.rs | 4 ++-- proxmox-sys/src/fs/acl.rs | 2 +- proxmox-sys/src/linux/procfs/mod.rs | 2 +- proxmox-sys/src/linux/timer.rs | 4 ++-- proxmox-systemd/src/sys.rs | 2 +- proxmox-time/src/posix.rs | 2 +- proxmox-uuid/src/lib_uuid_bindings.rs | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/proxmox-acme-api/src/certificate_helpers.rs b/proxmox-acme-api/src/certificate_helpers.rs index d8eee604..a0d744c8 100644 --- a/proxmox-acme-api/src/certificate_helpers.rs +++ b/proxmox-acme-api/src/certificate_helpers.rs @@ -385,7 +385,7 @@ fn x509name_to_string(name: &openssl::x509::X509NameRef) -> Result<String, Error #[allow(non_camel_case_types)] type ASN1_TIME = <openssl::asn1::Asn1TimeRef as ForeignTypeRef>::CType; -extern "C" { +unsafe extern "C" { fn ASN1_TIME_to_tm(s: *const ASN1_TIME, tm: *mut libc::tm) -> libc::c_int; } diff --git a/proxmox-async/src/runtime.rs b/proxmox-async/src/runtime.rs index 0721fd9e..c36dea88 100644 --- a/proxmox-async/src/runtime.rs +++ b/proxmox-async/src/runtime.rs @@ -45,7 +45,7 @@ use tokio::runtime::{self, Runtime, RuntimeFlavor}; static RUNTIME: LazyLock<Mutex<Weak<Runtime>>> = LazyLock::new(|| Mutex::new(Weak::new())); #[link(name = "crypto")] -extern "C" { +unsafe extern "C" { fn OPENSSL_thread_stop(); } diff --git a/proxmox-rest-server/src/rest.rs b/proxmox-rest-server/src/rest.rs index d23ed776..c11a9b0c 100644 --- a/proxmox-rest-server/src/rest.rs +++ b/proxmox-rest-server/src/rest.rs @@ -36,7 +36,7 @@ use crate::{ formatter::*, normalize_path, ApiConfig, AuthError, CompressionMethod, RestEnvironment, }; -extern "C" { +unsafe extern "C" { fn tzset(); } diff --git a/proxmox-sys/src/crypt.rs b/proxmox-sys/src/crypt.rs index b802040b..508b9c15 100644 --- a/proxmox-sys/src/crypt.rs +++ b/proxmox-sys/src/crypt.rs @@ -38,7 +38,7 @@ struct CryptData { /// Encrypt a password - see man crypt(3) pub fn crypt(password: &[u8], salt: &[u8]) -> Result<String, Error> { #[link(name = "crypt")] - extern "C" { + unsafe extern "C" { #[link_name = "crypt_r"] fn __crypt_r( key: *const libc::c_char, @@ -87,7 +87,7 @@ pub fn crypt(password: &[u8], salt: &[u8]) -> Result<String, Error> { /// - `rbytes`: The byte slice that contains cryptographically random bytes for generating the salt pub fn crypt_gensalt(prefix: &str, count: u64, rbytes: &[u8]) -> Result<String, Error> { #[link(name = "crypt")] - extern "C" { + unsafe extern "C" { #[link_name = "crypt_gensalt_rn"] fn __crypt_gensalt_rn( prefix: *const libc::c_char, diff --git a/proxmox-sys/src/fs/acl.rs b/proxmox-sys/src/fs/acl.rs index 5ae69296..29aa75ab 100644 --- a/proxmox-sys/src/fs/acl.rs +++ b/proxmox-sys/src/fs/acl.rs @@ -54,7 +54,7 @@ mod constants { pub use constants::*; #[link(name = "acl")] -extern "C" { +unsafe extern "C" { fn acl_get_file(path: *const c_char, acl_type: ACLType) -> *mut c_void; fn acl_set_file(path: *const c_char, acl_type: ACLType, acl: *mut c_void) -> c_int; fn acl_get_fd(fd: RawFd) -> *mut c_void; diff --git a/proxmox-sys/src/linux/procfs/mod.rs b/proxmox-sys/src/linux/procfs/mod.rs index 0875fcf8..3b25ce70 100644 --- a/proxmox-sys/src/linux/procfs/mod.rs +++ b/proxmox-sys/src/linux/procfs/mod.rs @@ -20,7 +20,7 @@ pub use mountinfo::MountInfo; /// POSIX sysconf call pub fn sysconf(name: i32) -> i64 { - extern "C" { + unsafe extern "C" { fn sysconf(name: i32) -> i64; } unsafe { sysconf(name) } diff --git a/proxmox-sys/src/linux/timer.rs b/proxmox-sys/src/linux/timer.rs index 462af976..bb01dc81 100644 --- a/proxmox-sys/src/linux/timer.rs +++ b/proxmox-sys/src/linux/timer.rs @@ -70,7 +70,7 @@ type TimerT = *mut InternalTimerT; // These wrappers are defined in -lrt. #[link(name = "rt")] -extern "C" { +unsafe extern "C" { fn timer_create(clockid: clockid_t, evp: *mut libc::sigevent, timer: *mut TimerT) -> c_int; fn timer_delete(timer: TimerT) -> c_int; fn timer_settime( @@ -232,7 +232,7 @@ pub const SIGTIMEOUT: Signal = Signal(32 + 4); // Our timeout handler does exactly nothing. We only need it to interrupt // system calls. -extern "C" fn sig_timeout_handler(_: c_int) {} +unsafe extern "C" fn sig_timeout_handler(_: c_int) {} // See setup_timeout_handler(). fn do_setup_timeout_handler() -> io::Result<()> { diff --git a/proxmox-systemd/src/sys.rs b/proxmox-systemd/src/sys.rs index 64075929..eabd44d1 100644 --- a/proxmox-systemd/src/sys.rs +++ b/proxmox-systemd/src/sys.rs @@ -5,7 +5,7 @@ use std::os::fd::RawFd; pub const LISTEN_FDS_START: RawFd = 3; #[link(name = "systemd")] -extern "C" { +unsafe extern "C" { pub fn sd_journal_stream_fd( identifier: *const c_uchar, priority: c_int, diff --git a/proxmox-time/src/posix.rs b/proxmox-time/src/posix.rs index bb60ba04..c8064bf4 100644 --- a/proxmox-time/src/posix.rs +++ b/proxmox-time/src/posix.rs @@ -142,7 +142,7 @@ pub fn strftime(format: &str, t: &libc::tm) -> Result<String, Error> { // The `libc` crate does not yet contain bindings for `strftime_l` #[link(name = "c")] -extern "C" { +unsafe extern "C" { #[link_name = "strftime_l"] fn libc_strftime_l( s: *mut libc::c_char, diff --git a/proxmox-uuid/src/lib_uuid_bindings.rs b/proxmox-uuid/src/lib_uuid_bindings.rs index 0ecd994d..e39847e4 100644 --- a/proxmox-uuid/src/lib_uuid_bindings.rs +++ b/proxmox-uuid/src/lib_uuid_bindings.rs @@ -3,7 +3,7 @@ use std::fmt; use crate::Uuid; #[link(name = "uuid")] -extern "C" { +unsafe extern "C" { pub fn uuid_generate(out: *mut [u8; 16]); fn uuid_unparse_lower(input: *const [u8; 16], out: *mut u8); fn uuid_unparse_upper(input: *const [u8; 16], out: *mut u8); -- 2.39.5 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel