Skip to content

Commit 5b42127

Browse files
bjorn3squell
authored andcommitted
Remove Linux kernel version check
1 parent 11fee1c commit 5b42127

File tree

5 files changed

+4
-57
lines changed

5 files changed

+4
-57
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ Suspected vulnerabilities can be reported on our [security page](https://github.
1313
An [audit of sudo-rs version 0.2.0](docs/audit/audit-report-sudo-rs.pdf) has been performed in August 2023.
1414
The findings from that audit are addressed in the current version.
1515

16-
Sudo-rs currently is targeted for Linux-based operating systems only; Linux kernel 5.11
17-
or newer is necessary to run sudo-rs.
16+
Sudo-rs currently is targeted for FreeBSD and Linux-based operating systems only.
1817

1918
## Installing sudo-rs
2019

src/common/error.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ pub enum Error {
1313
other_user: Option<SudoString>,
1414
},
1515
SelfCheck,
16-
KernelCheck,
1716
CommandNotFound(PathBuf),
1817
InvalidCommand(PathBuf),
1918
ChDirNotAllowed {
@@ -61,7 +60,6 @@ impl fmt::Display for Error {
6160
Error::SelfCheck => {
6261
f.write_str("sudo must be owned by uid 0 and have the setuid bit set")
6362
}
64-
Error::KernelCheck => f.write_str("sudo-rs needs a Linux kernel newer than v5.11"),
6563
Error::CommandNotFound(p) => write!(f, "'{}': command not found", p.display()),
6664
Error::InvalidCommand(p) => write!(f, "'{}': invalid command", p.display()),
6765
Error::UserNotFound(u) => write!(f, "user '{u}' not found"),

src/sudo/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::common::resolve::CurrentUser;
44
use crate::common::Error;
55
use crate::log::dev_info;
66
use crate::system::interface::UserId;
7-
use crate::system::kernel::kernel_check;
87
use crate::system::timestamp::RecordScope;
98
use crate::system::User;
109
use crate::system::{time::Duration, timestamp::SessionRecordFile, Process};
@@ -67,7 +66,6 @@ fn sudo_process() -> Result<(), Error> {
6766
dev_info!("development logs are enabled");
6867

6968
self_check()?;
70-
kernel_check()?;
7169

7270
// parse cli options
7371
match SudoAction::from_env() {

src/system/kernel.rs

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/system/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ mod audit;
2626
// generalized traits for when we want to hide implementations
2727
pub mod interface;
2828

29-
pub mod kernel;
30-
3129
pub mod file;
3230

3331
pub mod time;
@@ -40,6 +38,9 @@ pub mod term;
4038

4139
pub mod wait;
4240

41+
#[cfg(not(any(target_os = "freebsd", target_os = "linux")))]
42+
compile_error!("sudo-rs only works on Linux and FreeBSD");
43+
4344
pub(crate) fn can_execute<P: AsRef<Path>>(path: P) -> bool {
4445
let Ok(path) = CString::new(path.as_ref().as_os_str().as_bytes()) else {
4546
return false;

0 commit comments

Comments
 (0)