Skip to content

Commit 331b686

Browse files
committed
Revert "Reintroduce unstable warning on non-Linux OSes"
This reverts commit 99139f6.
1 parent 5342144 commit 331b686

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,6 @@ cargo build --release
109109
This produces a binary `target/release/sudo`. However, this binary must have
110110
the setuid flag set and must be owned by the root user in order to provide any
111111
useful functionality. Consult your operating system manual for details.
112-
On operating systems other than Linux we also require an environment variable
113-
`SUDO_RS_IS_UNSTABLE` to be set, and it must have the value
114-
`I accept that my system may break unexpectedly`. This because we are in an
115-
early stage of supporting non-Linux OSes. If you are unsure about how to set
116-
this up, then the current version of sudo is not intended for you.
117112

118113
Sudo-rs then also needs the configuration files; please follow the installation
119114
suggestions in the previous section.

src/sudo/mod.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,17 @@ mod env;
2323
mod pam;
2424
mod pipeline;
2525

26-
/// show warning message when SUDO_RS_IS_UNSTABLE is not set to the appropriate value
26+
#[cfg_attr(not(feature = "dev"), allow(dead_code))]
2727
fn unstable_warning() {
28-
if cfg!(all(target_os = "linux", not(feature = "dev"))) {
29-
return;
30-
}
31-
3228
let check_var = std::env::var("SUDO_RS_IS_UNSTABLE").unwrap_or_else(|_| "".to_string());
3329

3430
if check_var != "I accept that my system may break unexpectedly" {
3531
eprintln_ignore_io_error!(
3632
"WARNING!
37-
Sudo-rs is in the early stages of supporting OSes other than Linux and could potentially
33+
Sudo-rs is compiled with development logs on, which means it is less secure and could potentially
3834
break your system. We recommend that you do not run this on any production environment.
39-
To turn off this warning and start using sudo-rs set the environment variable
40-
SUDO_RS_IS_UNSTABLE to the value `I accept that my system may break unexpectedly`. If
41-
you are unsure how to do this then this software is not suited for you at this time."
35+
To turn off this warning and use sudo-rs you need to set the environment variable
36+
SUDO_RS_IS_UNSTABLE to the value `I accept that my system may break unexpectedly`."
4237
);
4338

4439
std::process::exit(1);
@@ -107,6 +102,7 @@ fn sudo_process() -> Result<(), Error> {
107102
eprintln_ignore_io_error!("{}", help::USAGE_MSG);
108103
std::process::exit(1);
109104
} else {
105+
#[cfg(feature = "dev")]
110106
unstable_warning();
111107

112108
pipeline::run(options)

0 commit comments

Comments
 (0)