From 523a252b50d59a9ab81ae41ed69014ac8bfa8117 Mon Sep 17 00:00:00 2001 From: boburning Date: Mon, 31 Aug 2026 03:10:34 -0400 Subject: [PATCH] security(network): retire stale Samba controls (NET-11) --- build/dependencies.lock | 2 +- build/legacy-manifest.json | 4 +- docs/1.0_TEST_MATRIX.md | 4 +- docs/SECURITY.md | 5 + src/tweaks/appstate.h | 2 - src/tweaks/network.h | 200 +----------------- src/tweaks/tweaks.c | 1 - .../script/network/update_networking.sh | 50 +---- static/configs/.tmp_update/config/smb.conf | 104 --------- test/shell/branding_copy.bats | 3 +- test/shell/ci_validation.bats | 6 + test/shell/samba_source_build.bats | 21 ++ test/test_retroarch_build_identity.py | 2 +- tools/ci-scope.sh | 6 +- website/docs/01-features/index.md | 2 +- .../07-apps/01-included-in-onion/tweaks.mdx | 6 - .../01-samba-file-sharing.md | 96 ++------- 17 files changed, 61 insertions(+), 453 deletions(-) delete mode 100644 static/configs/.tmp_update/config/smb.conf diff --git a/build/dependencies.lock b/build/dependencies.lock index f30737e88..dad34c748 100644 --- a/build/dependencies.lock +++ b/build/dependencies.lock @@ -209,7 +209,7 @@ manifest = "build/legacy-manifest.json" schema = 1 component_count = 331 file_count = 1972 -byte_count = 260959742 +byte_count = 260958446 source_build_components = 232 unresolved_components = 99 inherited_baseline = "07505ea58c7bba698d6b9220ff43946a43cac76b" diff --git a/build/legacy-manifest.json b/build/legacy-manifest.json index 30f2c6aef..ce1ee0032 100644 --- a/build/legacy-manifest.json +++ b/build/legacy-manifest.json @@ -2321,8 +2321,8 @@ "kind": "runtime", "path": "static/build/.tmp_update/script/network", "file_count": 5, - "byte_count": 23560, - "tree_sha256": "c0c20b192a1f736c4e8d6ff20dd0ffbf8133d20e98e12229dd1cacae022fd593", + "byte_count": 22264, + "tree_sha256": "5ba1040d9523790b3d6c57ac31bf9cf3819eef365567f9af2f4057daf96d4562", "source": "https://github.com/OnionUI/Onion", "source_revision": "07505ea58c7bba698d6b9220ff43946a43cac76b", "license": "GPL-3.0-only", diff --git a/docs/1.0_TEST_MATRIX.md b/docs/1.0_TEST_MATRIX.md index d1de1482c..a3d6e95c5 100644 --- a/docs/1.0_TEST_MATRIX.md +++ b/docs/1.0_TEST_MATRIX.md @@ -52,7 +52,7 @@ shoulder button. | Critical lifecycle | Exact 640x480 and 752x560 built-in projections; source/target/path and legacy-file rejection; boot/shutdown/save/low-battery/recovery/Safe Mode ignore theme/config/media; charging reflects bounded actual level; installer uses one deterministic surface; missing optional text/font fallback; signed Full-update boot/charging/shutdown/recovery checkpoint | | Settings | One sectioned surface; inline values; capability filtering; one-layer details; hidden Developer section; optional overlapping L1/R1 list paging | | Quick Settings | START from core surfaces; immediate brightness/volume/mute; capability-gated Wi-Fi opens the dedicated detail surface; Wi-Fi left/right never mutates the radio; readable battery; B/START close | -| Network services | Desired/runtime separation; carrier without IPv4 remains acquiring/not-ready; canonical DHCP restart and bounded post-address listener reconciliation; SSH shell and SFTP independent key-only states; canonical transfer roots and modes; Saves read-only; private roots denied; traversal/symlink/path bounds; same-filesystem atomic publication; authorized-key import; quiesce/health; stale FTP/Telnet/FileBrowser/inherited-Samba/WPS/hotspot flags cannot activate listeners; process-aware listener audit; inherited FTP/Telnet/FileBrowser HTTP launcher and Tweaks exposure plus rejected Samba payloads absent from newly assembled stable artifacts while older-card remnants remain locked down | +| Network services | Desired/runtime separation; carrier without IPv4 remains acquiring/not-ready; canonical DHCP restart and bounded post-address listener reconciliation; SSH shell and SFTP independent key-only states; canonical transfer roots and modes; Saves read-only; private roots denied; traversal/symlink/path bounds; same-filesystem atomic publication; authorized-key import; quiesce/health; stale FTP/Telnet/FileBrowser/inherited-Samba/WPS/hotspot flags cannot activate listeners; process-aware listener audit; inherited FTP/Telnet/FileBrowser HTTP and rejected Samba launchers, configurations, and Tweaks exposure absent from newly assembled stable artifacts while older-card remnants remain locked down | | Wi-Fi profile store | JFFS2 private root; stdin-only bounded replacement and `bloomctl network profile upsert ID`; requested/document ID binding; explicit `network forget ID`; inactive-ID deletion with active-profile refusal; active forget only after a separately confirmed fallback connection; schema/unknown-field/count/size enforcement; WPA2-PSK, explicit open, and manual hidden WPA2; WEP and hidden open denial; unique IDs/SSIDs; redacted status; explicit local credential-free UI list with one active marker; sanitized `network connect status` with internal profile-handle validation and public omission; mode-0600 atomic single-profile supplicant projection; symlink, occupied-slot, live-lock, invalid-profile, and prior-byte preservation | | Wi-Fi scan API | Asynchronous start; redacted status; explicit ID-scoped local results; cancel and terminal discard; one active worker; five-second rate limit; 15-second runtime; 64-KiB raw ceiling; 32 unique printable SSIDs; eight-operation history; open/WPA2-PSK/unsupported classification; duplicate signal reconciliation; backend failure, timeout, oversize, unsafe-path, stale/live-lock, and unsupported-hardware handling | | Wi-Fi UI | Original Mini hidden; Settings, Shell Quick Settings, and GameSwitcher Quick Settings converge on `--settings-wifi`; direct radio toggle removed; bounded fixed-argv profile-list load outside render; connection state and saved-network detail; selectable Scan/Cancel row and read-only discovered networks; active-only 100-ms SDL wake; deferred GameSwitcher until cancellation discard; single-flight nonblocking fixed-argv scan client; 16-KiB output and five-second deadline; child process-group cleanup; controller-owned start/status/results/discard and cancel-during-start sequencing; 250-ms status opportunities; exact profile/scan/ack schemas; 16 profiles and 32 networks; unique bounded IDs/SSIDs; one active profile; fixed scan phases/errors; terminal history discarded; open/WPA2 profile form with shared keyboard, masked secret, fixed profile-upsert argv, escaped stdin JSON, strict ID/SSID/PSK validation, explicit secret clearing, nonblocking submit/poll, 4-KiB acknowledgement cap, exact upsert response, timeout process-group cleanup, exact saved-ID reuse, 104-bit no-follow random new handles, collision/security/full-store rejection, one editing/submitting controller with 100-ms poll opportunities, exact cancellation, terminal clearing, bounded focus return, supported scan-result selection, explicit saved-not-connected result, and no implicit association; explicit inactive-profile X/confirm forget flow; active-row refusal in Shell and store; fixed nonblocking delete; exact acknowledgement; terminal projection reload; graceful TERM cleanup before bounded KILL; exact guarded-connect status model with fixed phases/operations/failures, lease consistency, 64-byte transaction-ID and 300-second deadline ceilings, and discarded transaction/overlay identity; fixed no-follow `network connect status` loader with less-than-4-KiB output, five-second read ceiling, and stale-state clearing; separately typed single-flight nonblocking status request with process-group timeout and generic-poller refusal; controller-owned single request, 100-ms opportunities, duplicate-begin refusal, typed terminal state, teardown reaping, explicit guarded-state presentation, one-second freshness, fail-closed mutation gating for stale/unavailable/lease-armed/rollback-failed results, read-only refresh without queued intent, and exit teardown; credential and unknown-field rejection; passwords absent from arguments, logs, screenshots, durable Shell state, and evidence | @@ -91,7 +91,7 @@ shoulder button. | System View recognition, Continue, populated systems, and empty-system hiding | not-run | blocked-physical | not-run | not-run | | Game-list discovery, exact restoration, and held-scroll control | not-run | blocked-physical | not-run | not-run | | Flat Settings, footer density, and focus visibility | not-run | blocked-physical | not-run | not-run | -| Optional L1/R1 list paging and SSH/SFTP/Samba controls | not-run | partial-remote | not-run | not-run | +| Optional L1/R1 list paging and SSH/SFTP controls | not-run | partial-remote | not-run | not-run | | MENU GameSwitcher and START Quick Settings consistency | not-run | blocked-physical | not-run | not-run | The signed Plus UX-convergence evidence is recorded in diff --git a/docs/SECURITY.md b/docs/SECURITY.md index a2ee33269..77070c3a2 100644 --- a/docs/SECURITY.md +++ b/docs/SECURITY.md @@ -30,6 +30,11 @@ The inherited bftpd executables, anonymous/authenticated configurations, start logic, default credentials, and visible Tweaks controls are excluded as well; stale FTP state cleanup and exact `bftpd` termination remain for older-card compatibility. +The rejected inherited Samba executable and libraries remain excluded, and its +configuration, dormant start logic, share editor, default credentials, and +visible Tweaks controls are no longer shipped or exposed. The signed disable +migration, stale-state cleanup, and exact `smbd` termination remain for +older-card compatibility. The reviewed key-only Dropbear transport is the only stable remote listener; SFTP is independently gated and confined through that same transport. Its chroot is materialized from the versioned canonical transfer policy rather diff --git a/src/tweaks/appstate.h b/src/tweaks/appstate.h index 34ff8550c..cb08e8b52 100644 --- a/src/tweaks/appstate.h +++ b/src/tweaks/appstate.h @@ -18,7 +18,6 @@ bool isMenu(List *target) static List _menu_network; static List _menu_wifi; static List _menu_wps; -static List _menu_smbd; static List _menu_vnc; void menu_network_free_all(void) @@ -26,7 +25,6 @@ void menu_network_free_all(void) list_free(&_menu_network); list_free(&_menu_wifi); list_free(&_menu_wps); - list_free(&_menu_smbd); list_free(&_menu_vnc); } diff --git a/src/tweaks/network.h b/src/tweaks/network.h index 75ddc6e1e..3bc299e85 100644 --- a/src/tweaks/network.h +++ b/src/tweaks/network.h @@ -24,14 +24,11 @@ #include "./appstate.h" #define NET_SCRIPT_PATH "/mnt/SDCARD/.tmp_update/script/network" -#define SMBD_CONFIG_PATH "/mnt/SDCARD/.tmp_update/config/smb.conf" static struct network_s { - bool smbd; bool hotspot; bool ntp; bool ntp_wait; - bool auth_smbd; bool manual_tz; bool check_updates; bool keep_alive; @@ -48,7 +45,6 @@ void network_loadState(void) if (network_state.loaded) return; - network_state.smbd = config_flag_get(".smbdState"); network_state.hotspot = config_flag_get(".hotspotState"); network_state.ntp = config_flag_get(".ntpState"); network_state.ntp_wait = config_flag_get(".ntpWait"); @@ -61,131 +57,6 @@ void network_loadState(void) network_state.loaded = true; } -typedef struct { - char name[STR_MAX - 11]; - char path[STR_MAX]; - int available; // 1 if available = yes, 0 otherwise - long availablePos; // in file position for the available property -} Share; - -static Share *_network_shares = NULL; -static int network_numShares; - -void network_freeSmbShares() -{ - if (_network_shares != NULL) { - free(_network_shares); - } -} - -void network_getSmbShares() -{ - if (_network_shares != NULL) { - return; - } - - int numShares = 0; - - FILE *file = fopen(SMBD_CONFIG_PATH, "r"); - if (file == NULL) { - printf("Failed to open smb.conf file.\n"); - return; - } - - char line[STR_MAX]; - - bool found_shares = false; - bool is_available = false; - long availablePos = -1; - - while (fgets(line, sizeof(line), file) != NULL) { - char *trimmedLine = strtok(line, "\n"); - if (trimmedLine == NULL) { - continue; - } - - if (strstr(trimmedLine, "available = ") != NULL) { - availablePos = ftell(file) - strlen(trimmedLine) - 1; - is_available = strstr(trimmedLine, "1") != NULL; - continue; - } - - if (strstr(trimmedLine, "path = ") != NULL) { - strncpy(_network_shares[numShares - 1].path, trimmedLine + 7, STR_MAX); - continue; - } - - if (strncmp(trimmedLine, "[", 1) == 0 && strncmp(trimmedLine + strlen(trimmedLine) - 1, "]", 1) == 0) { - if (found_shares) { - _network_shares[numShares - 1].available = is_available; - _network_shares[numShares - 1].availablePos = availablePos; - is_available = false; - } - - char *shareName = strtok(trimmedLine + 1, "]"); - if (shareName != NULL && strlen(shareName) > 0) { - if (strcmp(shareName, "global") == 0) { - continue; - } - - numShares++; - _network_shares = (Share *)realloc(_network_shares, numShares * sizeof(Share)); - - bool add_exclamation = false; - if (strncmp("__", shareName, 2) == 0) { - shareName = shareName + 2; - add_exclamation = true; - } - - strncpy(_network_shares[numShares - 1].name, shareName, STR_MAX - 11); - - if (add_exclamation) { - strncat(_network_shares[numShares - 1].name, " (!)", STR_MAX - 11 - strlen(shareName)); - } - - found_shares = true; - } - } - } - - if (found_shares) { - _network_shares[numShares - 1].available = is_available; - _network_shares[numShares - 1].availablePos = availablePos; - } - - network_numShares = numShares; - - fclose(file); -} - -void network_toggleSmbAvailable(void *item) -{ - ListItem *listItem = (ListItem *)item; - Share *share = (Share *)listItem->payload_ptr; - - FILE *file = fopen(SMBD_CONFIG_PATH, "r+"); - if (file == NULL) { - printf("Failed to open smb.conf file.\n"); - return; - } - - if (fseek(file, share->availablePos, SEEK_SET) != 0) { - printf("Failed to seek to the available property of share '%s'.\n", share->name); - fclose(file); - return; - } - - char line[STR_MAX]; - fgets(line, sizeof(line), file); - share->available = strstr(line, "1") == NULL; // toggle - - fseek(file, share->availablePos, SEEK_SET); - fprintf(file, "available = %d\n", share->available); - fflush(file); - - fclose(file); -} - void network_setState(bool *state_ptr, const char *flag_name, bool value) { *state_ptr = value; @@ -208,23 +79,6 @@ void network_execServiceState(const char *service_name, bool background) printf_debug("network_execServiceState: %s\n", state); } -void network_commonEnableToggle(List *list, ListItem *item, bool *value_pt, const char *service_name, const char *service_flag) -{ - bool enabled = item->value == 1; - network_setState(value_pt, service_flag, enabled); - if (_menu_network._created) { - list_currentItem(&_menu_network)->value = enabled; - } - network_execServiceState(service_name, false); - reset_menus = true; - all_changed = true; -} - -void network_setSmbdState(void *pt) -{ - network_commonEnableToggle(&_menu_smbd, (ListItem *)pt, &network_state.smbd, "smbd", ".smbdState"); -} - void network_setHotspotState(void *pt) { network_setState(&network_state.hotspot, ".hotspotState", ((ListItem *)pt)->value); @@ -349,43 +203,6 @@ void network_setVNCFPS(void *pt) } } -void menu_smbd(void *pt) -{ - ListItem *item = (ListItem *)pt; - item->value = (int)network_state.smbd; - - if (!_menu_smbd._created) { - network_getSmbShares(); - - _menu_smbd = list_createWithSticky(1 + network_numShares, "Samba"); - - list_addItemWithInfoNote(&_menu_smbd, - (ListItem){ - .label = "Enable", - .sticky_note = "Enable Samba file sharing", - .item_type = TOGGLE, - .value = (int)network_state.smbd, - .action = network_setSmbdState}, - item->info_note); - - for (int i = 0; i < network_numShares; i++) { - ListItem shareItem = { - .item_type = TOGGLE, - .disabled = !network_state.smbd, - .action = network_toggleSmbAvailable, // set the action to the wrapper function - .value = _network_shares[i].available, - .payload_ptr = _network_shares + i // store a pointer to the share in the payload - }; - snprintf(shareItem.label, STR_MAX - 1, "Share: %s", _network_shares[i].name); - strncpy(shareItem.sticky_note, str_replace(_network_shares[i].path, "/mnt/SDCARD", "SD:"), STR_MAX - 1); - list_addItem(&_menu_smbd, shareItem); - } - } - - menu_stack[++menu_level] = &_menu_smbd; - header_changed = true; -} - void menu_wps(void *_) { if (!_menu_wps._created) { @@ -472,7 +289,7 @@ void menu_wifi(void *_) void menu_network(void *_) { if (!_menu_network._created) { - _menu_network = list_create(7, LIST_SMALL); + _menu_network = list_create(6, LIST_SMALL); strcpy(_menu_network.title, "Network"); network_loadState(); @@ -486,21 +303,6 @@ void menu_network(void *_) (ListItem){ .label = "WiFi: Hotspot/WPS...", .action = menu_wifi}); - list_addItemWithInfoNote(&_menu_network, - (ListItem){ - .label = "Samba: Network file share...", - .item_type = TOGGLE, - .disabled = !settings.wifi_on, - .alternative_arrow_action = true, - .arrow_action = network_setSmbdState, - .value = (int)network_state.smbd, - .action = menu_smbd}, - "Samba is a file sharing protocol that provides\n" - "integrated sharing of files and directories\n" - "between your Miyoo Mini Plus and your PC.\n" - " \n" - "Username: onion\n" - "Password: onion\n"); list_addItemWithInfoNote(&_menu_network, (ListItem){ .label = "VNC: Screen share...", diff --git a/src/tweaks/tweaks.c b/src/tweaks/tweaks.c index 4f6f91726..e79148561 100644 --- a/src/tweaks/tweaks.c +++ b/src/tweaks/tweaks.c @@ -280,7 +280,6 @@ int main(int argc, char *argv[]) Mix_CloseAudio(); - network_freeSmbShares(); diags_freeEntries(); display_close(); diff --git a/static/build/.tmp_update/script/network/update_networking.sh b/static/build/.tmp_update/script/network/update_networking.sh index 97eaccda8..4743835ed 100644 --- a/static/build/.tmp_update/script/network/update_networking.sh +++ b/static/build/.tmp_update/script/network/update_networking.sh @@ -200,49 +200,6 @@ wifi_off() { /customer/app/axp_test wifioff } -# Starts the samba daemon if the toggle is set to on -check_smbdstate() { - if flag_enabled smbdState; then - if is_running smbd; then - if wifi_disabled; then - log "Samba: Wifi is turned off, disabling the toggle for smbd and killing the process" - disable_flag smbdState - killall -9 smbd - fi - else - if wifi_enabled; then - sync - - mkdir -p \ - /var/lib/samba \ - /var/run/samba/ncalrpc \ - /var/private \ - /var/log/ - - $netscript/start_smbd.sh $PASS & - log "Samba: Starting smbd.." - else - disable_flag smbdState - fi - fi - else - if is_running smbd; then - killall -9 smbd - log "Samba: Killed" - fi - fi -} - -smbd_authed() { - if flag_enabled smbdState; then - update_smbconf - if is_running smbd; then - killall -9 smbd - fi - $netscript/start_smbd.sh $PASS & - fi -} - # Starts only Bloom's explicit developer-mode, key-only SSH service. check_sshstate() { if $sysdir/bin/bloom-dev-ssh start; then @@ -392,12 +349,9 @@ set_tzid() { } print_usage() { - echo "Usage: $0 {check|ftp|telnet|http|smbd|disableall|save|restore|full_reset} [toggle|authed]" - echo " - For {ftp|telnet|http|ssh|smbd}, [toggle|authed] can be specified." - echo " - Commands {ntp|hotspot} only accept 'toggle'." + echo "Usage: $0 {check|services|ntp|disableall|save|restore|full_reset} [toggle]" + echo " - Command {ntp} only accepts 'toggle'." echo " - Commands {save|restore|full_reset} do not require additional args." - echo "e.g:" - echo "ftp toggle - Will toggle the current FTP state" exit 1 } diff --git a/static/configs/.tmp_update/config/smb.conf b/static/configs/.tmp_update/config/smb.conf deleted file mode 100644 index b8b096c51..000000000 --- a/static/configs/.tmp_update/config/smb.conf +++ /dev/null @@ -1,104 +0,0 @@ -## Onion smb.conf - -[global] - -workgroup = workgroup -client min protocol = SMB2 -client max protocol = SMB3 -log file = /var/log/%m.log -max log size = 1000 -guest account = root - -private dir = /var/private -lock directory = /var/lock -pid directory = /var/run -state directory = /var/lib/samba -ncalrpc dir = /var/run/samba/ncalrpc -cache directory = /var/run/samba/locks/cache -ntp signd socket directory = /var/lib/ntp_signd -pid directory = /var/run/ - -server role = standalone server - -## Edit your shares below - -[BIOS] -valid users = onion -path = /mnt/SDCARD/BIOS -public = 1 -writable = 1 -force create mode = 0666 -force directory mode = 0777 -available = 1 - -[Media] -valid users = onion -path = /mnt/SDCARD/Media -public = 1 -writable = 1 -force create mode = 0666 -force directory mode = 0777 -available = 1 - -[Overlays] -valid users = onion -path = /mnt/SDCARD/RetroArch/.retroarch/overlay -public = 1 -writable = 1 -force create mode = 0666 -force directory mode = 0777 -available = 1 - -[Roms] -valid users = onion -path = /mnt/SDCARD/Roms -public = 1 -writable = 1 -force create mode = 0666 -force directory mode = 0777 -available = 1 - -[Saves] -valid users = onion -path = /mnt/SDCARD/Saves/CurrentProfile/saves -public = 1 -writable = 1 -force create mode = 0666 -force directory mode = 0777 -available = 1 - -[Screenshots] -valid users = onion -path = /mnt/SDCARD/Screenshots -public = 1 -writable = 1 -force create mode = 0666 -force directory mode = 0777 -available = 1 - -[Themes] -valid users = onion -path = /mnt/SDCARD/Themes -public = 1 -writable = 1 -force create mode = 0666 -force directory mode = 0777 -available = 1 - -[Video filters] -valid users = onion -path = /mnt/SDCARD/RetroArch/.retroarch/filters/video -public = 1 -writable = 1 -force create mode = 0666 -force directory mode = 0777 -available = 1 - -[__SDCARD] -valid users = onion -path = /mnt/SDCARD/ -public = 0 -writable = 1 -force create mode = 0666 -force directory mode = 0777 -available = 0 diff --git a/test/shell/branding_copy.bats b/test/shell/branding_copy.bats index c0c5fda93..f68ac3f0e 100644 --- a/test/shell/branding_copy.bats +++ b/test/shell/branding_copy.bats @@ -4,9 +4,10 @@ run python3 /workspace/tools/validate_branding_copy.py --repository /workspace [ "$status" -eq 0 ] - [[ "$output" == "branding copy validate: 8 classified legacy literals" ]] + [[ "$output" == "branding copy validate: 6 classified legacy literals" ]] ! grep -F 'website hosted by' /workspace/src/tweaks/network.h ! grep -F 'FTP provides' /workspace/src/tweaks/network.h + ! grep -F 'Samba is a file sharing protocol' /workspace/src/tweaks/network.h grep -F 'Reset all BloomOS system settings' /workspace/src/tweaks/menus.h grep -F 'BloomOS save folder map' /workspace/static/configs/Saves/CurrentProfile/saves/README.txt grep -F 'label = BloomOS-v{VERSION}' /workspace/static/build/autorun.inf diff --git a/test/shell/ci_validation.bats b/test/shell/ci_validation.bats index 83f61282a..944bde24f 100644 --- a/test/shell/ci_validation.bats +++ b/test/shell/ci_validation.bats @@ -85,9 +85,15 @@ run sh -c "printf '%s\n' tools/bloom-samba-feasibility-service | '$scope' static-analysis" [ "$status" -eq 0 ] [ "$output" = "none" ] + run sh -c "printf '%s\n' static/configs/.tmp_update/config/smb.conf | '$scope' build" + [ "$status" -eq 0 ] + [ "$output" = "full" ] run sh -c "printf '%s\n' static/build/.tmp_update/bin/samba/sbin/smbd | '$scope' risk" [ "$status" -eq 0 ] [ "$output" = "3" ] + run sh -c "printf '%s\n' static/configs/.tmp_update/config/smb.conf | '$scope' static-analysis" + [ "$status" -eq 0 ] + [ "$output" = "none" ] run sh -c "printf '%s\n' tools/bloom-samba-feasibility-service | '$scope' native-tests" [ "$status" -eq 0 ] [ "$output" = "full" ] diff --git a/test/shell/samba_source_build.bats b/test/shell/samba_source_build.bats index 2c8f1f736..bd9b78bd7 100644 --- a/test/shell/samba_source_build.bats +++ b/test/shell/samba_source_build.bats @@ -61,3 +61,24 @@ setup() { [ ! -e /workspace/static/build/.tmp_update/lib/samba ] [ ! -e /workspace/static/build/.tmp_update/script/network/start_smbd.sh ] } + +@test "stable Samba configuration and Tweaks exposure remain retired" { + network=/workspace/static/build/.tmp_update/script/network/update_networking.sh + tweaks=/workspace/src/tweaks/network.h + + [ ! -e /workspace/static/configs/.tmp_update/config/smb.conf ] + ! grep -F 'check_smbdstate()' "$network" + ! grep -F 'smbd_authed()' "$network" + ! grep -F 'start_smbd.sh' "$network" + ! sed -n '/^print_usage()/,/^}/p' "$network" | grep -F 'smbd' + grep -F 'disable_flag smbdState' "$network" + grep -F 'for process in bftpd filebrowser telnetd hostapd dnsmasq smbd; do' "$network" + ! grep -F 'network_state.smbd' "$tweaks" + ! grep -F 'network_setSmbdState' "$tweaks" + ! grep -F 'Samba: Network file share' "$tweaks" + samba_doc=/workspace/website/docs/07-apps/03-network-features/01-samba-file-sharing.md + grep -F 'BloomOS does not ship or start the inherited Samba server' "$samba_doc" + grep -F '/docs/network/ssh' "$samba_doc" + ! grep -F 'Enabling Samba' "$samba_doc" + ! grep -F 'Samba: Network file share' /workspace/website/docs/07-apps/01-included-in-onion/tweaks.mdx +} diff --git a/test/test_retroarch_build_identity.py b/test/test_retroarch_build_identity.py index e53557781..e38b7dc37 100644 --- a/test/test_retroarch_build_identity.py +++ b/test/test_retroarch_build_identity.py @@ -38,7 +38,7 @@ def test_identity_is_stable_for_unrelated_inventory_totals(self): changed = LOCK.read_text(encoding="utf-8") changed = changed.replace("component_count = 331", "component_count = 999") changed = changed.replace("file_count = 1972", "file_count = 9999") - changed = changed.replace("byte_count = 260959742", "byte_count = 999999999") + changed = changed.replace("byte_count = 260958446", "byte_count = 999999999") self.assertNotEqual(changed, LOCK.read_text(encoding="utf-8")) with tempfile.TemporaryDirectory() as directory: candidate = pathlib.Path(directory) / "dependencies.lock" diff --git a/tools/ci-scope.sh b/tools/ci-scope.sh index efaa5c06c..4163b769c 100755 --- a/tools/ci-scope.sh +++ b/tools/ci-scope.sh @@ -275,7 +275,8 @@ while IFS= read -r path; do tools/bloom-samba-feasibility-service|test/shell/samba_source_build.bats|\ test/shell/samba_service.bats|static/build/.tmp_update/bin/bloom-samba-service|\ static/build/.tmp_update/bin/samba/*|static/build/.tmp_update/lib/samba/*|\ - static/build/.tmp_update/script/network/start_smbd.sh) + static/build/.tmp_update/script/network/start_smbd.sh|\ + static/configs/.tmp_update/config/smb.conf) # Stable-payload changes need the complete ARM packaging gate, but # shell-only feasibility sources do not expand C/C++ static analysis. [ "$mode" != build ] || full=1 @@ -494,7 +495,8 @@ while IFS= read -r path; do tools/bloom-samba-feasibility-service|test/shell/samba_source_build.bats|\ test/shell/samba_service.bats|static/build/.tmp_update/bin/bloom-samba-service|\ static/build/.tmp_update/bin/samba/*|static/build/.tmp_update/lib/samba/*|\ - static/build/.tmp_update/script/network/start_smbd.sh) + static/build/.tmp_update/script/network/start_smbd.sh|\ + static/configs/.tmp_update/config/smb.conf) raise_risk 3 add_shell_target /workspace/test/shell/samba_source_build.bats add_shell_target /workspace/test/shell/samba_service.bats diff --git a/website/docs/01-features/index.md b/website/docs/01-features/index.md index 24dd50875..f4cf49604 100644 --- a/website/docs/01-features/index.md +++ b/website/docs/01-features/index.md @@ -210,7 +210,7 @@ For the Miyoo Mini Plus (equipped with wifi) Onion offers many additional possib - [Automatic date/time synchronisation](apps/tweaks#set-automatically-via-the-internet) (NTP, via Tweaks app) - [Retroachivements](https://www.retroarch.com/?page=achievements) - [Scraper](/docs/apps/scraper): import game covers directly from your MMP -- [Network Services](network-features): [Samba/SMB share](network/samba), [HTTP server (retired)](network/http), [SSH/SFTP](network/ssh), [Hotspot](network/hotspot), [VNC server](network/vnc)... +- [Network Services](network-features): [HTTP server (retired)](network/http), [SSH/SFTP](network/ssh), [Hotspot](network/hotspot), [VNC server](network/vnc)... ::: diff --git a/website/docs/07-apps/01-included-in-onion/tweaks.mdx b/website/docs/07-apps/01-included-in-onion/tweaks.mdx index fd36db259..ae5f33088 100644 --- a/website/docs/07-apps/01-included-in-onion/tweaks.mdx +++ b/website/docs/07-apps/01-included-in-onion/tweaks.mdx @@ -174,12 +174,6 @@ It can be MainUI, [GameSwitcher](./game-switcher), [Retroarch](./retroarch) or [
-### Samba: Network file share... - -
Samba is a file sharing protocol that provides integrated sharing of files and directories between your Miyoo Mini Plus and your PC.
-
-
- ### SSH: Secure shell...
SSH provides a secure command line host for communicating with your device remotely. SFTP provides a secure file transfer protocol.
diff --git a/website/docs/07-apps/03-network-features/01-samba-file-sharing.md b/website/docs/07-apps/03-network-features/01-samba-file-sharing.md index 2b4cf5146..874a1d26c 100644 --- a/website/docs/07-apps/03-network-features/01-samba-file-sharing.md +++ b/website/docs/07-apps/03-network-features/01-samba-file-sharing.md @@ -2,91 +2,21 @@ slug: /network/samba --- - # Samba file sharing -The Samba is a file sharing protocol that provides integrated sharing of files and directories between your Miyoo Mini plus and your PC (Windows/Unix/Linux). It enables easy access, allowing you to share, access, and modify files as if they were stored locally on your PC. - - -If the folder you try to access does not exist locally on the device you will get an error. - - -## Features - -- File transfer - -- Mounted drive in Windows - -- Instant file visibility - -- Customizable share folders - - -## Enabling Samba - -You'll find it in **Apps** › **Tweaks** › **Network** › **Samba: Network file share** - - - - -Make a note of the IP address at the top here, you'll need it for the next steps! - -:::note DEFAULT CREDENTIALS -The default **username** and **password** is currently `onion`:`onion` -::: - - -## Usage - -Samba will provide you a streamlined method of transferring files across to your Miyoo Mini Plus. The folders you can access will be hosted by the device, and will be accessible through your file browser within Windows/Linux. - -Once you've enabled Samba within tweaks, it will instantly activate. - -To browse to your shared folders within Windows: - -1. Hit the start button - -2. Now, type in the IP address of your MMP in this format: \\\x.x.x.x, e.g: - - ![](https://github.com/OnionUI/Onion/assets/47260768/9cf02397-09fb-4517-8ede-7b6dc44ee2b4) - -3. Press Enter. It may take a second but an explorer window will open and you'll be met with some pre-configured locations we thought would get you started! - - ![](https://github.com/OnionUI/Onion/assets/47260768/632782d4-b827-44ca-9806-7102a239200f) - -4. If you have Network File Sharing enabled on Windows, you'll also be able to pin the location to your `quick access` by finding it in the left pane of your explorer window, and clicking `Pin to Quick access` - - ![](https://github.com/OnionUI/Onion/assets/47260768/2d5c7366-40ad-4992-ae9d-86e1c9019fb6) - -5. The shares will now appear in your quick access pane: - - ![](https://github.com/OnionUI/Onion/assets/47260768/5cbcaf2c-f4eb-4921-9fc3-17974f0ddf9e) - -:::tip Network shares -The subfolders can also be mapped as network shares by right clicking on "This PC" or "My Computer" and clicking "Map network drive" - Bare in mind you will have the map to a share directory instead of the root; for example: `\\192.168.1.215\screenshots` - Give it a drive letter and it's ready! -::: - - -## Share control - -We've made controlling shares as easy as possible; from the "Samba: Network file share..." menu item, press A. You'll now be met with a list of shares, these can be instantly toggled on or off. - -![](https://github.com/OnionUI/Onion/assets/47260768/1cf85fc9-1583-4c1f-bce6-b441645e1cde) - - -## Adding more shares (or removing them!) - -It's your Onion.. So let's get you setup with more (or less!) shares. We'll need to edit a file called smb.conf which is found in `/mnt/SDCARD/.tmp_update/config/smb.conf`. - -Use the reviewed [SSH / SFTP service](/docs/network/ssh), or remove the SD card -and edit the file directly. The inherited FTP and HTTP servers are not shipped -or started by BloomOS. - -To add a share folder, just make a copy of and existing entry and modify the path/name, restart Samba in tweaks and you're ready to go - it'll automatically appear in your Samba menu in tweaks and be ready to access. - +BloomOS does not ship or start the inherited Samba server. Hardware feasibility +testing found that the inherited payload failed BloomOS provenance, +authentication, product-identity, and memory gates. A reproducible source-built +candidate remains non-shipping until every hardware and release gate is met. -## Security +Use the reviewed public-key-only [SSH / SFTP service](/docs/network/ssh) for +remote file transfer. SFTP exposes only policy-approved roots, keeps Saves +read-only, and excludes credentials and update state. -Samba offers auth at a unix user level. The current username and password is onion:onion +Removing an older SD card's `.smbdState` marker is optional: BloomOS ignores and +retires it during compatibility reconciliation and stops any inherited `smbd` +process. The signed disable migration and rollback-compatible listener cleanup +remain in place for older cards. -You'll see there's a share in `smb.conf` called "__sdcard"; this should be left disabled unless you're absolutely sure you want to share the whole SD folder structure. +See the [Samba feasibility gate](https://github.com/boburning/BloomOS/blob/main/docs/SAMBA_FEASIBILITY_1.0.md) +for the measured engineering decision and retained evidence.