Commit Graph

2761 Commits

Author SHA1 Message Date
bors[bot]
8e167c765d
Merge #1815
1815: Handle unacceptable name gracefully in {User,Group}::from_name r=asomers a=magicant

Calling `unwrap` on the result of `CString::new` may cause the current thread to panic, which is a bit surprising undocumented behavior. It would be more reasonable to treat the erroneous name as a non-existing user or group.

Co-authored-by: WATANABE Yuki <magicant@wonderwand.net>
2022-09-12 03:17:15 +00:00
Steve Lau
e0918dc4d1 fix issue1814 2022-09-12 07:07:36 +08:00
bors[bot]
adca7fdc3a
Merge #1816
1816: Clippy cleanup r=rtzoeller a=asomers



Co-authored-by: Alan Somers <asomers@gmail.com>
2022-09-11 22:41:25 +00:00
Alan Somers
3aedbfa08e Clippy cleanup 2022-09-11 16:25:33 -06:00
WATANABE Yuki
4d38456cab Handle unacceptable name gracefully in {User,Group}::from_name
Calling `unwrap` on the result of `CString::new` may cause the current
thread to panic, which is a bit surprising undocumented behavior. It
would be more reasonable to treat the erroneous name as a non-existing
user or group.
2022-09-11 23:07:34 +09:00
i509VCB
cf15c2bb55
expose memfd on freebsd 2022-09-07 22:00:38 -05:00
bors[bot]
1eb589f26f
Merge #1810
1810: Eliminate Cargo.lock.msrv r=rtzoeller a=asomers

We no longer need it since updating our MSRV to 1.56.1.

Issue #1809

Co-authored-by: Alan Somers <asomers@gmail.com>
2022-08-26 01:29:25 +00:00
Alan Somers
29f4d52df6 Eliminate Cargo.lock.msrv
We no longer need it since updating our MSRV to 1.56.1.

Issue #1809
2022-08-25 19:25:00 -06:00
bors[bot]
aa3ee6bc0e
Merge #1804
1804: Add sched_getaffinity and sched_setaffinity on FreeBSD r=asomers a=rtzoeller



Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2022-08-26 00:35:22 +00:00
Ryan Zoeller
3dc163e780 Add sched_getaffinity and sched_setaffinity on FreeBSD 2022-08-25 18:42:20 -05:00
bors[bot]
97d6b43bcb
Merge #1805
1805: Add `line` field to `Termios` struct r=rtzoeller a=tertsdiepraam

Fixes https://github.com/nix-rust/nix/issues/1802

I have to admit I'm not really sure how to test this properly, so if that's necessary I require some help :)

Co-authored-by: Terts Diepraam <terts.diepraam@gmail.com>
2022-08-22 20:46:21 +00:00
Terts Diepraam
810f74abbe add line field to Termios struct 2022-08-22 06:32:11 +02:00
bors[bot]
9cbb7eb604
Merge #1806
1806: Remove MSRV-related workaround for doc aliases r=asomers a=rtzoeller

Remove the MSRV-related workaround added by #1693, since we now can use doc aliases in all supported versions of Rust.

Closes #1674.

Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2022-08-21 04:55:27 +00:00
Ryan Zoeller
e479e8fd48 Remove MSRV-related workaround for doc aliases 2022-08-20 19:57:10 -05:00
bors[bot]
82fe82ad53
Merge #1801
1801: fix microsecond calculation for TimeSpec r=rtzoeller a=StephanvanSchaik

The implementation of `num_microseconds()` for `TimeSpec` returns the number of seconds not microseconds, as it divided by the wrong factor. The number of nanoseconds should be divided by 1000 to get the number of microseconds.

Co-authored-by: S.J.R. van Schaik <stephan@synkhronix.com>
2022-08-21 00:52:41 +00:00
S.J.R. van Schaik
7109eb9d2e fix microsecond calculation for TimeSpec 2022-08-20 20:15:51 -04:00
bors[bot]
2a8b438860
Merge #1792
1792: Raise the MSRV to 1.56.1 r=rtzoeller a=asomers

Nix's code hasn't changed.  However, Serde accidentally raised its MSRV
to 1.51.0 in a patch release, due to a Cargo bug.  They don't plan to
change it back.  Nix does not depend on Serde, but it's used by
cargo-hack, which we build as part of our CI process.  So we need to
either raise our MSRV, or else install a separate toolchain during CI
just to build cargo-hack.

