summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-05-11Merge #1699bors[bot]
1699: Revert "Pin nightly compiler used in CI for uclibc" r=rtzoeller a=asomers This reverts commit 23f18dfc18929965c95e0bcbdb8731645f07e401. libc v0.2.124 fixes the problem. Co-authored-by: Alan Somers <asomers@gmail.com>
2022-05-09Merge #1716bors[bot]
1716: Future-proof the kevent ABI r=rtzoeller a=asomers FreeBSD 12 changes struct kevent. For now, libc always binds to the 11-compat ABI. But that will change some day. Adjust Nix's code to build with either struct definition. Co-authored-by: Alan Somers <asomers@gmail.com>
2022-05-07Merge #1717bors[bot]
1717: Define FsType constants for musl r=asomers a=jirutka These constants are provided by Linux (linux/magic.h), not libc. See rust-lang/libc#2639. Co-authored-by: Jakub Jirutka <jakub@jirutka.cz>
2022-05-07Define FsType constants for muslJakub Jirutka
These constants are provided by Linux (linux/magic.h), not libc. See rust-lang/libc#2639.
2022-05-07Future-proof the kevent ABIAlan Somers
FreeBSD 12 changes struct kevent. For now, libc always binds to the 11-compat ABI. But that will change some day. Adjust Nix's code to build with either struct definition.
2022-05-07Merge #1715bors[bot]
1715: Log compiler version in Cirrus CI r=asomers a=rtzoeller Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2022-05-06Log compiler version in Cirrus CIRyan Zoeller
2022-05-03Merge #1711bors[bot]
1711: Restore conversions from ip v4/6 Sockaddr types to std::net equivalents. r=asomers a=khuey Fixes #1710 Co-authored-by: Kyle Huey <khuey@kylehuey.com>
2022-05-02Restore conversions from ip v4/6 Sockaddr types to std::net equivalents.Kyle Huey
Fixes #1710
2022-04-30Merge #1712bors[bot]
1712: Create new Unreleased changelog section r=asomers a=rtzoeller Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2022-04-30Create new Unreleased changelog sectionRyan Zoeller
2022-04-26Merge #1708bors[bot]
1708: Upgrade dev-dependencies to the latest versions r=asomers a=rtzoeller Don't change how the versions are specified (i.e. whether a patch version is listed). parking_lot cannot be upgraded due to 0.12.0 bumping the MSRV to 1.49. In many cases, nix was one of the only consumers of the current versions (i.e. we are late to upgrade). Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2022-04-24Upgrade dev-dependencies to the latest versionsRyan Zoeller
Don't change how the versions are specified (i.e. whether a patch version is listed). parking_lot cannot be upgraded due to 0.12.0 bumping the MSRV to 1.49. In many cases, nix was one of the only consumers of the current versions (i.e. we are late to upgrade).
2022-04-25Merge #1707bors[bot]
1707: Upgrade sysctl to 0.4 r=asomers a=rtzoeller Upgrade sysctl dev-dependency to 0.4 and handle its breaking API changes. Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2022-04-24Upgrade sysctl to 0.4Ryan Zoeller
Upgrade sysctl dev-dependency to 0.4 and handle its breaking API changes.
2022-04-22(cargo-release) version 0.24.1Ryan Zoeller
2022-04-22Merge #1702bors[bot]
1702: Fix UnixAddr::size on Linux and Android r=rtzoeller a=asomers SockaddrLike::size() is meant to return the amount of space that can be used to store the sockaddr. But on Linux-based OSes, UnixAddr contains an extra field to store the address's length. This field is not part of the address, and should not contribute to the value of size(). This bug can't cause an out-of-bounds write, and every OS that we test on can tolerate the greater-than-expected length, but it might confuse applications that implement functions similar to getsockname in userland. Co-authored-by: Alan Somers <asomers@gmail.com>
2022-04-22Fix UnixAddr::size on Linux and AndroidAlan Somers
SockaddrLike::size() is meant to return the amount of space that can be used to store the sockaddr. But on Linux-based OSes, UnixAddr contains an extra field to store the address's length. This field is not part of the address, and should not contribute to the value of size(). This bug can't cause an out-of-bounds write, and every OS that we test on can tolerate the greater-than-expected length, but it might confuse applications that implement functions similar to getsockname in userland.
2022-04-21Merge #1701bors[bot]
1701: Document pushing the release tag to GitHub r=asomers a=rtzoeller Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2022-04-21Document pushing the release tag to GitHubRyan Zoeller
2022-04-20(cargo-release) version 0.24.0Ryan Zoeller
2022-04-18Revert "Pin nightly compiler used in CI for uclibc"Alan Somers
This reverts commit 23f18dfc18929965c95e0bcbdb8731645f07e401. libc v0.2.124 fixes the problem.
2022-04-15Merge #1698bors[bot]
1698: Update FreeBSD CI image to 12.3. 12.2 is EoL. r=rtzoeller a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
2022-04-15Merge #1694bors[bot]
1694: Use singular number for all feature names r=rtzoeller a=asomers features => feature users => user Neither of these features have yet been included in a release, so it's ok to rename them. Co-authored-by: Alan Somers <asomers@gmail.com>
2022-04-14Update FreeBSD CI image to 12.3. 12.2 is EoL.Alan Somers
2022-04-10Pin nightly compiler used in CI for uclibcAlan Somers
Workaround for https://github.com/rust-lang/rust/issues/95866
2022-04-09Use singular number for all feature namesAlan Somers
features => feature users => user Neither of these features have yet been included in a release, so it's ok to rename them.
2022-04-08Merge #1643bors[bot]
1643: Replace the IoVec struct with IoSlice and IoSliceMut from the standard library r=asomers a=notgull As per discussion in #1637, the `IoVec<&[u8]>` and `IoVec<&mut [u8]>` types have been replaced with `std::io::IoSlice` and `IoSliceMut`, respectively. Notable changes made in this pull request include: - The complete replacement of `IoVec` with `IoSlice*` types in both public API, private API, and tests. - Replacing `IoVec` with `IoSlice` in docs. - Replacing `&[IoVec<&mut [u8]>]` with `&mut [IoSliceMut]`, note that the slice requires a mutable reference now. This is how it's done in the standard library, and there might be a soundness issue in doing it the other way. Resolves #1637 Co-authored-by: not_a_seagull <notaseagull048@gmail.com>
2022-04-08Replace the IoVec type with IoSlice and IoSliceMutnot_a_seagull
2022-04-08Merge #1692bors[bot]
1692: Add IP_DONTFRAG and IPV6_DONTFRAG SockOpts r=rtzoeller a=junhochoi IP_DONTFRAG: iOS, macOS IPV6_DONTFRAG: android, iOS, linux and macOS Test: `cargo test --test test dontfrag_opts` Some CI tests running ENOPROTOOPT are disabled. Co-authored-by: Junho Choi <junho.choi@gmail.com>
2022-04-07Add IP_DONTFRAG and IPV6_DONTFRAG SockOptsJunho Choi
IP_DONTFRAG: iOS, macOS IPV6_DONTFRAG: android, iOS, linux and macOS Test: `cargo test --test test dontfrag_opts` Some CI tests running ENOPROTOOPT are disabled (qemu-based).
2022-04-07Merge #1690bors[bot]
1690: Enable statfs magic constants for target_os = "android" r=rtzoeller a=flxo The statfs magic constants of file systems types are available on target_os android and the cfg guard is updated accordingly. Sync the list of constant with the constants declared in libc. Fixes #1689 Co-authored-by: Felix Obenhuber <felix@obenhuber.de>
2022-03-28Enable statfs magic constants for target_os = "android"Felix Obenhuber
The statfs magic constants of file systems types are available on target_os android and the cfg guard is updated accordingly. Sync the list of constant with the constants declared in libc. Fixes #1689
2022-03-26Merge #1691bors[bot]
1691: [skip ci] edit CHANGELOG formatting prior to 0.24.0 release r=rtzoeller a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
2022-03-25Use the nightly toolchain for RedoxAlan Somers
The latest redox-syscall crate requires at least Rust 1.59.0, but they don't define an MSRV policy. And the version given in the rust-toolchain file in the Redox repository doesn't work. So until they clarify their MSRV, use nightly. https://gitlab.redox-os.org/redox-os/syscall/-/commit/30f29c32952343412bb6c36c9fda136d26e9431f
2022-03-25[skip ci] edit CHANGELOG formatting prior to 0.24.0 releaseAlan Somers
2022-03-24Merge #1672bors[bot]
1672: Make `uname` always safe r=asomers a=koute Currently `uname` doesn't check for errors and just blindly assumes that it always succeeds. According to the manpage this function can fail, even though no actual errors are defined: ``` RETURN VALUE Upon successful completion, a non-negative value shall be returned. Otherwise, -1 shall be returned and errno set to indicate the error. ERRORS No errors are defined. The following sections are informative. ``` Looking at [the glibc's sources](https://github.com/bminor/glibc/blob/b92a49359f33a461db080a33940d73f47c756126/posix/uname.c#L29) we can see that it indeed could fail if the internal `gethostname` call fails for some reason. This code also assumes that every field of `utsname` is going to be initialized by the call to `uname`, which apparently is also not true. Even though the interface doesn't expose this field so it's not a problem in practice (although it might be UB since we do call `assume_init` on the whole struct) [the `utsname` does have a `domainname` field](https://docs.rs/libc/0.2.119/libc/struct.utsname.html) which glibc doesn't initialize. The code also assumes that every field is a valid UTF-8 string, which is also technically not guaranteed. The code also assumes that every field will be null terminated, which might not be true if any of the strings are too long (since glibc uses `strncpy` which will *not* null-terminate the string if it ends up running out of space). This PR should fix all of these problems. This is a breaking change. Co-authored-by: Jan Bujak <jan@parity.io>
2022-03-24Merge #1686bors[bot]
1686: [skip ci] better docs for SockaddrLike::from_raw r=asomers a=asomers Fixes #1680 Co-authored-by: Alan Somers <asomers@gmail.com>
2022-03-23Make `uname` always safeJan Bujak
This fixes several issues with the current `uname` bindings: - Do not ignore `uname` errors; at least on glibc `uname` can fail, so now it returns a `Result` instead of assuming that the call will always succeed. - Do not assume `uname` will initialize every member of `utsname`; not every implementation initializes every field, so internally the struct is now zero-initialized. - Do not blindly assume strings returned by `uname` will always be valid UTF-8; `UtsName`'s accessors will now return `&OsStr`s instead of `&str`s.
2022-03-22[skip ci] better docs for SockaddrLike::from_rawAlan Somers
Fixes #1680
2022-03-23Merge #1685bors[bot]
1685: Deprecate IpAddr, Ipv4Addr, and Ipv6Addr r=rtzoeller a=asomers Because they're redundant with types in the standard library. Fixes #1681 Co-authored-by: Alan Somers <asomers@gmail.com>
2022-03-22Deprecate IpAddr, Ipv4Addr, and Ipv6AddrAlan Somers
Because they're redundant with types in the standard library. Fixes #1681
2022-03-22Merge #1684bors[bot]
1684: Replace the Sockaddr enum with a union r=rtzoeller a=asomers The SockAddr enum is quite large, and the user must allocate space for the whole thing even though he usually knows what type he needs. Furthermore, thanks to the sa_family field, the sockaddr types are basically an enum even in C. So replace the ungainly enum with a SockaddrLike trait implemented by all sockaddr types and a SockaddrStorage union that has safe accessors. Also, deprecate InetAddr, which only existed to support SockAddr. Supplants #1504 Fixes #1544 Co-authored-by: Alan Somers <asomers@gmail.com>
2022-03-21Replace the Sockaddr enum with a unionAlan Somers
The SockAddr enum is quite large, and the user must allocate space for the whole thing even though he usually knows what type he needs. Furthermore, thanks to the sa_family field, the sockaddr types are basically an enum even in C. So replace the ungainly enum with a SockaddrLike trait implemented by all sockaddr types and a SockaddrStorage union that has safe accessors. Also, deprecate InetAddr, which only existed to support SockAddr. Supplants #1504 Fixes #1544
2022-03-20Merge #1682bors[bot]
1682: [skip ci] spellcheck a comment for sethostname r=rtzoeller a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
2022-03-20Merge #1683bors[bot]
1683: Fix build for Redox and uclibc r=asomers a=rtzoeller - Redox renamed `sigaction.sa_handler` to `.sa_sigaction`, which lets us drop some specialized code for the platform. - uclibc now uses a `u32` for the `RLIMIT` definitions, like Linux GNU. Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2022-03-20uclibc uses a u32 for RLIMIT definitionsRyan Zoeller
2022-03-20Redox renamed sigaction.sa_handler to .sa_sigactionRyan Zoeller
2022-03-19[skip ci] spellcheck a comment for sethostnameAlan Somers
2022-03-14Merge #1677bors[bot]
1677: Use the same signature for LinkAddr::addr on all platforms r=rtzoeller a=asomers This should've been done as part of #1675 Co-authored-by: Alan Somers <asomers@gmail.com>