Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close-on-exec by default for received fds #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(sendfd_docs, feature(doc_cfg))]

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / cross-ios-build (stable, aarch64-apple-ios)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, ubuntu-latest)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / cross-ios-build (stable, x86_64-apple-ios)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, ubuntu-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / cross-ios-build (nightly, x86_64-apple-ios)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, ubuntu-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, ubuntu-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, ubuntu-latest)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / bare-cross-build (x86_64-unknown-openbsd)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / cross-ios-build (nightly, aarch64-apple-ios)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 1 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, ubuntu-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

extern crate libc;
#[cfg(feature = "tokio")]
Expand Down Expand Up @@ -123,7 +123,7 @@
};
let (mut msghdr, cmsg_layout, _) = construct_msghdr_for(&mut iov, fds.len());
let cmsg_buffer = msghdr.msg_control;
let count = libc::recvmsg(socket, &mut msghdr as *mut _, 0);
let count = libc::recvmsg(socket, &mut msghdr as *mut _, libc::MSG_CMSG_CLOEXEC);

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / cross-ios-build (stable, aarch64-apple-ios)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / cross-ios-build (stable, x86_64-apple-ios)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features --release)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / cross-ios-build (nightly, x86_64-apple-ios)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features --release)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / cross-ios-build (nightly, aarch64-apple-ios)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`
if count < 0 {
let error = io::Error::last_os_error();
alloc::dealloc(cmsg_buffer as *mut _, cmsg_layout);
Expand Down Expand Up @@ -184,7 +184,7 @@
}

#[cfg(feature = "tokio")]
#[cfg_attr(sendfd_docs, doc(cfg(feature = "tokio")))]

Check warning on line 187 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 187 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, ubuntu-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 187 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 187 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 187 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, ubuntu-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 187 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 187 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, ubuntu-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 187 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, ubuntu-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`
impl SendWithFd for tokio::net::UnixStream {
/// Send the bytes and the file descriptors as a stream.
///
Expand All @@ -196,7 +196,7 @@
}

#[cfg(feature = "tokio")]
#[cfg_attr(sendfd_docs, doc(cfg(feature = "tokio")))]

Check warning on line 199 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 199 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, ubuntu-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 199 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 199 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 199 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, ubuntu-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 199 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 199 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, ubuntu-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 199 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, ubuntu-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`
impl SendWithFd for tokio::net::unix::WriteHalf<'_> {
/// Send the bytes and the file descriptors as a stream.
///
Expand All @@ -220,7 +220,7 @@
}

#[cfg(feature = "tokio")]
#[cfg_attr(sendfd_docs, doc(cfg(feature = "tokio")))]

Check warning on line 223 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 223 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, ubuntu-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 223 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 223 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 223 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, ubuntu-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 223 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 223 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, ubuntu-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 223 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, ubuntu-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`
impl SendWithFd for tokio::net::UnixDatagram {
/// Send the bytes and the file descriptors as a single packet.
///
Expand All @@ -244,7 +244,7 @@
}

#[cfg(feature = "tokio")]
#[cfg_attr(sendfd_docs, doc(cfg(feature = "tokio")))]

Check warning on line 247 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 247 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, ubuntu-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 247 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 247 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 247 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, ubuntu-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 247 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 247 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, ubuntu-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 247 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, ubuntu-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`
impl RecvWithFd for tokio::net::UnixStream {
/// Receive the bytes and the file descriptors from the stream.
///
Expand All @@ -257,7 +257,7 @@
}

#[cfg(feature = "tokio")]
#[cfg_attr(sendfd_docs, doc(cfg(feature = "tokio")))]

Check warning on line 260 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 260 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, ubuntu-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 260 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 260 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 260 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, ubuntu-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 260 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 260 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, ubuntu-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 260 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, ubuntu-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`
impl RecvWithFd for tokio::net::unix::ReadHalf<'_> {
/// Receive the bytes and the file descriptors from the stream.
///
Expand Down Expand Up @@ -287,7 +287,7 @@
}

#[cfg(feature = "tokio")]
#[cfg_attr(sendfd_docs, doc(cfg(feature = "tokio")))]

Check warning on line 290 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 290 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, ubuntu-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 290 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 290 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 290 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, ubuntu-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 290 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 290 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, ubuntu-latest, --all-features --release)

unexpected `cfg` condition name: `sendfd_docs`

Check warning on line 290 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, ubuntu-latest, --all-features)

unexpected `cfg` condition name: `sendfd_docs`
impl RecvWithFd for tokio::net::UnixDatagram {
/// Receive the bytes and the file descriptors as a single packet.
///
Expand Down
Loading