From 3f3753e2b5408ec48bed200f9004bc584d3fc4b9 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sat, 30 May 2026 08:46:11 +0000 Subject: [PATCH] tests: record AFP scan file information smoke results Record the verified Linux smoke-test output for NCP 0x2222/35 subfunctions 0x11 and 0x0a, AFP Scan File Information and AFP 2.0 Scan File Information. The WebSDK/header-level request layout for both scan calls carries the Mac base directory id, last-seen entry id, desired response count, search bitmap, request bitmap, and path modifier. The current mars_nwe implementation intentionally routes both variants through the same conservative path-backed directory scan and returns a single AFP file-information record per request. Documenting the matching 0x11 and 0x0a first-record output makes that compatibility choice explicit. The recorded continuation case also documents the current last_seen pagination contract: callers feed the returned next_last_seen AFP Entry ID back into the next request to advance through SYS:PUBLIC. The sample entries remain stat-derived fallback Entry IDs with parent_id kept at zero until persistent CNID/AppleDouble/libatalk-backed directory identity is available. Tests: - ./afp_scan_info_smoke -S MARS -U SUPERVISOR -P ... SYS:PUBLIC - ./afp_scan_info_smoke --afp10 -S MARS -U SUPERVISOR -P ... SYS:PUBLIC - ./afp_scan_info_smoke -S MARS -U SUPERVISOR -P ... --last-seen 0x23c8787d SYS:PUBLIC TODO: - Add multi-response scan replies once the record packing and client-side parsing are widened beyond the current one-record smoke path. - Replace stat-derived fallback Entry IDs with persistent CNID/AppleDouble/libatalk-backed IDs. --- TODO.md | 5 ++++- tests/linux/README.md | 11 ++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index fa88067..ef705fa 100644 --- a/TODO.md +++ b/TODO.md @@ -213,7 +213,10 @@ Current status: defaults to the AFP 2.0 subfunction and uses `--afp10` for the older endpoint. Runtime coverage has been verified against `SYS:PUBLIC` by walking multiple directory entries with the returned `next_last_seen` AFP - Entry ID continuation value. + Entry ID continuation value. The verified AFP 2.0 and older `0x0a` first + records both return `pmdflts.ini` (`entry_id=0x23c8787d`, `data_len=8161`) + on the sample tree, and an AFP 2.0 continuation with that Entry ID returns + `ohlogscr.bat` (`entry_id=0x260437f6`, `data_len=1296`). - `AFP Get Entry ID From NetWare Handle` is implemented for read-only data-fork file handles that are opened in the same client connection. Linux smoke coverage uses `tests/linux/afp_entry_id_smoke --from-handle` and has been diff --git a/tests/linux/README.md b/tests/linux/README.md index d735bf2..c0507ec 100644 --- a/tests/linux/README.md +++ b/tests/linux/README.md @@ -324,11 +324,20 @@ Useful smoke sequence for a standard MARS-NWE `SYS:PUBLIC` directory: ./tests/linux/afp_scan_info_smoke --allow-empty -S MARS -U SUPERVISOR -P secret --last-seen 0x260437f6 SYS:PUBLIC ``` +Verified runtime output for the first entries in the sample `SYS:PUBLIC` tree: + +```text +AFP Scan File Info subfunction=0x11 path=SYS:PUBLIC last_seen=0x00000000 desired=1 next_last_seen=0x23c8787d entry_id=0x23c8787d parent_id=0x00000000 attrs=0x0000 data_len=8161 resource_len=0 offspring=0 long_name=pmdflts.ini short_name=pmdflts.ini rights=0x9700 +AFP Scan File Info subfunction=0x0a path=SYS:PUBLIC last_seen=0x00000000 desired=1 next_last_seen=0x23c8787d entry_id=0x23c8787d parent_id=0x00000000 attrs=0x0000 data_len=8161 resource_len=0 offspring=0 long_name=pmdflts.ini short_name=pmdflts.ini rights=0x9700 +AFP Scan File Info subfunction=0x11 path=SYS:PUBLIC last_seen=0x23c8787d desired=1 next_last_seen=0x260437f6 entry_id=0x260437f6 parent_id=0x00000000 attrs=0x0000 data_len=1296 resource_len=0 offspring=0 long_name=ohlogscr.bat short_name=ohlogscr.bat rights=0x9700 +``` + The concrete Entry IDs vary by filesystem metadata and are currently marked as `fallback` in server diagnostics when they are derived from `stat(2)` rather than persistent CNID/AppleDouble metadata. The verified AFP 2.0 smoke path walks multiple entries in `SYS:PUBLIC` by feeding each returned -`next_last_seen` value into the next request. The `0x0a` path intentionally +`next_last_seen` value into the next request, and the older `0x0a` path returns +the same first-entry record for the same request. The `0x0a` path intentionally shares that conservative scan implementation so older AFP callers can probe the same read-only directory listing semantics before fuller multi-response and CNID-backed scans are implemented.