11993af01f
Base: fix P6-driver-new-modules.patch (ed format -> unified diff) for new driver modules (ncq, itr, phy). P6-driver-main-fixes.patch now applies with offset on current upstream source. Relibc: remove stale P5-named-semaphores (upstream has stubs), add P10-stack-size-8mb and P11-getrlimit-getrusage (per-process rlimit table, sysconf integration, getdtablesize fix, null-pointer safety). Kernel: consolidate 29 individual patches into single redbear-consolidated.patch. Userutils: P5-redbear-branding replaces P4-login-rate-limit. Recipe.toml changes now committed so they survive source resets.
68 lines
2.5 KiB
Diff
68 lines
2.5 KiB
Diff
diff --git a/res/issue b/res/issue
|
|
index 6a963d8..092a432 100644
|
|
--- a/res/issue
|
|
+++ b/res/issue
|
|
@@ -1,4 +1,4 @@
|
|
-########## Redox OS ##########
|
|
+########## RedBear OS ##########
|
|
# Login with the following: #
|
|
# `user` #
|
|
# `root`:`password` #
|
|
diff --git a/res/motd b/res/motd
|
|
index 5cd097a..df2f802 100644
|
|
--- a/res/motd
|
|
+++ b/res/motd
|
|
@@ -1,2 +1,2 @@
|
|
-Welcome to Redox OS!
|
|
+Welcome to RedBear OS!
|
|
|
|
diff --git a/src/bin/login.rs b/src/bin/login.rs
|
|
index 08e178c..022fb47 100644
|
|
--- a/src/bin/login.rs
|
|
+++ b/src/bin/login.rs
|
|
@@ -120,6 +120,7 @@ fn load_config_schemes(user: &User<redox_users::auth::Full>) -> Option<Vec<Strin
|
|
pub fn main() {
|
|
let mut stdout = io::stdout();
|
|
let mut stderr = io::stderr();
|
|
+ let mut consecutive_failures: u32 = 0;
|
|
|
|
let _args = clap_app!(login =>
|
|
(author: "Jeremy Soller, Jose Narvaez")
|
|
@@ -133,9 +134,13 @@ pub fn main() {
|
|
}
|
|
|
|
loop {
|
|
+ if consecutive_failures >= 3 {
|
|
+ let delay_secs = std::cmp::min(consecutive_failures as u64, 30);
|
|
+ std::thread::sleep(std::time::Duration::from_secs(delay_secs));
|
|
+ }
|
|
let user = liner::Context::new()
|
|
.read_line(
|
|
- liner::Prompt::from("\x1B[1mredox login:\x1B[0m "),
|
|
+ liner::Prompt::from("\x1B[1mRedBear Login:\x1B[0m "),
|
|
None,
|
|
&mut liner::BasicCompleter::new(Vec::<String>::new()),
|
|
)
|
|
@@ -150,11 +155,13 @@ pub fn main() {
|
|
None => {
|
|
stdout.write(b"\nLogin incorrect\n").r#try(&mut stderr);
|
|
stdout.write(b"\n").r#try(&mut stderr);
|
|
+ consecutive_failures += 1;
|
|
stdout.flush().r#try(&mut stderr);
|
|
continue;
|
|
}
|
|
Some(user) => {
|
|
if user.is_passwd_blank() {
|
|
+ consecutive_failures = 0;
|
|
if let Ok(mut motd) = File::open(MOTD_FILE) {
|
|
io::copy(&mut motd, &mut stdout).r#try(&mut stderr);
|
|
stdout.flush().r#try(&mut stderr);
|
|
@@ -185,6 +192,7 @@ pub fn main() {
|
|
stdout.flush().r#try(&mut stderr);
|
|
|
|
if user.verify_passwd(&password) {
|
|
+ consecutive_failures = 0;
|
|
if let Ok(mut motd) = File::open(MOTD_FILE) {
|
|
io::copy(&mut motd, &mut stdout).r#try(&mut stderr);
|
|
stdout.flush().r#try(&mut stderr);
|