diff --git a/local/patches/base/P4-initfs-network-services.patch b/local/patches/base/P4-initfs-network-services.patch new file mode 100644 index 00000000..ccdd8c1b --- /dev/null +++ b/local/patches/base/P4-initfs-network-services.patch @@ -0,0 +1,24 @@ +--- a/init.initfs.d/60_smolnetd.service 1970-01-01 00:00:00.000000000 +0000 ++++ b/init.initfs.d/60_smolnetd.service 2026-05-03 09:49:05.837127632 +0100 +@@ -0,0 +1,7 @@ ++[unit] ++description = "Network Stack" ++requires_weak = ["40_drivers.target"] ++ ++[service] ++cmd = "smolnetd" ++type = "notify" +--- a/init.initfs.d/61_dhcpd.service 1970-01-01 00:00:00.000000000 +0000 ++++ b/init.initfs.d/61_dhcpd.service 2026-05-03 09:49:05.837757425 +0100 +@@ -0,0 +1,7 @@ ++[unit] ++description = "DHCP Client" ++requires_weak = ["60_smolnetd.service"] ++ ++[service] ++cmd = "dhcpd" ++type = "oneshot_async" +--- a/init.initfs.d/.gitkeep 2026-05-03 09:49:05.835495601 +0100 ++++ b/init.initfs.d/.gitkeep 1970-01-01 00:00:00.000000000 +0000 +@@ -1 +0,0 @@ +- diff --git a/local/patches/base/P4-login-rate-limit.patch b/local/patches/base/P4-login-rate-limit.patch new file mode 100644 index 00000000..0b4b5747 --- /dev/null +++ b/local/patches/base/P4-login-rate-limit.patch @@ -0,0 +1,43 @@ +--- a/src/bin/login.rs 2026-05-03 09:46:36.866954421 +0100 ++++ /mnt/data/homes/kellito/Builds/rbos/b/src/bin/login.rs 2026-05-03 09:46:36.867061170 +0100 +@@ -120,6 +120,7 @@ + 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,6 +134,10 @@ + } + + 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 "), +@@ -150,11 +155,13 @@ + 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 @@ + 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); diff --git a/recipes/core/base-initfs/recipe.toml b/recipes/core/base-initfs/recipe.toml index 1062539c..c8256681 100644 --- a/recipes/core/base-initfs/recipe.toml +++ b/recipes/core/base-initfs/recipe.toml @@ -35,7 +35,7 @@ virt_bins() x86_common_bins() { - BINS+=(ahcid ided ps2d usbhidd usbscsid usbhubd xhcid vesad) + BINS+=(ahcid ided ps2d usbhidd usbscsid usbhubd xhcid vesad e1000d rtl8168d) virt_bins } diff --git a/recipes/core/base/P4-initfs-network-services.patch b/recipes/core/base/P4-initfs-network-services.patch new file mode 120000 index 00000000..273f7e05 --- /dev/null +++ b/recipes/core/base/P4-initfs-network-services.patch @@ -0,0 +1 @@ +../../../local/patches/base/P4-initfs-network-services.patch \ No newline at end of file diff --git a/recipes/core/base/recipe.toml b/recipes/core/base/recipe.toml index 9eb54eb0..2fd2b569 100644 --- a/recipes/core/base/recipe.toml +++ b/recipes/core/base/recipe.toml @@ -14,6 +14,7 @@ patches = [ "P4-logd-persistent-logging.patch", "P4-acpi-shutdown-hardening.patch", "P4-initfs-usb-drm-services.patch", + "P4-initfs-network-services.patch", ] [build] diff --git a/recipes/core/userutils/P4-login-rate-limit.patch b/recipes/core/userutils/P4-login-rate-limit.patch new file mode 120000 index 00000000..40dc0ca5 --- /dev/null +++ b/recipes/core/userutils/P4-login-rate-limit.patch @@ -0,0 +1 @@ +../../../local/patches/base/P4-login-rate-limit.patch \ No newline at end of file diff --git a/recipes/core/userutils/recipe.toml b/recipes/core/userutils/recipe.toml index 3bc189b7..e72806df 100644 --- a/recipes/core/userutils/recipe.toml +++ b/recipes/core/userutils/recipe.toml @@ -1,8 +1,6 @@ [source] git = "https://gitlab.redox-os.org/redox-os/userutils.git" -patches = [ - "../../../local/patches/userutils/redox.patch", -] +patches = ["P4-login-rate-limit.patch"] [build] template = "custom" @@ -10,5 +8,6 @@ script = """ DYNAMIC_INIT cookbook_cargo cp -rv "${COOKBOOK_SOURCE}/res" "${COOKBOOK_STAGE}/etc" +rm -f "${COOKBOOK_STAGE}/etc/motd" ln -s id "${COOKBOOK_STAGE}/usr/bin/whoami" """