diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec801b3a..544721ff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -362,7 +362,7 @@ jobs: include: - build: msrv os: ubuntu-latest - rust: 1.63 + rust: "1.70" steps: - uses: actions/checkout@v4 @@ -372,7 +372,7 @@ jobs: with: toolchain: ${{ matrix.rust }} - - name: Use specific dependency versions for Rust 1.63 compatibility. + - name: Use specific dependency versions for Rust 1.70 compatibility. run: | cargo update --package=once_cell --precise=1.20.3 diff --git a/Cargo.toml b/Cargo.toml index 68e05c05..ddbbea11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ edition = "2021" publish = false exclude = ["/.*"] # This is also checked in CI. -rust-version = "1.63" +rust-version = "1.70" [dev-dependencies] anyhow = "1.0.37" @@ -28,7 +28,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"] } @@ -39,7 +39,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/README.md b/README.md index 832558e9..ebaee5f4 100644 --- a/README.md +++ b/README.md @@ -246,7 +246,7 @@ the process filesystem namespace. ## Minimum Supported Rust Version (MSRV) -This crate currently works on Rust 1.63, when default features are enabled. +This crate currently works on Rust 1.70, when default features are enabled. Some of the optional features have stricter requirements. [`arf-strings`]: https://github.com/bytecodealliance/arf-strings/ 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 fc1a396f..e5a5ecfe 100644 --- a/cap-fs-ext/Cargo.toml +++ b/cap-fs-ext/Cargo.toml @@ -16,7 +16,7 @@ edition = "2021" arf-strings = { version = "0.7.0", optional = true } 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 } camino = { version = "1.0.5", optional = true } [features] @@ -26,7 +26,7 @@ arf_strings = ["cap-std/arf_strings", "fs_utf8", "arf-strings"] std = ["cap-std"] [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" 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 {