https://github.com/serde-rs/serde/issues/2255

Co-authored-by: Alan Somers <asomers@gmail.com>
2022-08-16 00:55:36 +00:00
Alan Somers
c6371db662 Fix a new clippy lint 2022-08-14 10:12:57 -06:00
Alan Somers
2cba3afa78 Raise the MSRV to 1.56.1 in anticipation of the next release
And fix some documentation lints warned about by the newer rustdoc.
2022-08-14 09:53:42 -06:00
bors[bot]
dde5f86f41
Merge #1796
1796: No dev version r=rtzoeller a=asomers



Co-authored-by: Alan Somers <asomers@gmail.com>
2022-08-13 22:17:33 +00:00
Alan Somers
ea4f1ba5c2 [skip ci] Rollback master branch to 0.25.0
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 10:12:44 -06:00
Alan Somers
596db4ed00 [skip ci] add a CHANGELOG section for the next release 2022-08-13 10:06:30 -06:00
Alan Somers
564d72edc7 (cargo-release) start next development iteration 0.25.1-alpha.0 2022-08-13 10:03:03 -06:00
Alan Somers
4d4754a14b (cargo-release) version 0.25.0 2022-08-13 10:02:42 -06:00
bors[bot]
9a0083de0c
Merge #1795
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 15:09:10 +00:00
Alan Somers
92c76bdab0 [skip ci] reformat CHANGELOG prior to 0.25.0 release 2022-08-13 08:46:51 -06:00
bors[bot]
e4eeb9a107
Merge #1794
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-12 23:26:39 +00:00
Alan Somers
42ca951f60 Reenable cargo-hack in CI
But instead of building it from source, download pre-built binaries.
2022-08-12 16:52:03 -06:00
bors[bot]
5252f7e1bd
Merge #1782
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-12 05:00:15 +00:00
SteveLauC
29fe67d4cc feat nix-rust#1733: add F_GET_SEALS and F_ADD_SEALS on FreeBSD 2022-08-12 12:53:03 +08:00
bors[bot]
ffc793ed4d
Merge #1776
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-12 04:38:44 +00:00
bors[bot]
a9861d873e
Merge #1785
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-12 01:22:12 +00:00
SteveLauC
217c3b5141 fix CI error 2022-08-12 09:13:57 +08:00
SteveLau
9161a294d7
Merge branch 'nix-rust:master' into remove-deprecated-items 2022-08-12 08:57:10 +08:00
bors[bot]
09b4b49046
Merge #1790
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-12 00:53:59 +00:00
bors[bot]
d96436e04e
Merge #1786
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-12 00:44:37 +00:00
Jack O'Connor
901857f852 minor terminology fix in User docs
Passwords are hashed, not encrypted.
2022-08-11 17:43:48 -07:00
Michael Baikov
384d47d25e Folloup for !1778, remove some of the less helpful error msgs 2022-08-12 08:29:29 +08:00
bors[bot]
d9a7904252
Merge #1793
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-12 00:15:02 +00:00
Alan Somers
8a63e3e5d9 Also raise the MSRV just for cross-tests. Cross uses Serde too. 2022-08-11 17:57:10 -06:00
Alan Somers
8c65c3702d Disable cargo-hack in CI
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-11 17:47:10 -06:00
SteveLauC
4d5e5d83f8 remove deprecated items 2022-08-09 12:22:41 +08:00
SteveLauC
347915bdb5 format code 2022-08-09 12:17:27 +08:00
SteveLauC
d458ecd4e1 remove deprecated items 2022-08-09 12:15:52 +08:00
bors[bot]
a10078f35c
Merge #1780
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-06 02:11:37 +00:00
Zhang Miaolei
f8c79c63e5 add faccessat 2022-08-05 20:15:51 -04:00
Matthew Ingwersen
6bf07fdbb9 Add support for the IP_SENDSRCADDR control message
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-05 12:35:57 -04:00
bors[bot]
67329c593f
Merge #1779
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-04 12:49:17 +00:00
Ryan Zoeller
cac1486f17 Upgrade libc to 0.2.127
This is the last version of libc which will support Rust 1.46, per
https://github.com/rust-lang/libc/pull/2845
2022-08-03 22:58:22 -05:00
bors[bot]
566c612422
Merge #1778
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-04 03:31:23 +00:00