Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
2c9d729
WIP: huge optimization
LeChatP Apr 15, 2025
5ed37f9
fix: enhance CmdMin comparison logic and refactor option handling in …
LeChatP Apr 15, 2025
e38ebe1
feat: add EnumString derive for StorageMethod to support case-insensi…
LeChatP Apr 15, 2025
a4ac4b9
fix: add 'into' attribute to StorageMethod default in Settings struct
LeChatP Apr 15, 2025
06fd95d
fix: improve role display logic and enhance serialization for command…
LeChatP Apr 16, 2025
1b6321c
feat: Rewrite it thread safe
LeChatP Apr 21, 2025
ef5f3da
fix: add serde_json_borrow dependency to improve JSON handling
LeChatP Apr 21, 2025
320ac61
refactor: clean up imports and adjust feature flags in score and util…
LeChatP Apr 21, 2025
7b99737
WIP: considering borrowing opt
LeChatP Apr 26, 2025
3c0e3fe
Using Borrowed data instead of cloning.
LeChatP Apr 26, 2025
4462015
feat: optimize User deserialization
LeChatP Apr 26, 2025
ef54018
WIP : test serializing in cbor optimization
LeChatP Apr 27, 2025
92396c7
WIP testing optimizing
LeChatP Apr 27, 2025
e69766c
WIP: enhance CredFinderDeserializer to support binary field variants
LeChatP Apr 27, 2025
60707aa
TODO: There are many optimisations that could be made and reaching ba…
LeChatP Apr 27, 2025
8a5f78e
refactor: more optimisations
LeChatP Apr 29, 2025
b223e6c
refactor: remove coz
LeChatP Apr 29, 2025
accb8f4
refactor: improve logic in CmdMin::better for performance
LeChatP Apr 29, 2025
4c964f6
refactor: more performant path matching logic in match_single_path fu…
LeChatP Apr 29, 2025
bec5b0f
refactor: update env_path type from PathBuf to &str across multiple m…
LeChatP Apr 30, 2025
004ea58
refactor: update deserialization logic and improve match_args functio…
LeChatP May 1, 2025
7d1439e
Implement custom serialization for various structs in the database mo…
LeChatP May 1, 2025
537e1f7
Implement conversion functionality and refactor process_input
LeChatP May 4, 2025
34788aa
tests: Refactor path options handling in finder module
LeChatP May 4, 2025
d6d968a
fmt: cargo fmt
LeChatP May 4, 2025
7cd6605
tests: add several tests
LeChatP May 5, 2025
998dc0a
tests: more tests and fixes
LeChatP May 9, 2025
899f21f
tests: more tests
LeChatP May 11, 2025
0688f70
tests: more tests!
LeChatP May 12, 2025
a46b5fe
fmt: cargo fmt
LeChatP May 12, 2025
709a1eb
tests: update test for read-only file handling and remove root privil…
LeChatP May 12, 2025
d8f1309
tests: fix tests as root
LeChatP May 12, 2025
b47b67a
fix: fix some bugs
LeChatP May 12, 2025
86ee156
fix: bugs
LeChatP May 12, 2025
1f48c14
fmt: cargo fmt
LeChatP May 12, 2025
f7fbd08
fix: tests
LeChatP May 12, 2025
ed23780
fix: setgid can be a simple string
LeChatP May 12, 2025
4e05f83
Format Rust code using rustfmt
github-actions[bot] May 12, 2025
77854c0
refactor: replace println! with debug! for logging instead of printing
LeChatP May 12, 2025
175c333
fix: just remove logs in tests
LeChatP May 12, 2025
f5e5f25
refactor: replace println! with debug! for logging in lib.rs and ser.rs
LeChatP May 12, 2025
b2b6721
tests: more tests
LeChatP May 17, 2025
abbf4e6
Format Rust code using rustfmt
github-actions[bot] May 17, 2025
5bb3491
refactor(tests): remove commented-out test for from_json_execution_se…
LeChatP May 17, 2025
8e9f016
fix(tests): add --privileged option to tarpaulin container
LeChatP May 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined
options: --security-opt seccomp=unconfined --privileged
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
57 changes: 6 additions & 51 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,14 @@
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Test",
"type": "cppdbg",
"request": "launch",
"preLaunchTask": "make build_unit_test",
"program": "${workspaceFolder}/bin/unit_test",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
},
{ "description": "The new process is debugged after a fork. The parent process runs unimpeded.",
"text": "-gdb-set follow-fork-mode child",
"ignoreFailures": true
}
]
},
{
"name": "(gdb) Launch",
"type": "cppdbg",
"type": "lldb",
"request": "launch",
"preLaunchTask": "setcap",
"program": "/usr/bin/sr",
"name": "Launch",
"program": "${workspaceFolder}/target/debug/sr",
"args": ["ls"],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "${workspaceFolder}/.vscode/gdb_root.sh",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"cwd": "${workspaceFolder}"
}


]
}
100 changes: 2 additions & 98 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,14 @@
}
},
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: gcc build active file",
"command": "/usr/bin/gcc",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
},
{
"type": "shell",
"label": "make",
"command": "sudo",
"args": [
"-E",
"/usr/bin/make",
"install"
],
"options": {
"cwd": "${cwd}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
},

{
"type": "shell",
"label": "setcap",
"dependsOn": "make",
"command": "sudo",
"args": [
"/usr/bin/setcap",
"=eip",
"=p",
"${cwd}/bin/sr"
],
"options": {
Expand All @@ -66,58 +22,6 @@
"group": {
"kind": "none"
}
},
{
"type": "shell",
"label": "make build_unit_test",
"command": "sudo",
"args": [
"/usr/bin/make",
"build_unit_test"
],
"options": {
"cwd": "${workspaceFolder}",
"env": {
"GDB_DEBUG": "1",
"DEBUG": "1"
}
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
},
{
"type": "shell",
"label": "debug unit_test",
"dependsOn": "make build_unit_test",
"command": "${cwd}/bin/unit_test",
"args": [
"--debug=gdb"
],
"options": {
"cwd": "${cwd}"
},
"isBackground": true,
"problemMatcher": {
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": ".",
"endsPattern": "Listening on port"
}
}
}

],
Expand Down
17 changes: 14 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["xtask", "rar-common"]
[package]
name = "rootasrole"
# The project version is managed on json file in resources/rootasrole.json
version = "3.0.6"
version = "3.1.0"
rust-version = "1.76.0"
authors = ["Eddie Billoir <[email protected]>"]
edition = "2021"
Expand All @@ -25,9 +25,17 @@ maintainance ={ status = "actively-maintained", badge = "https://img.shields.io/
[profile.release]
strip = "symbols"
lto = true
opt-level = "s"
opt-level = 3
codegen-units = 1

[profile.profiling]
strip = "none"
lto = false
opt-level = 1
inherits = "release"
debug = true


#[features]
#cursive_lib = [ "cursive" ]
#srlibs = [ "pam-client", "bitflags" ]
Expand All @@ -45,6 +53,7 @@ path = "src/chsr/main.rs"
[features]
default = ["finder"]
finder = ["dep:pcre2", "rar-common/pcre2", "rar-common/finder"]
pcre2 = ["dep:pcre2", "rar-common/pcre2"]

[lints.rust]
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(tarpaulin_include)'] }
Expand All @@ -65,7 +74,7 @@ capctl = "0.2"
pcre2 = { version = "0.2", optional = true }
serde = { version = "1.0", features=["rc", "derive"] }
serde_json = "1.0"
ciborium = "0.2"
cbor4ii = { version = "1.0.0", features = ["serde", "serde1", "use_std"] }
glob = "0.3"
pam-client2 = "0.5"
bitflags = { version = "2.6" }
Expand All @@ -80,6 +89,8 @@ pest = "2.7"
pest_derive = "2.7"
const_format = "0.2"
hex = "0.4"
bon = "3.5.1"
serde_json_borrow = "0.7.1"

[dev-dependencies]
log = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<!-- The project version is managed on json file in resources/rootasrole.json -->
<!-- markdownlint-restore -->

# RootAsRole (V3.0.6) : A memory-safe and security-oriented alternative to sudo/su commands
# RootAsRole (V3.1.0) : A memory-safe and security-oriented alternative to sudo/su commands

**RootAsRole** is a project to allow Linux/Unix administrators to delegate their administrative tasks access rights to users. Its main features are :

Expand Down
4 changes: 1 addition & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn set_readme_version(package_version: &str, file: &str) -> Result<(), Box<dyn E
Ok(())
}

fn main() {
fn main() {
println!("cargo:rerun-if-changed=Cargo.toml");
println!("cargo:rerun-if-changed=build.rs");

Expand All @@ -77,6 +77,4 @@ fn main() {
if let Err(err) = set_readme_version(&package_version, "README.md") {
eprintln!("cargo:warning={}", err);
}


}
4 changes: 2 additions & 2 deletions rar-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rootasrole-core"
version = "3.0.6"
version = "3.1.0"
edition = "2021"
description = "This core crate contains the RBAC and main features for the RootAsRole project."
license = "LGPL-3.0-or-later"
Expand All @@ -27,7 +27,7 @@ log = "0.4"
syslog = "7.0"
env_logger = "0.11"
bon = { version = "3.3.2", features = ["experimental-overwritable"] }
ciborium = "0.2.2"
cbor4ii = { version = "1.0.0", features = ["serde", "serde1", "use_std"] }

[dev-dependencies]
log = "0.4"
Expand Down
Loading
Loading