view Cargo.toml @ 25:8e20daee41ed

Set CLOEXEC flag on the descriptors The received systemd descriptors don't have `O_CLOEXEC` set because they are received over `exec`. Thus if the process executes a child the child gets polluted with the descriptors. To prevent this, we set `O_CLOEXEC` during initialization. However this also required restructuring of the code because `libsystemd` doesn't provide temporary access to the descriptors - only permanent one. Thus we have to "validate" the descriptors eagerly. We still store the invalid ones as errors to make sure the errors get reported accurately.
author Martin Habovstiak <martin.habovstiak@gmail.com>
date Fri, 28 Feb 2025 21:11:19 +0100
parents 1941e9d9819c
children 0feab4f4c2ce
line wrap: on
line source

[package]
name = "systemd_socket"
version = "0.1.2"
authors = ["Martin Habovstiak <martin.habovstiak@gmail.com>"]
description = "A convenience crate for optionally supporting systemd socket activation."
homepage = "https://github.com/Kixunil/systemd_socket"
repository = "https://github.com/Kixunil/systemd_socket"
readme = "README.md"
keywords = ["systmed", "socket-activation"]
categories = ["api-bindings", "config", "os::linux-apis"]
edition = "2018"
license = "MITNFA"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[features]
default = ["enable_systemd"]
serde = ["serde_crate", "serde_str_helpers"]
enable_systemd = ["libsystemd"]

[target.'cfg(target_os = "linux")'.dependencies]
# WARNING: It is NOT guaranteed that this crate will always use libsystemd as dependency!
#          This as a feature is not considered a public interface!
libsystemd = { version = ">= 0.3.0, < 0.8.0", optional = true }

[dependencies]
thiserror = "1.0.21"
serde_crate = { package = "serde", version = "1.0.116", optional = true, features = ["derive"] }
serde_str_helpers = { version = "0.1.2", optional = true }
parse_arg = { version = "0.1.4", optional = true }
once_cell = "1.13.0"
tokio = { package = "tokio", version = "1.0.0", optional = true, features = ["net"] }
tokio_0_2 = { package = "tokio", version = "0.2", optional = true, features = ["tcp", "dns"] }
tokio_0_3 = { package = "tokio", version = "0.3", optional = true, features = ["net"] }
async-std = { version = "1.7.0", optional = true }
libc = "0.2.155"