summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-08-14Raise the MSRV to 1.56.1 in anticipation of the next releaseAlan Somers
And fix some documentation lints warned about by the newer rustdoc.
2022-08-13Merge #1796bors[bot]
1796: No dev version r=rtzoeller a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
2022-08-13[skip ci] Rollback master branch to 0.25.0Alan Somers
cargo-release automatically incremented the master branch's version post-release. I don't like that, because it makes it harder for consumers, especially indirect consumers, to use a `[patch.crates-io]` section in their Cargo.toml files. Also, configure cargo-release not to do this again in the future.
2022-08-13[skip ci] add a CHANGELOG section for the next releaseAlan Somers
2022-08-13(cargo-release) start next development iteration 0.25.1-alpha.0Alan Somers
2022-08-13(cargo-release) version 0.25.0Alan Somers
2022-08-13Merge #1795bors[bot]
1795: [skip ci] reformat CHANGELOG prior to 0.25.0 release r=rtzoeller a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
2022-08-13[skip ci] reformat CHANGELOG prior to 0.25.0 releaseAlan Somers
2022-08-12Merge #1794bors[bot]
1794: Reenable cargo-hack in CI r=rtzoeller a=asomers But instead of building it from source, download pre-built binaries. Co-authored-by: Alan Somers <asomers@gmail.com>
2022-08-12Reenable cargo-hack in CIAlan Somers
But instead of building it from source, download pre-built binaries.
2022-08-12Merge #1782bors[bot]
1782: feat #1733: add F_GET_SEALS and F_ADD_SEALS on FreeBSD r=rtzoeller a=SteveLauC Closes #1733 Co-authored-by: SteveLauC <stevelauc@outlook.com>
2022-08-12feat nix-rust#1733: add F_GET_SEALS and F_ADD_SEALS on FreeBSDSteveLauC
2022-08-12Merge #1776bors[bot]
1776: Add support for the IP_SENDSRCADDR control message r=rtzoeller a=matttpt This control message is available on FreeBSD, NetBSD, and OpenBSD. When used with `sendmsg`, it sets the IPv4 source address. This adds support through a new `ControlMessage::Ipv4SendSrcAddr` variant that complements `ControlMessageOwned::Ipv4RecvDstAddr`. A few notes: * `IP_SENDSRCADDR` is actually just an alias for `IP_RECVDSTADDR` (though the code doesn't depend on this). * On NetBSD, `IP_PKTINFO` can be used to accomplish the same thing and is already supported by nix. On FreeBSD and OpenBSD, though, `IP_SENDSRCADDR` is the only method I'm aware of. * The accompanying test binds a UDP socket to all local interfaces (0.0.0.0). If this is not acceptable, please let me know; however, FreeBSD requires this to use `IP_SENDSRCADDR`. I'll add a change-log entry once I see the PR number. Thanks! Co-authored-by: Matthew Ingwersen <matttpt@gmail.com>
2022-08-12Merge #1785bors[bot]
1785: Remove deprecated items r=asomers a=SteveLauC #### What this pr does 1. Convert `assert!(x == y)` to `assert_eq!(x, y)` 2. Convert `assert!(x != y)` to `assert_ne!(x, y)` 3. Add `.unwrap()` to unused `Result/Option` (in code comments) 4. Convert `std::ixx::MAX` to `ixx::MAX` 5. Convert `Box<Trait>` to `Box<dyn Trait>` Co-authored-by: SteveLauC <stevelauc@outlook.com> Co-authored-by: SteveLau <stevelauc@outlook.com>
2022-08-12fix CI errorSteveLauC
2022-08-12Merge branch 'nix-rust:master' into remove-deprecated-itemsSteveLau
2022-08-12Merge #1790bors[bot]
1790: minor terminology fix in User docs r=asomers a=oconnor663 Passwords are hashed, not encrypted. Co-authored-by: Jack O'Connor <oconnor663@gmail.com>
2022-08-12Merge #1786bors[bot]
1786: Folloup for !1778, remove some of the less helpful error msgs r=asomers a=pacak Co-authored-by: Michael Baikov <manpacket@gmail.com>
2022-08-11minor terminology fix in User docsJack O'Connor
Passwords are hashed, not encrypted.
2022-08-12Folloup for !1778, remove some of the less helpful error msgsMichael Baikov
2022-08-12Merge #1793bors[bot]
1793: Disable cargo-hack in CI r=rtzoeller a=asomers Serde accidentally raised its MSRV to 1.51.0 in a patch release. They don't intent to fix it. Nix uses Serde via cargo-hack in CI. Disable it so we can publish a final release at 1.46.0. Co-authored-by: Alan Somers <asomers@gmail.com>
2022-08-11Also raise the MSRV just for cross-tests. Cross uses Serde too.Alan Somers
2022-08-11Disable cargo-hack in CIAlan Somers
Serde accidentally raised its MSRV to 1.51.0 in a patch release. They don't intent to fix it. Nix uses Serde via cargo-hack in CI. Disable it so we can publish a final release at 1.46.0.
2022-08-09remove deprecated itemsSteveLauC
2022-08-09format codeSteveLauC
2022-08-09remove deprecated itemsSteveLauC
2022-08-06Merge #1780bors[bot]
1780: Implement faccessat r=asomers a=nateavers This is a re-post of #1134, which seems to have been abandoned. Includes the changes requested in [this comment](https://github.com/nix-rust/nix/pull/1134#issuecomment-541346612). Co-authored-by: Zhang Miaolei <zmlcc@outlook.com>
2022-08-05add faccessatZhang Miaolei
2022-08-05Add support for the IP_SENDSRCADDR control messageMatthew Ingwersen
This control message (actually just an alias for IP_RECVDSTADDR) sets the IPv4 source address when used with sendmsg. It is available on FreeBSD, NetBSD, OpenBSD, and DragonFlyBSD.
2022-08-04Merge #1779bors[bot]
1779: Upgrade libc to 0.2.127 r=asomers a=rtzoeller This is the last version of libc which will support Rust 1.46, per https://github.com/rust-lang/libc/pull/2845. I think we should ship nix 0.25.0 against this version of libc (at some point, not necessarily now), as it will allow us to maintain an MSRV of 1.46, and subsequently upgrade to a later libc immediately after releasing 0.25.0. Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2022-08-03Upgrade libc to 0.2.127Ryan Zoeller
This is the last version of libc which will support Rust 1.46, per https://github.com/rust-lang/libc/pull/2845
2022-08-04Merge #1778bors[bot]
1778: fix clippy assertions_on_result_states r=rtzoeller a=pacak https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states Fixes broken CI for https://github.com/nix-rust/nix/pull/1744 Co-authored-by: Michael Baikov <manpacket@gmail.com>
2022-08-04fix clippy assertions_on_result_statesMichael Baikov
https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states
2022-07-26Merge #1772bors[bot]
1772: Add support for RecvOrigDstAddr on Linux r=asomers a=brianmay Fixes #1767 Co-authored-by: Brian May <brian@linuxpenguins.xyz>
2022-07-26Merge #1774bors[bot]
1774: Fix typo guarding memfd export on android. r=asomers a=detly Extremely minor but crucial typo on import guard from #1773. `@flxo` Co-authored-by: Jason Heeris <jason.heeris@gmail.com>
2022-07-26Fix typo guarding memfd export on android.Jason Heeris
2022-07-26Add support for RecvOrigDstAddr on LinuxBrian May
Fixes #1767
2022-07-25Merge #1773bors[bot]
1773: Add memfd for target_os = "android" r=asomers a=flxo Memory fds (`memfd`) are implemented and exported by Androids bionic. Export the `memfd` module if the target os is `android`. https://cs.android.com/android/platform/superproject/+/master:bionic/libc/include/sys/mman.h;drc=23c7543b8e608ebcbb38b952761b54bb56065577;bpv=1;bpt=1;l=182 Co-authored-by: Felix Obenhuber <felix@obenhuber.de>
2022-07-25Add memfd for target_os = "android"Felix Obenhuber
Memory fds (`memfd`) are implemented and exported by Androids bionic. Export the `memfd` module if the target os is `android`. https://cs.android.com/android/platform/superproject/+/master:bionic/libc/include/sys/mman.h;drc=23c7543b8e608ebcbb38b952761b54bb56065577;bpv=1;bpt=1;l=182
2022-07-24Merge #1768bors[bot]
1768: Add ETH_P_ALL protocol number to SockProtocol r=asomers a=valdaarhun Hi. I am working on a networking project that uses [packet sockets](https://man7.org/linux/man-pages/man7/packet.7.html) and noticed that ETH_P_ALL is not there in the `SockProtocol` enum. I thought it would be nice to have it here alongside IPPROTO_TCP and IPPROTO_UDP instead of having to separately import it from the libc crate. Co-authored-by: valdaarhun <icegambit91@gmail.com>
2022-07-24Add ETH_P_ALL protocol number to SockProtocolvaldaarhun
Add note to Changelog.md Make changes in comments Co-authored-by: Alan Somers <asomers@gmail.com> Add Android as target os for ETH_P_ALL
2022-07-23Merge #1770bors[bot]
1770: Fix SockaddrLike::from_raw with unaligned inputs r=rtzoeller a=asomers The major users of this function are functions like gethostname, which will always properly align their buffers. But out-of-crate consumers could manually construct an unaligned buffer. Handle that correctly. Enable Clippy's cast_ptr_alignment lint. It's disabled by default as it reports many false positives, but it would've caught this problem. Reported-by: Miri Fixes: 1769 Co-authored-by: Alan Somers <asomers@gmail.com>
2022-07-23Merge pull request #1771 from asomers/0.24.2-changelogAlan Somers
[skip ci] Add 0.24.2 release notes to CHANGELOG
2022-07-23Pin cargo-hack to 0.5.14 in CIAlan Somers
Newer versions of cargo-hack require a newer toolchain to install
2022-07-23Fix SockaddrLike::from_raw with unaligned inputsAlan Somers
The major users of this function are functions like gethostname, which will always properly align their buffers. But out-of-crate consumers could manually construct an unaligned buffer. Handle that correctly. Enable Clippy's cast_ptr_alignment lint. It's disabled by default as it reports many false positives, but it would've caught this problem. Reported-by: Miri Fixes: 1769
2022-07-23[skip ci] Add 0.24.2 release notes to CHANGELOGAlan Somers
2022-07-15Merge #1764bors[bot]
1764: Fix description of fchownat r=asomers a=valdaarhun Based on the man page for `fchownat` and `lchown`, I have got the impression that with `FchownatFlags::NoFollowSymlink`, fchownat and lchown are identical. I couldn't find any documentation on `lchmod`. Co-authored-by: valdaarhun <icegambit91@gmail.com>
2022-07-16Fix description of fchownatvaldaarhun
2022-07-15Merge #1741bors[bot]
1741: SigSet: A new unsafe helper method to create a SigSet from a sigset_t r=rtzoeller a=germag Currently, the only way to create a `SigSet` from a `sigset_t` object is by using pointer casts, like: ``` unsafe { let sigset = *(&sigset as *const libc::sigset_t as *const SigSet) }; ``` This is un-ergonomic for library creators with interfaces to C. So, let's add a new unsafe method that creates a `SigSet` from a `libc::sigset_t` object. We can't implement `From` since converting from `libc::sigset_t` to `SigSet` is unsafe, because objects of type `libc::sigset_t` must be initialized by calling either `sigemptyset(3)` or `sigfillset(3)` before being used. In other case, the results are undefined. We can't implement `TryFrom` either, because there is no way to check if an object of type `libc::sigset_t` is initialized. Signed-off-by: German Maglione <gmaglione@redhat.com> Co-authored-by: German Maglione <gmaglione@redhat.com>
2022-07-14Merge #1763bors[bot]
1763: Fix a buffer overflow in sys::socket::recvfrom r=posborne a=asomers IPv4 and stream sockets are unaffected, but for datagram sockets of other address types libc::recvfrom might overwrite part of the stack. Fixes #1762 Co-authored-by: Alan Somers <asomers@gmail.com>