diff --git a/Cargo.toml b/Cargo.toml index 53b1996..8a271e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,40 +1,44 @@ -[package] -name = "extrasafe" +[workspace] +members = [ + "extrasafe" +] +resolver = "2" + +[workspace.package] version = "0.5.1" +authors = [ + "Harry Stern ", +] edition = "2021" -authors = ["Harry Stern ",] -description = "Make your code extrasafe by reducing what it can access." +rust-version = "1.74.0" repository = "https://github.com/boustrophedon/extrasafe" license = "MIT" -keywords = ["security", "seccomp", "landlock", "syscall"] -categories = ["os::linux-apis"] - -[package.metadata.docs.rs] -all-features = true - -[features] -landlock = ["dep:landlock"] -isolate = [] - -[dependencies] -seccompiler = { version = "^0.4", default-features = false } -libc = "^0.2" -syscalls = { version = "^0.6", default-features = false } -landlock = { version ="^0.3", optional = true } +categories = [ "os::linux-apis" ] -[dev-dependencies] +[workspace.dependencies] bytes = "^1" crossbeam = "^0.8" crossbeam-queue = "^0.3" crossbeam-channel = "^0.5" +landlock = "^0.3" +libc = "^0.2" +rusqlite = "^0.26" tempfile = "^3" tokio = "^1.15" -hyper = { version = "^0.14", features = ["http1", "server", "runtime", "tcp"] } warp = "^0.3" -rusqlite = "^0.26" -[target.'cfg(target_env = "musl")'.dev-dependencies] -reqwest = { version = "^0.11", default-features = false, features = ["rustls-tls"] } +[workspace.dependencies.hyper] +version = "^0.14" +features = [ "http1", "server", "runtime", "tcp" ] + +[workspace.dependencies.reqwest] +version = "^0.11" +default-features = false + +[workspace.dependencies.seccompiler] +version = "^0.4" +default-features = false -[target.'cfg(not(target_env = "musl"))'.dev-dependencies] -reqwest = { version = "^0.11" } +[workspace.dependencies.syscalls] +version = "^0.6" +default-features = false diff --git a/extrasafe/Cargo.toml b/extrasafe/Cargo.toml new file mode 100644 index 0000000..7aeff7f --- /dev/null +++ b/extrasafe/Cargo.toml @@ -0,0 +1,48 @@ +[package] +name = "extrasafe" +version.workspace = true +authors.workspace = true +edition.workspace = true +rust-version.workspace = true +description = "Make your code extrasafe by reducing what it can access." +documentation = "https://docs.rs/extrasafe/latest/extrasafe" +readme = "README.md" +#homepage = "" +repository.workspace = true +license.workspace = true +keywords = [ "security", "seccomp", "landlock", "syscall" ] +categories.workspace = true + +[package.metadata.docs.rs] +all-features = true + +[features] +landlock = [ "dep:landlock" ] +isolate = [ ] + +[dependencies] +libc.workspace = true +seccompiler.workspace = true +syscalls.workspace = true + +# Optional Dependencies: +landlock = { workspace = true, optional = true } + +[dev-dependencies] +bytes.workspace = true +crossbeam.workspace = true +crossbeam-queue.workspace = true +crossbeam-channel.workspace = true +hyper.workspace = true +rusqlite.workspace = true +tempfile.workspace = true +tokio.workspace = true +warp.workspace = true + +[target.'cfg(target_env = "musl")'.dev-dependencies.reqwest] +workspace = true +features = [ "rustls-tls" ] + +[target.'cfg(not(target_env = "musl"))'.dev-dependencies.reqwest] +workspace = true +features = [ "default" ] diff --git a/extrasafe/README.md b/extrasafe/README.md new file mode 100644 index 0000000..d1ed2f2 --- /dev/null +++ b/extrasafe/README.md @@ -0,0 +1 @@ +# extrasafe diff --git a/examples/ipc_server_with_database.rs b/extrasafe/examples/ipc_server_with_database.rs similarity index 100% rename from examples/ipc_server_with_database.rs rename to extrasafe/examples/ipc_server_with_database.rs diff --git a/examples/isolate_test.rs b/extrasafe/examples/isolate_test.rs similarity index 100% rename from examples/isolate_test.rs rename to extrasafe/examples/isolate_test.rs diff --git a/examples/network_server.rs b/extrasafe/examples/network_server.rs similarity index 100% rename from examples/network_server.rs rename to extrasafe/examples/network_server.rs diff --git a/examples/no_files_allow_stdout.rs b/extrasafe/examples/no_files_allow_stdout.rs similarity index 100% rename from examples/no_files_allow_stdout.rs rename to extrasafe/examples/no_files_allow_stdout.rs diff --git a/examples/server_with_database.rs b/extrasafe/examples/server_with_database.rs similarity index 100% rename from examples/server_with_database.rs rename to extrasafe/examples/server_with_database.rs diff --git a/examples/simple_network.rs b/extrasafe/examples/simple_network.rs similarity index 100% rename from examples/simple_network.rs rename to extrasafe/examples/simple_network.rs diff --git a/examples/time.rs b/extrasafe/examples/time.rs similarity index 100% rename from examples/time.rs rename to extrasafe/examples/time.rs diff --git a/examples/user-guide.rs b/extrasafe/examples/user-guide.rs similarity index 100% rename from examples/user-guide.rs rename to extrasafe/examples/user-guide.rs diff --git a/examples/user_guide_isolate.rs b/extrasafe/examples/user_guide_isolate.rs similarity index 100% rename from examples/user_guide_isolate.rs rename to extrasafe/examples/user_guide_isolate.rs diff --git a/src/builtins/basic.rs b/extrasafe/src/builtins/basic.rs similarity index 100% rename from src/builtins/basic.rs rename to extrasafe/src/builtins/basic.rs diff --git a/src/builtins/danger_zone.rs b/extrasafe/src/builtins/danger_zone.rs similarity index 100% rename from src/builtins/danger_zone.rs rename to extrasafe/src/builtins/danger_zone.rs diff --git a/src/builtins/mod.rs b/extrasafe/src/builtins/mod.rs similarity index 100% rename from src/builtins/mod.rs rename to extrasafe/src/builtins/mod.rs diff --git a/src/builtins/network.rs b/extrasafe/src/builtins/network.rs similarity index 100% rename from src/builtins/network.rs rename to extrasafe/src/builtins/network.rs diff --git a/src/builtins/pipes.rs b/extrasafe/src/builtins/pipes.rs similarity index 100% rename from src/builtins/pipes.rs rename to extrasafe/src/builtins/pipes.rs diff --git a/src/builtins/systemio.rs b/extrasafe/src/builtins/systemio.rs similarity index 100% rename from src/builtins/systemio.rs rename to extrasafe/src/builtins/systemio.rs diff --git a/src/builtins/time.rs b/extrasafe/src/builtins/time.rs similarity index 100% rename from src/builtins/time.rs rename to extrasafe/src/builtins/time.rs diff --git a/src/error.rs b/extrasafe/src/error.rs similarity index 100% rename from src/error.rs rename to extrasafe/src/error.rs diff --git a/src/isolate/isolate_sys.rs b/extrasafe/src/isolate/isolate_sys.rs similarity index 100% rename from src/isolate/isolate_sys.rs rename to extrasafe/src/isolate/isolate_sys.rs diff --git a/src/isolate/mod.rs b/extrasafe/src/isolate/mod.rs similarity index 100% rename from src/isolate/mod.rs rename to extrasafe/src/isolate/mod.rs diff --git a/src/landlock.rs b/extrasafe/src/landlock.rs similarity index 100% rename from src/landlock.rs rename to extrasafe/src/landlock.rs diff --git a/src/lib.rs b/extrasafe/src/lib.rs similarity index 100% rename from src/lib.rs rename to extrasafe/src/lib.rs diff --git a/src/macros.rs b/extrasafe/src/macros.rs similarity index 100% rename from src/macros.rs rename to extrasafe/src/macros.rs diff --git a/tests/arg_comparisons.rs b/extrasafe/tests/arg_comparisons.rs similarity index 100% rename from tests/arg_comparisons.rs rename to extrasafe/tests/arg_comparisons.rs diff --git a/tests/bad_combination.rs b/extrasafe/tests/bad_combination.rs similarity index 100% rename from tests/bad_combination.rs rename to extrasafe/tests/bad_combination.rs diff --git a/tests/default_deny.rs b/extrasafe/tests/default_deny.rs similarity index 100% rename from tests/default_deny.rs rename to extrasafe/tests/default_deny.rs diff --git a/tests/inherit_filters.rs b/extrasafe/tests/inherit_filters.rs similarity index 100% rename from tests/inherit_filters.rs rename to extrasafe/tests/inherit_filters.rs diff --git a/tests/landlock_allthreads_fail.rs b/extrasafe/tests/landlock_allthreads_fail.rs similarity index 100% rename from tests/landlock_allthreads_fail.rs rename to extrasafe/tests/landlock_allthreads_fail.rs diff --git a/tests/landlock_basic.rs b/extrasafe/tests/landlock_basic.rs similarity index 100% rename from tests/landlock_basic.rs rename to extrasafe/tests/landlock_basic.rs diff --git a/tests/landlock_conflicts.rs b/extrasafe/tests/landlock_conflicts.rs similarity index 100% rename from tests/landlock_conflicts.rs rename to extrasafe/tests/landlock_conflicts.rs diff --git a/tests/multiple_conditions.rs b/extrasafe/tests/multiple_conditions.rs similarity index 100% rename from tests/multiple_conditions.rs rename to extrasafe/tests/multiple_conditions.rs diff --git a/tests/multiple_filters.rs b/extrasafe/tests/multiple_filters.rs similarity index 100% rename from tests/multiple_filters.rs rename to extrasafe/tests/multiple_filters.rs diff --git a/tests/network.rs b/extrasafe/tests/network.rs similarity index 100% rename from tests/network.rs rename to extrasafe/tests/network.rs diff --git a/tests/open_readonly.rs b/extrasafe/tests/open_readonly.rs similarity index 100% rename from tests/open_readonly.rs rename to extrasafe/tests/open_readonly.rs diff --git a/tests/ruleset_union.rs b/extrasafe/tests/ruleset_union.rs similarity index 100% rename from tests/ruleset_union.rs rename to extrasafe/tests/ruleset_union.rs diff --git a/tests/sleep.rs b/extrasafe/tests/sleep.rs similarity index 100% rename from tests/sleep.rs rename to extrasafe/tests/sleep.rs diff --git a/tests/sysno.rs b/extrasafe/tests/sysno.rs similarity index 100% rename from tests/sysno.rs rename to extrasafe/tests/sysno.rs diff --git a/tests/test_ref_ruleset.rs b/extrasafe/tests/test_ref_ruleset.rs similarity index 100% rename from tests/test_ref_ruleset.rs rename to extrasafe/tests/test_ref_ruleset.rs diff --git a/tests/tests_can_fail.rs b/extrasafe/tests/tests_can_fail.rs similarity index 100% rename from tests/tests_can_fail.rs rename to extrasafe/tests/tests_can_fail.rs diff --git a/tests/thread_multi.rs b/extrasafe/tests/thread_multi.rs similarity index 100% rename from tests/thread_multi.rs rename to extrasafe/tests/thread_multi.rs diff --git a/tests/thread_single.rs b/extrasafe/tests/thread_single.rs similarity index 100% rename from tests/thread_single.rs rename to extrasafe/tests/thread_single.rs diff --git a/tests/unsupported_os.rs b/extrasafe/tests/unsupported_os.rs similarity index 100% rename from tests/unsupported_os.rs rename to extrasafe/tests/unsupported_os.rs diff --git a/tests/use_fd.rs b/extrasafe/tests/use_fd.rs similarity index 100% rename from tests/use_fd.rs rename to extrasafe/tests/use_fd.rs