annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a65053246c29 Initial commit
Martin Habovstiak <martin.habovstiak@gmail.com>
parents:
diff changeset
1 [package]
a65053246c29 Initial commit
Martin Habovstiak <martin.habovstiak@gmail.com>
parents:
diff changeset
2 name = "systemd_socket"
23
729392c49b46 Release version 0.1.2
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 22
diff changeset
3 version = "0.1.2"
0
a65053246c29 Initial commit
Martin Habovstiak <martin.habovstiak@gmail.com>
parents:
diff changeset
4 authors = ["Martin Habovstiak <martin.habovstiak@gmail.com>"]
14
2039b5d39d72 Publish 0.1.0
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 13
diff changeset
5 description = "A convenience crate for optionally supporting systemd socket activation."
2039b5d39d72 Publish 0.1.0
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 13
diff changeset
6 homepage = "https://github.com/Kixunil/systemd_socket"
2039b5d39d72 Publish 0.1.0
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 13
diff changeset
7 repository = "https://github.com/Kixunil/systemd_socket"
2039b5d39d72 Publish 0.1.0
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 13
diff changeset
8 readme = "README.md"
2039b5d39d72 Publish 0.1.0
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 13
diff changeset
9 keywords = ["systmed", "socket-activation"]
2039b5d39d72 Publish 0.1.0
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 13
diff changeset
10 categories = ["api-bindings", "config", "os::linux-apis"]
0
a65053246c29 Initial commit
Martin Habovstiak <martin.habovstiak@gmail.com>
parents:
diff changeset
11 edition = "2018"
14
2039b5d39d72 Publish 0.1.0
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 13
diff changeset
12 license = "MITNFA"
2039b5d39d72 Publish 0.1.0
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 13
diff changeset
13
22
f33e2c048104 Enable `doc_auto_cfg` in docs.rs builds
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 21
diff changeset
14 [package.metadata.docs.rs]
f33e2c048104 Enable `doc_auto_cfg` in docs.rs builds
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 21
diff changeset
15 all-features = true
f33e2c048104 Enable `doc_auto_cfg` in docs.rs builds
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 21
diff changeset
16 rustdoc-args = ["--cfg", "docsrs"]
0
a65053246c29 Initial commit
Martin Habovstiak <martin.habovstiak@gmail.com>
parents:
diff changeset
17
a65053246c29 Initial commit
Martin Habovstiak <martin.habovstiak@gmail.com>
parents:
diff changeset
18 [features]
13
f740dadd2948 Added enable_systemd feature
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 12
diff changeset
19 default = ["enable_systemd"]
0
a65053246c29 Initial commit
Martin Habovstiak <martin.habovstiak@gmail.com>
parents:
diff changeset
20 serde = ["serde_crate", "serde_str_helpers"]
16
bc76507dd878 Fixed conditional compilation based on OS
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 14
diff changeset
21 enable_systemd = ["libsystemd"]
0
a65053246c29 Initial commit
Martin Habovstiak <martin.habovstiak@gmail.com>
parents:
diff changeset
22
16
bc76507dd878 Fixed conditional compilation based on OS
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 14
diff changeset
23 [target.'cfg(target_os = "linux")'.dependencies]
bc76507dd878 Fixed conditional compilation based on OS
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 14
diff changeset
24 # WARNING: It is NOT guaranteed that this crate will always use libsystemd as dependency!
bc76507dd878 Fixed conditional compilation based on OS
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 14
diff changeset
25 # This as a feature is not considered a public interface!
20
2b78a483f84b Update `libsystemd`
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 19
diff changeset
26 libsystemd = { version = ">= 0.3.0, < 0.8.0", optional = true }
6
a7893294e9b2 Make the crate compilable on non-linux systems
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 4
diff changeset
27
0
a65053246c29 Initial commit
Martin Habovstiak <martin.habovstiak@gmail.com>
parents:
diff changeset
28 [dependencies]
12
4479770c2275 Decrease version requirement on thiserror
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 10
diff changeset
29 thiserror = "1.0.21"
10
c9f42be465ca Decrease version requirement for serde
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 9
diff changeset
30 serde_crate = { package = "serde", version = "1.0.116", optional = true, features = ["derive"] }
9
4fb70ca820a6 Upgrade serde_str_helpers
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 6
diff changeset
31 serde_str_helpers = { version = "0.1.2", optional = true }
0
a65053246c29 Initial commit
Martin Habovstiak <martin.habovstiak@gmail.com>
parents:
diff changeset
32 parse_arg = { version = "0.1.4", optional = true }
24
1941e9d9819c Fix unsound manipulation of env vars
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 23
diff changeset
33 once_cell = "1.13.0"
21
f6334887e3c8 Support `tokio` 1.0
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 20
diff changeset
34 tokio = { package = "tokio", version = "1.0.0", optional = true, features = ["net"] }
4
66c0e10c89fc Support resolving hostnames
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 0
diff changeset
35 tokio_0_2 = { package = "tokio", version = "0.2", optional = true, features = ["tcp", "dns"] }
0
a65053246c29 Initial commit
Martin Habovstiak <martin.habovstiak@gmail.com>
parents:
diff changeset
36 tokio_0_3 = { package = "tokio", version = "0.3", optional = true, features = ["net"] }
a65053246c29 Initial commit
Martin Habovstiak <martin.habovstiak@gmail.com>
parents:
diff changeset
37 async-std = { version = "1.7.0", optional = true }
25
8e20daee41ed Set CLOEXEC flag on the descriptors
Martin Habovstiak <martin.habovstiak@gmail.com>
parents: 24
diff changeset
38 libc = "0.2.155"