diff --git a/Cargo.lock b/Cargo.lock index 6136bbaa0..ea29af70a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -389,6 +389,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "cgroups-rs" version = "0.3.4" @@ -1264,7 +1270,7 @@ name = "inspect" version = "0.0.1" dependencies = [ "caps", - "nix 0.27.1", + "nix 0.28.0", ] [[package]] @@ -1337,9 +1343,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" @@ -1501,12 +1507,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ "bitflags 2.4.2", "cfg-if", + "cfg_aliases", "libc", "memoffset", ] @@ -1531,7 +1538,7 @@ dependencies = [ "clap 4.2.7", "console 0.15.7", "log", - "nix 0.27.1", + "nix 0.28.0", "northstar-runtime", "serde", "time", @@ -1605,7 +1612,7 @@ dependencies = [ "memfd", "memoffset", "nanoid", - "nix 0.27.1", + "nix 0.28.0", "pkg-version", "proptest", "rand_core", @@ -1676,7 +1683,7 @@ dependencies = [ "log", "memfd", "nanoid", - "nix 0.27.1", + "nix 0.28.0", "northstar-client", "northstar-runtime", "northstar-tests-derive", @@ -2517,7 +2524,7 @@ dependencies = [ "anyhow", "caps", "clap 4.2.7", - "nix 0.27.1", + "nix 0.28.0", "socket2", ] diff --git a/examples/inspect/Cargo.toml b/examples/inspect/Cargo.toml index fe1d2f960..8c3083c47 100644 --- a/examples/inspect/Cargo.toml +++ b/examples/inspect/Cargo.toml @@ -7,7 +7,7 @@ license = "Apache-2.0" [dependencies] caps = "0.5.5" -nix = { version = "0.27.1", default-features = false, features = [ "process", "user", "signal" ] } +nix = { version = "0.28.0", default-features = false, features = [ "process", "user", "signal" ] } [package.metadata.npk] manifest = "manifest.yaml" diff --git a/examples/test-container/Cargo.toml b/examples/test-container/Cargo.toml index 9d44559be..58160260f 100644 --- a/examples/test-container/Cargo.toml +++ b/examples/test-container/Cargo.toml @@ -9,7 +9,7 @@ license = "Apache-2.0" anyhow = { version = "1.0.80", features = ["backtrace"] } caps = "0.5.5" clap = { version = "4.2.7", features = ["derive"] } -nix = { version = "0.27.1", default-features = false, features = ["process", "user"] } +nix = { version = "0.28.0", default-features = false, features = ["process", "user"] } socket2 = { version = "0.5.5", features = ["all"] } [package.metadata.npk] diff --git a/northstar-runtime/Cargo.toml b/northstar-runtime/Cargo.toml index 26dede74d..ca1b23a92 100644 --- a/northstar-runtime/Cargo.toml +++ b/northstar-runtime/Cargo.toml @@ -37,7 +37,7 @@ memchr = "2.6.2" memfd = { version = "0.6.2", optional = true } memoffset = { version = "0.9.0", optional = true } nanoid = { version = "0.4.0", optional = true } -nix = { version = "0.27.1", default-features = false, features = ["fs", "sched", "ioctl", "mount", "term", "uio", "socket", "net", "signal", "user"], optional = true } +nix = { version = "0.28.0", default-features = false, features = ["fs", "sched", "ioctl", "mount", "term", "uio", "socket", "net", "signal", "user"], optional = true } pkg-version = { version = "1.0.0", optional = true } rand_core = { version = "0.6.4", features = ["getrandom"], optional = true } rlimit = { version = "0.10.1", optional = true } diff --git a/northstar-runtime/src/runtime/ipc/raw_fd_ext.rs b/northstar-runtime/src/runtime/ipc/raw_fd_ext.rs index 7e7167fd3..e3b5ab2e4 100644 --- a/northstar-runtime/src/runtime/ipc/raw_fd_ext.rs +++ b/northstar-runtime/src/runtime/ipc/raw_fd_ext.rs @@ -32,21 +32,19 @@ impl RawFdExt for T { #[allow(clippy::unwrap_used)] fn non_blocking() { let (a, b) = nix::unistd::pipe().unwrap(); - nix::unistd::close(b).unwrap(); + drop(b); - let opt = unsafe { nix::libc::fcntl(a, nix::libc::F_GETFL) }; + let opt = unsafe { nix::libc::fcntl(a.as_raw_fd(), nix::libc::F_GETFL) }; assert!((dbg!(opt) & nix::libc::O_NONBLOCK) == 0); assert!(!a.is_nonblocking().unwrap()); a.set_nonblocking(true).unwrap(); - let opt = unsafe { nix::libc::fcntl(a, nix::libc::F_GETFL) }; + let opt = unsafe { nix::libc::fcntl(a.as_raw_fd(), nix::libc::F_GETFL) }; assert!((dbg!(opt) & nix::libc::O_NONBLOCK) != 0); assert!(a.is_nonblocking().unwrap()); a.set_nonblocking(false).unwrap(); - let opt = unsafe { nix::libc::fcntl(a, nix::libc::F_GETFL) }; + let opt = unsafe { nix::libc::fcntl(a.as_raw_fd(), nix::libc::F_GETFL) }; assert!((dbg!(opt) & nix::libc::O_NONBLOCK) == 0); assert!(!a.is_nonblocking().unwrap()); - - nix::unistd::close(a).unwrap(); } diff --git a/northstar-runtime/src/runtime/sockets.rs b/northstar-runtime/src/runtime/sockets.rs index 5a11da222..d5829e196 100644 --- a/northstar-runtime/src/runtime/sockets.rs +++ b/northstar-runtime/src/runtime/sockets.rs @@ -4,7 +4,7 @@ use log::debug; use nix::{ sys::{ socket, - socket::{sockopt, AddressFamily, SockFlag, SockType, UnixAddr}, + socket::{sockopt, AddressFamily, Backlog, SockFlag, SockType, UnixAddr}, }, unistd::{fchown, Gid, Uid}, }; @@ -90,7 +90,7 @@ pub(crate) async fn open( // Streaming and seqpacket sockets need to be listened on. if matches!(ty, Type::Stream | Type::SeqPacket) { - socket::listen(&socket, 100).context("failed to listen")?; + socket::listen(&socket, Backlog::MAXCONN).context("failed to listen")?; } debug!( diff --git a/northstar-tests/Cargo.toml b/northstar-tests/Cargo.toml index bbefba682..2934d1f27 100644 --- a/northstar-tests/Cargo.toml +++ b/northstar-tests/Cargo.toml @@ -16,7 +16,7 @@ lazy_static = "1.4.0" log = "0.4.21" memfd = "0.6.2" nanoid = "0.4.0" -nix = { version = "0.27.1", features = ["sched"], default-features = false } +nix = { version = "0.28.0", features = ["sched"], default-features = false } northstar-client = { path = "../northstar-client" } northstar-runtime = { path = "../northstar-runtime", features = ["api", "runtime"] } northstar-tests-derive = { path = "northstar-tests-derive" } diff --git a/northstar/Cargo.toml b/northstar/Cargo.toml index 43c21ea8f..58fca9851 100644 --- a/northstar/Cargo.toml +++ b/northstar/Cargo.toml @@ -13,7 +13,7 @@ rust-version.workspace = true anyhow = { version = "1.0.80", features = ["backtrace"] } clap = { version = "4.2.7", features = ["derive"] } log = { version = "0.4.21", features = ["std"] } -nix = { version = "0.27.1", default-features = false, features = ["sched", "mount"] } +nix = { version = "0.28.0", default-features = false, features = ["sched", "mount"] } northstar-runtime = { version = "^0.9.2-pre", path = "../northstar-runtime", features = ["runtime", "rexec"] } tokio = { version = "1.32.0", features = ["rt-multi-thread", "macros", "signal"] } toml = "0.8.8"