From 94b33d7a7de21d9bcfe2b406f87d57ef53559e58 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 24 Oct 2025 14:52:12 -0700 Subject: [PATCH 1/2] Update dependency versions. In particular, this updates to io-lifetimes 3.0.0 and io-extras 0.19. --- Cargo.toml | 4 ++-- cap-async-std/Cargo.toml | 4 ++-- cap-directories/Cargo.toml | 2 +- cap-fs-ext/Cargo.toml | 4 ++-- cap-primitives/Cargo.toml | 6 +++--- cap-primitives/src/windows/fs/create_file_at_w.rs | 12 +++++++----- cap-std/Cargo.toml | 4 ++-- cap-tempfile/Cargo.toml | 2 +- fuzz/Cargo.toml | 2 +- 9 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 650d8e9e..de842c6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ rand = "0.8.1" tempfile = "3.1.0" camino = "1.0.5" libc = "0.2.100" -io-lifetimes = "2.0.0" +io-lifetimes = "3.0.1" [target.'cfg(not(windows))'.dev-dependencies] rustix = { version = "1.0.0", features = ["fs"] } @@ -41,7 +41,7 @@ rustix = { version = "1.0.0", features = ["fs"] } nt_version = "0.1.3" [target.'cfg(windows)'.dependencies.windows-sys] -version = ">=0.52, <=0.59" +version = ">=0.60, <0.62" features = [ "Win32_Storage_FileSystem", "Win32_Foundation", diff --git a/cap-async-std/Cargo.toml b/cap-async-std/Cargo.toml index c202e649..7a90e608 100644 --- a/cap-async-std/Cargo.toml +++ b/cap-async-std/Cargo.toml @@ -16,8 +16,8 @@ edition = "2021" arf-strings = { version = "0.7.0", optional = true } async-std = { version = "1.13.0", features = ["attributes", "io_safety"] } cap-primitives = { path = "../cap-primitives", version = "^3.4.5" } -io-lifetimes = { version = "2.0.0", default-features = false, features = ["async-std"] } -io-extras = { version = "0.18.3", features = ["use_async_std"] } +io-lifetimes = { version = "3.0.1", default-features = false, features = ["async-std"] } +io-extras = { version = "0.19.0", features = ["use_async_std"] } camino = { version = "1.0.5", optional = true } [target.'cfg(not(windows))'.dependencies] diff --git a/cap-directories/Cargo.toml b/cap-directories/Cargo.toml index 6a060fde..d1a31790 100644 --- a/cap-directories/Cargo.toml +++ b/cap-directories/Cargo.toml @@ -20,7 +20,7 @@ directories-next = "2.0.0" rustix = { version = "1.0.0" } [target.'cfg(windows)'.dependencies.windows-sys] -version = ">=0.52, <=0.59" +version = ">=0.60, <0.62" features = [ "Win32_Foundation", ] diff --git a/cap-fs-ext/Cargo.toml b/cap-fs-ext/Cargo.toml index c5b9df26..f05872ed 100644 --- a/cap-fs-ext/Cargo.toml +++ b/cap-fs-ext/Cargo.toml @@ -17,7 +17,7 @@ arf-strings = { version = "0.7.0", optional = true } cap-async-std = { path = "../cap-async-std", optional = true, version = "3.4.5" } cap-std = { path = "../cap-std", optional = true, version = "3.4.5" } cap-primitives = { path = "../cap-primitives", version = "3.4.5" } -io-lifetimes = { version = "2.0.0", default-features = false } +io-lifetimes = { version = "3.0.1", default-features = false } async-std = { version = "1.13.0", features = ["io_safety", "attributes"], optional = true } async-trait = { version = "0.1.42", optional = true } camino = { version = "1.0.5", optional = true } @@ -32,7 +32,7 @@ async_std_fs_utf8 = ["cap-async-std/fs_utf8", "camino"] async_std_arf_strings = ["cap-async-std/arf_strings", "async_std_fs_utf8", "arf-strings"] [target.'cfg(windows)'.dependencies.windows-sys] -version = ">=0.52, <=0.59" +version = ">=0.60, <0.62" features = [ "Win32_Storage_FileSystem", ] diff --git a/cap-primitives/Cargo.toml b/cap-primitives/Cargo.toml index b93d29fd..c5b40f34 100644 --- a/cap-primitives/Cargo.toml +++ b/cap-primitives/Cargo.toml @@ -18,8 +18,8 @@ arbitrary = { version = "1.0.0", optional = true, features = ["derive"] } ipnet = "2.5.0" maybe-owned = "0.3.4" fs-set-times = "0.20.0" -io-extras = "0.18.3" -io-lifetimes = { version = "2.0.0", default-features = false } +io-extras = "0.19.0" +io-lifetimes = { version = "3.0.1", default-features = false } [dev-dependencies] cap-tempfile = { path = "../cap-tempfile" } @@ -34,7 +34,7 @@ rustix-linux-procfs = "0.1.1" winx = "0.36.0" [target.'cfg(windows)'.dependencies.windows-sys] -version = ">=0.52, <=0.59" +version = ">=0.60, <0.62" features = [ "Win32_Foundation", "Win32_Security", diff --git a/cap-primitives/src/windows/fs/create_file_at_w.rs b/cap-primitives/src/windows/fs/create_file_at_w.rs index cefa7932..392bc886 100644 --- a/cap-primitives/src/windows/fs/create_file_at_w.rs +++ b/cap-primitives/src/windows/fs/create_file_at_w.rs @@ -16,9 +16,10 @@ use windows_sys::Win32::Foundation::{ GENERIC_WRITE, HANDLE, INVALID_HANDLE_VALUE, STATUS_OBJECT_NAME_COLLISION, STATUS_PENDING, STATUS_SUCCESS, SUCCESS, UNICODE_STRING, }; +use windows_sys::Win32::Foundation::{OBJ_CASE_INSENSITIVE, OBJ_INHERIT}; use windows_sys::Win32::Security::{ - SECURITY_ATTRIBUTES, SECURITY_DYNAMIC_TRACKING, SECURITY_QUALITY_OF_SERVICE, - SECURITY_STATIC_TRACKING, + SECURITY_ATTRIBUTES, SECURITY_DESCRIPTOR, SECURITY_DYNAMIC_TRACKING, + SECURITY_QUALITY_OF_SERVICE, SECURITY_STATIC_TRACKING, }; use windows_sys::Win32::Storage::FileSystem::{ CREATE_ALWAYS, CREATE_NEW, DELETE, FILE_ATTRIBUTE_ARCHIVE, FILE_ATTRIBUTE_COMPRESSED, @@ -36,7 +37,6 @@ use windows_sys::Win32::Storage::FileSystem::{ OPEN_ALWAYS, OPEN_EXISTING, SECURITY_CONTEXT_TRACKING, SECURITY_EFFECTIVE_ONLY, SECURITY_SQOS_PRESENT, SYNCHRONIZE, TRUNCATE_EXISTING, }; -use windows_sys::Win32::System::Kernel::{OBJ_CASE_INSENSITIVE, OBJ_INHERIT}; use windows_sys::Win32::System::WindowsProgramming::{ FILE_OPENED, FILE_OPEN_NO_RECALL, FILE_OPEN_REMOTE_INSTANCE, FILE_OVERWRITTEN, }; @@ -159,7 +159,9 @@ pub unsafe fn CreateFileAtW( objectattributes.ObjectName = &mut unicode_string; objectattributes.Attributes = attributes; if !lpsecurityattributes.is_null() { - objectattributes.SecurityDescriptor = (*lpsecurityattributes).lpSecurityDescriptor; + objectattributes.SecurityDescriptor = (*lpsecurityattributes) + .lpSecurityDescriptor + .cast::(); } // If needed, set `objectattributes`' `SecurityQualityOfService` field. @@ -172,7 +174,7 @@ pub unsafe fn CreateFileAtW( SECURITY_DYNAMIC_TRACKING } else { SECURITY_STATIC_TRACKING - }; + } as u8; qos.EffectiveOnly = ((dwflagsandattributes & SECURITY_EFFECTIVE_ONLY) != 0) as _; objectattributes.SecurityQualityOfService = diff --git a/cap-std/Cargo.toml b/cap-std/Cargo.toml index 9487ba2f..236c8f8b 100644 --- a/cap-std/Cargo.toml +++ b/cap-std/Cargo.toml @@ -19,8 +19,8 @@ rustdoc-args = ["--cfg=docsrs"] [dependencies] arf-strings = { version = "0.7.0", optional = true } cap-primitives = { path = "../cap-primitives", version = "^3.4.5" } -io-extras = "0.18.3" -io-lifetimes = { version = "2.0.0", default-features = false } +io-extras = "0.19.0" +io-lifetimes = { version = "3.0.1", default-features = false } camino = { version = "1.0.5", optional = true } [target.'cfg(not(windows))'.dependencies] diff --git a/cap-tempfile/Cargo.toml b/cap-tempfile/Cargo.toml index cc4b294e..a5a0beef 100644 --- a/cap-tempfile/Cargo.toml +++ b/cap-tempfile/Cargo.toml @@ -27,7 +27,7 @@ rustix = { version = "1.0.0" } rustix-linux-procfs = "0.1.1" [target.'cfg(windows)'.dev-dependencies.windows-sys] -version = ">=0.52, <=0.59" +version = ">=0.60, <0.62" features = [ "Win32_Foundation", ] diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index e0dd17b1..cfee148b 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -15,7 +15,7 @@ cap-primitives = { path = "../cap-primitives", features = ["arbitrary"] } # Depend on io-lifetimes with default features, as the fuzzing framework # seems to add a dependency on `io_lifetimes::OwnedFd::drop` even when the # code itself doesn't have one. -io-lifetimes = "2.0.0" +io-lifetimes = "3.0.1" [[bin]] name = "cap-primitives" From 4eda112c55159dbe3725043a47b2847d78df7c40 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 24 Oct 2025 15:04:59 -0700 Subject: [PATCH 2/2] Fix Windows. --- tests/sys_common/symlink_junction.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/sys_common/symlink_junction.rs b/tests/sys_common/symlink_junction.rs index 6a7f0b20..31da73bc 100644 --- a/tests/sys_common/symlink_junction.rs +++ b/tests/sys_common/symlink_junction.rs @@ -75,9 +75,7 @@ pub struct REPARSE_MOUNTPOINT_DATA_BUFFER { #[cfg(windows)] #[allow(dead_code)] -pub fn cvt( - i: windows_sys::Win32::Foundation::BOOL, -) -> io::Result { +pub fn cvt(i: windows_sys::core::BOOL) -> io::Result { if i == 0 { Err(io::Error::last_os_error()) } else {