Skip to content

Commit

Permalink
Init a selinux project (#2800)
Browse files Browse the repository at this point in the history
* selinux_init

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

* use_unimplemented

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

* add_explanation

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

* update

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

* use_path_instead_of_str

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

* use_thiserror

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

* use_struct

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

---------

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>
  • Loading branch information
Gekko0114 committed Jun 21, 2024
1 parent af804e4 commit 6dd0d7f
Show file tree
Hide file tree
Showing 8 changed files with 665 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
resolver = "2"
members = ["crates/*", "tests/contest/*", "tools/*"]
exclude = ["experiment/seccomp"]
exclude = ["experiment/seccomp", "experiment/selinux"]

[profile.release]
lto = true
102 changes: 102 additions & 0 deletions experiment/selinux/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions experiment/selinux/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "selinux"
version = "0.1.0"
description = "Library for selinux"
license-file = "../../LICENSE"
repository = "https://github.com/containers/youki"
homepage = "https://containers.github.io/youki"
readme = "README.md"
authors = ["youki team"]
edition = "2021"
autoexamples = true
keywords = ["youki", "container", "selinux"]

[dependencies]
nix = { version = "0.29.0", features = ["process", "fs"] }
thiserror = "1.0.61"
7 changes: 7 additions & 0 deletions experiment/selinux/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This is an experimental project in order to create selinux library in Rust.
Ref: https://github.com/containers/youki/issues/2718.
Reimplementation of (selinux)[https://github.com/opencontainers/selinux] in Rust.
Also selinux depends on xattr, but nix doesn't cover xattr function.
Therefore, this PR will implement xattr in Rust.

Please import and use this project.
2 changes: 2 additions & 0 deletions experiment/selinux/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod selinux;
pub mod xattr;
Loading

0 comments on commit 6dd0d7f

Please sign in to comment.