Skip to content

Commit 7ec7b11

Browse files
committed
finish fixups
1 parent 4703207 commit 7ec7b11

File tree

6 files changed

+18
-94
lines changed

6 files changed

+18
-94
lines changed

Cargo.lock

+4-78
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+10-11
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,27 @@ authors = ["Mikail Bagishov <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8-
libc = "0.2.82"
8+
libc = "0.2.86"
99
errno = "0.2.7"
10-
rand = "0.8.2"
11-
serde = { version = "1.0.121", features = ["derive"] }
12-
serde_json = "1.0.61"
10+
rand = "0.8.3"
11+
serde = { version = "1.0.123", features = ["derive"] }
12+
serde_json = "1.0.62"
1313
backtrace = "0.3.56"
1414
thiserror = "1.0.23"
1515
anyhow = "1.0.38"
1616
once_cell = "1.5.2"
1717
futures-util = "0.3.12"
18-
tokio = { version = "1.1.0", features = ["net"] }
19-
tracing = "0.1.22"
18+
tokio = { version = "1.2.0", features = ["net"] }
19+
tracing = "0.1.23"
2020
itoa = "0.4.7"
2121

2222
[target.'cfg(target_os="linux")'.dependencies]
2323
tiny-nix-ipc = { git = "https://github.com/myfreeweb/tiny-nix-ipc", features = ["ser_json", "zero_copy"] }
24-
procfs = "0.7.8"
2524
nix = {git = "https://github.com/nix-rust/nix"}
26-
libc = "0.2.68"
27-
errno = "0.2.5"
28-
serde_json = "1.0.51"
29-
tokio = { version = "0.3.2", features = ["net"] }
25+
libc = "0.2.86"
26+
errno = "0.2.7"
27+
serde_json = "1.0.62"
28+
tokio = { version = "1.2.0", features = ["net"] }
3029

3130
[target.'cfg(target_os="windows")'.dependencies]
3231
winapi = { version = "0.3.9", features = ["std", "processthreadsapi", "jobapi2", "errhandlingapi",

src/erased.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub trait Sandbox: std::fmt::Debug + Send + Sync + 'static {
1818
}
1919

2020
impl<S: crate::Sandbox> Sandbox for S {
21-
fn id(&self) -> &str {
21+
fn id(&self) -> String {
2222
self.id()
2323
}
2424
fn check_cpu_tle(&self) -> anyhow::Result<bool> {

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl SandboxOptions {
120120
/// Represents highly-isolated sandbox
121121
pub trait Sandbox: Debug + Send + Sync + Debug + 'static {
122122
type Error: StdError + Send + Sync + 'static;
123-
fn id(&self) -> &str;
123+
fn id(&self) -> String;
124124

125125
/// Returns true if sandbox exceeded CPU time limit
126126
fn check_cpu_tle(&self) -> Result<bool, Self::Error>;

src/linux/jail_common.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate::{linux::util::Pid, SharedItem};
2-
use rand::seq::SliceRandom;
32
use serde::{Deserialize, Serialize};
43
use std::{ffi::OsString, os::unix::io::RawFd, path::PathBuf, time::Duration};
54
use tiny_nix_ipc::Socket;

src/linux/sandbox.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ impl Debug for LinuxSandbox {
8888
impl Sandbox for LinuxSandbox {
8989
type Error = Error;
9090

91-
fn id(&self) -> &str {
92-
&self.id
91+
fn id(&self) -> String {
92+
self.id.clone()
9393
}
9494

9595
fn check_cpu_tle(&self) -> Result<bool, Error> {

0 commit comments

Comments
 (0)